Need help Buffer value call from TMA_Centered_H1_V2_VS

1
I call buffers by using data window
Here you see data window
value 1 is TMA center line .it has value in both upper cloud and lower cloud.
Lower support band is value 5 and upper resistant band is value 4
For buy ,I use value 1 (buffer 0 ) and lower support band value 5(buffer 4)
for sell , value 1 and value 4 .
But open orders are randomly.
Please suggest me.

Code: Select all

  double cloud =iCustom(NULL,0,"TMA_Centered_H1_V2_VS",0,0);
   double resis =iCustom(NULL,0,"TMA_Centered_H1_V2_VS",4,0);
   double supp =iCustom(NULL,0,"TMA_Centered_H1_V2_VS",5,0);
   if( cloud <Close[0] && supp !=EMPTY_VALUE) return(buy);
   if(cloud >Close[0]&&resis !=EMPTY_VALUE) return(sell);
    


Re: Need help Buffer value call from TMA_Centered_H1_V2_VS

2
Could it be because you are not checking to see if you were or are already in a trade? Check out this logic, maybe it will help...

Code: Select all

if(inBuyTrade())
      {
         if(sellEntryCondition(trend) || waitCondition(trend)) //If flips
         {
            exitBuys();
         }
         if(isTPHit())
         {
            setBreakEven();
            if(trailingStopInitiatedBuy(atr))
            {
               setTrailingStop(atr);
            }
         }
      }
      if(inSellTrade())
      {
         if(buyEntryCondition(trend) || waitCondition(trend))
         {
            exitSells();
         }
         if(isTPHit())
         {
            setBreakEven();
            if(trailingStopInitiatedSell(atr))
            {
               setTrailingStop(atr);
            }
         }
      }
      
      if(!inBuyTrade() && !inSellTrade())
      {
         if(lastInSell() || wasPreviouslyWait(wait))
         {
            if(buyEntryCondition(trend)) //Pass info needed as params
            {
               placeBuy(atr);
            }
         }
         if(lastInBuy() || wasPreviouslyWait(wait))
         {
            if(sellEntryCondition(trend)) //Pass info needed as params
            {
               placeSell(atr);
            }
         }
      }

Who is online

Users browsing this forum: ChuChu Rocket and 23 guests