Please not that I am not a coder so my opinion about how to code may be totally mistaken.
I just opened help in MetaEditor:
Code:
int OrderSend( string symbol, int cmd, double volume, double price, int slippage, double stoploss, double takeprofit, string comment=NULL, int magic=0, datetime expiration=0, color arrow_color=CLR_NONE)
where
- cmd - OP_BUY (buy), or OP_SELL (sell), and so on;
And also use MarketInfo.
Besices you may use some templates to create EAs:
Templates to create EAs and Indicators:
-
some good templates are
here;
-
templates with some new codes are
here.
-
Programming Modules with many programming functions are
here.
As to open the order at a certain time so you may use something like that:
Code:
datetime OpenOrder = StrToTime(TimeTrade)
and
Code:
if(CurTime() >= OpenTime && TimeCurrent() <= OpenOrder+60)
where,
extern string TimeTrade = "11:31";
datetime,
StrToTime and
TimeCurrent - see help in MetaEditor;