need help in my code "sell limit decreasing"
Ali Thaer Tarteeb Tarteeb:
hello everyone, i'm trying to write EA that decrease the current sell limit price every minute by one tick volume. but i get errors always can anyone help.
the errors are:
and the code is
I change your code into this:
input double Lots = 0.5; input int Slippage = 2; input int MagicNumber = 1234; void OnTick() { static datetime lastExecution = 0; if(TimeCurrent() - lastExecution < 60) return; double tickSize = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_SIZE); double currentAsk = SymbolInfoDouble(_Symbol, SYMBOL_ASK); double currentSellLimit = NormalizeDouble(currentAsk - tickSize, _Digits); MqlTradeRequest request; MqlTradeResult result; ZeroMemory(request); request.action = TRADE_ACTION_REMOVE; request.magic = MagicNumber; request.symbol = _Symbol; request.volume = Lots; request.price = currentSellLimit; request.type = ORDER_TYPE_SELL_LIMIT; request.deviation = Slippage; if(OrderSend(request, result)) { lastExecution = TimeCurrent(); Print("Sell limit order placed at ", currentSellLimit, " with ticket #", result.order); } else { Print("OrderSend error: ", GetLastError()); } }
And no error message on compiling.
Have a nice coding :-)
hello everyone, i'm trying to write EA that decrease the current sell limit price every minute by one tick volume. but i get errors always can anyone help.
the errors are:
and the code is