I woulnd`t know how to code such return, promise to get on it tho! thanks
It so simple:
double Media = iMA (NULL,0,MA, MAShift,MAMethod, MAApliedTo,1);
if(OrdersTotal()==0) {
int res = 0;
if (Ask>Media+15*_Point)
res = OrderSend (Symbol (),OP_BUY,LotSize,Ask,6,Ask-StopLoss*_Point,Ask+TakeProfit*_Point,NULL,MagicNumber,0,Green);
if (Bid<Media-15*_Point)
res = OrderSend (Symbol (),OP_SELL,LotSize,Bid,6,Bid+StopLoss*_Point,Bid-TakeProfit*_Point,NULL,MagicNumber,0,Red);
if( res<0 ) GetLastError();
}
Keep in mind that OrdersTotal() return total of orders (both market and pending on your account). Using this variable can be right only
in
backtest.
Always better to create a custom function
checking if there are opened orders with Magic Number.
Anyway, as I already suggested, you can learn by the infinite amount of free code found on Codebase, instead
of opening thread related only to your bad coding skills.
Keep in mind that OrdersTotal() return total of orders (both market and pending on your account). Using this variable can be right
only in
backtest.
Always better to create a custom function
checking if there are opened orders with Magic Number.
So your
Will become
Anyway, as I already suggested, you can learn by the infinite amount of free code found on Codebase, instead of opening
thread related only to your bad coding skills.
I woulnd`t know how to code such return, promise to get on it tho! thanks
It so simple:
Keep in mind that OrdersTotal() return total of orders (both market and pending on your account). Using this variable can be right only in backtest.
Always better to create a custom function checking if there are opened orders with Magic Number.
So yourWill become
Anyway, as I already suggested, you can learn by the infinite amount of free code found on Codebase, instead of opening thread related only to your bad coding skills.It so simple:
Keep in mind that OrdersTotal() return total of orders (both market and pending on your account). Using this variable can be right only in backtest.
Always better to create a custom function checking if there are opened orders with Magic Number.
So yourWill become
Anyway, as I already suggested, you can learn by the infinite amount of free code found on Codebase, instead of opening thread related only to your bad coding skills.Thanks man!!