Help error: end_of_programme' - ending bracket '}' expected - page 2

 

Anybody can help me with unbalanced bracket on the code above?


Thank's

pgforex

 
if(OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES==true))
          if(OrderType() == OP_SELL && OrderSymbol() == Symbol())
          { 

Two if's one {

extern int  FirstTarget = 15;
if(Bid <= OrderOpenPrice()-(TakeProfit*Point)
{
OrderClose(OrderTicket(),CloseLots, Bid,3,Green)

The above you have constants 1, 3, 15. These have units of pips but the OrderSend/Mod/Close all need units of points.

On a four (4) digit broker 1 Point equals 1 pip. On a five (5) digit broker, Point equals 1/10 pip.

All those constants must be multiplied by 10 to have the same effect. Either YOU must change the constants (but the 3 is not exported) or the EA must adjust them.

That's what my pips2points and pips2dbl do:

if(Bid <= OrderOpenPrice()-(TakeProfit*pips2dbl)
{
OrderClose(OrderTicket(),CloseLots, Bid,3*pips2points,Green)
Reason: