Please, can someone give a simple example of how to send a buyLimit order for a symbol in Iranian Stock Market.
I had have a lot of problems doing it.
I need a sample code.
Thanks in advance.
hi
#include <Trade/Trade.mqh> MqlTradeRequest trReq; MqlTradeResult trRez; //+------------------------------------------------------------------+ void OnTick() { ENTER1= ? ENTER_STOP_LIMIT_1=? LOT=?; Buy_Stop_Trade_Sub_Program(ENTER1,ENTER_STOP_LIMIT_1); //---- return; } //------------------------------------- Buy_Stop_Trade_Sub_Program -------------------------------- void Buy_Stop_Trade_Sub_Program(double ENTER_PRICE, double ENTER_STOP_LIMIT) { trReq.symbol=Symbol(); trReq.action=TRADE_ACTION_PENDING; trReq.deviation=10; trReq.price=ENTER_PRICE; trReq.stoplimit=ENTER_STOP_LIMIT; trReq.sl=0; trReq.tp=0; trReq.type=ORDER_TYPE_BUY_STOP_LIMIT; trReq.volume=LOT; trReq.type_filling = ORDER_FILLING_RETURN; OrderSend(trReq,trRez); }
I used the above code when the market is closed and I get this result in the journal part:
failed buy stop limit 1k at symbolName 3740 (1000) [Invalid Price]
of course symbolName is the name of my own symbol. not that exact text.
void OnTick()
effect when each tick be recieved.
please show your code you use it .
effect when each tick will be recieved.
I used a timer to run that subFunction.
hi
how can find a solution for below error?
10026 | Autotrading disabled by server |
i cant add order in metatrader with iranian server?
Print(trRez.retcode);
i use this code in iran with mql5. trRez.retcode return 0
Print(trRez.retcode);
i use this code in iran with mql5. trRez.retcode return 0
Is it restricted by the Brokers ?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Please, can someone give a simple example of how to send a buyLimit order for a symbol in Iranian Stock Market.
I had have a lot of problems doing it.
I need a sample code.
Thanks in advance.