How to code such EA
Hello!
I want my EA to open new order when price is x-pips from last open order. EA opens buy when price is x-pips over last candle close. Then I want to open another buy when price is x-pips over from last open buy. I try like this but doesn't work. Thanks!
First you need to loop throug all orders to determine the highest open buy/lowest open sell.
After the loop you can open the new one .. if (Close[0]>LastBuyPrice+x*Point) OrderSend(:::)
Isn't this loop throug all orders?
for(cnt=OrdersTotal()-1;cnt>=0;cnt--)
can i c please what the var. Ordersdifference contains
It extern variable.
extern double Ordersdifference=0.0003;
try to use NormalizeDouble for that
oops check out MarketInfo(Symbol(),MODE_STOPLEVEL)
i think it's to small 0.003
But there is no stop level or take profit level. Why would there be a problem?
Problem is that EA opens many orders when rule is OK. For BUY it opens one order, but then when price goes up about 3pips it opens many orders and not only one as I want. Maybe it does't chack last order open price...
use return
Hello!
I want my EA to open new order when price is x-pips from last open order. EA opens buy when price is x-pips over last candle close. Then I want to open another buy when price is x-pips over from last open buy. I try like this but doesn't work. Thanks!