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 :-)

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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