Simple EA code gets unmatched data error

Back to topics list To post a new topic, please log in or register
avatar
1
rightvaughn 2016.03.27 04:13
 

Brand new to coding and trading.

Two questions: Why doesn't this work?

Would this even potentially be profitable?

   { 
   double DayOpen = iOpen(NULL,PERIOD_D1,1);
   double TakeProfitLevel;
   double StopLossLevel;
   int TakeProfit = 10;
   int StopLoss = 10; 
   TakeProfitLevel = Bid + TakeProfit*Point;   //0.0001
   StopLossLevel = Bid - StopLoss*Point;
   int total = OrdersTotal();
   if (total <= 0  && Bid < DayOpen - StopLossLevel)
   { 
   OrderSend("EURUSD", OP_BUY, 1.0, Ask, 0, StopLossLevel, TakeProfitLevel, "1st Order");
   }
   }
avatar
Moderator
3412
GumRai 2016.03.27 05:28 #
 
   TakeProfitLevel = Bid + TakeProfit*Point;   //0.0001

As Buys are opened at Ask, it is possible that you are trying to set take profit at below the entry price



Back to topics list  

To add comments, please log in or register