how to send buy orders in Iranian stock market?

 

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. 

 
sd2000sd:

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);
    }
 
TIMisthebest:

hi

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. 

 
sd2000sd:

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 .

 
TIMisthebest:

effect when each tick will be recieved.

I used a timer to run that subFunction.
 
sd2000sd:
I used a timer to run that subFunction.
show your code
 
TIMisthebest:

hi

the above code returns error 10006.
 

how can find a solution for below error?

10026

TRADE_RETCODE_SERVER_DISABLES_AT

Autotrading disabled by server


i cant add order in metatrader with iranian server?

 
   MqlTradeRequest trReq;
   MqlTradeResult trRez;
   trReq.symbol=Symbol();
   trReq.action=TRADE_ACTION_PENDING;
   trReq.deviation=10;
   MqlTick Latest_Price;  
   SymbolInfoTick(Symbol(),Latest_Price);
   trReq.price=Latest_Price.last;
   trReq.stoplimit=0;
   trReq.sl=0;
   trReq.tp=0;
   trReq.type=ORDER_TYPE_BUY_STOP_LIMIT;
   trReq.volume=1000;
   trReq.type_filling=ORDER_FILLING_RETURN;
   OrderSend(trReq,trRez);

   Print(trRez.retcode);

i use this code in iran with mql5. trRez.retcode return 0

please help me
 
meysam_212:
   MqlTradeRequest trReq;
   MqlTradeResult trRez;
   trReq.symbol=Symbol();
   trReq.action=TRADE_ACTION_PENDING;
   trReq.deviation=10;
   MqlTick Latest_Price;  
   SymbolInfoTick(Symbol(),Latest_Price);
   trReq.price=Latest_Price.last;
   trReq.stoplimit=0;
   trReq.sl=0;
   trReq.tp=0;
   trReq.type=ORDER_TYPE_BUY_STOP_LIMIT;
   trReq.volume=1000;
   trReq.type_filling=ORDER_FILLING_RETURN;
   OrderSend(trReq,trRez);

   Print(trRez.retcode);

i use this code in iran with mql5. trRez.retcode return 0

please help me

There is no way to trade by EA in Iran stock market. It's not allowed. 
 
Seyedfazel Hosseini:

There is no way to trade by EA in Iran stock market. It's not allowed. 

Is it restricted by the Brokers ?