play opposing help

 
 Print("Long-Short=", DoubleToStr(LongMa1-ShortMa1,5));
      res=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,Bid-StopLoss*Point,Ask+TakeProfit*Point,"",MAGICMA,0,Blue);
      intervalTrade = true;
      return;

I'm looking for code that will play the oppositely when opening price of the candle is higher than the closing price the previous candle.

e.

 
danielo87:

I'm looking for code that will play the oppositely when opening price of the candle is higher than the closing price the previous candle.

This is way too basic. Code hunting is not your answer. The code you provided have nothing to-do with the question you asked. Sorry I don't think you know what Open[0] and Close[1] means. Here's the Book, and don't skip chapters. For those who don't like my answer, sorry I'm not going to re-invent the Basics [the book already does a good job of doing that].

Peace-Out.

 
danielo87:

I'm looking for code that will play the oppositely when opening price of the candle is higher than the closing price the previous candle.

e.

Close[x+1]  //for closed bar
Open[x]     //for price opening bar 

I think you have to realize that the pricedifference is almost zero in most cases

you want to know the pricedifference of two following ticks

 

What is the function of opposed??

If close[x-1]<Open[x]

{......................

 
danielo87:

What is the function of opposed??

If close[x+1]<Open[x]

{......................

Here's the Book, and don't skip chapters ( x bar number ) ( corrected ( - ) ==> ( + ))
Reason: