Download MetaTrader 5

Problem price ordersend()

To add comments, please log in or register
Man Man Minh
177
Man Man Minh  

Hi, traders 

I build EA with OrderSend like this

My condition, when complete current bar : If close() > MA(11) then
 Ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, StopLossLevel, TakeProfitLevel,.... 
 Ticket = OrderSend(Symbol(), OP_Sell, Lots, Bid, Slippage, StopLossLevel, TakeProfitLevel,.... 
And it works,
Now I want Ask = open() + 2 pips
            Bid = open() - 2 pips
I don't know how to do that? Use open() or open(-1) or open(1)?
Please help me.
thanks.
Eugenio Bravetti
4330
Eugenio Bravetti  
Ticket = OrderSend(Symbol(), OP_BUYSTOP, Lots, NormalizeDouble(Open[x] + (2 * Point), Digits), Slippage, StopLossLevel, TakeProfitLevel,.... 
Ticket = OrderSend(Symbol(), OP_SELLSTOP, Lots, NormalizeDouble(Open[x] - (2 * Point), Digits), Slippage, StopLossLevel, TakeProfitLevel,.... 

where [x] may be:

0 = Current Open bar

1 = Previus Open bar

etc....

and

you can use OP_BUY and OP_SELL only for send market order....if you send order at for example Open[x] + (2 * Point), you must use OP_BUYSTOP or OP_SELLSTOP

Man Man Minh
177
Man Man Minh  

thank I did, and now I want time expiration is 1 hour

 

Ticket = OrderSend(Symbol(), OP_BUYSTOP, Lots, NormalizeDouble(Open[x] + (2 * Point), Digits), Slippage, StopLossLevel, TakeProfitLevel,"cmt",MagicNumber,TimeCurrent()+3600,Red);

I use TimeCurrent()+3600 is right because I read in document this order calculates in second time so (1 hour = 3600 s).

And I want to backtest data, so traders can tell me  "Configuration PC system" to play backtest: OS Win7 64bit or 32bit, RAM .... CPU ..... in MQL4. Is there web or software to do that ?

Thanks 

To add comments, please log in or register