Thread: MQL4 Learning
View Single Post
  #109 (permalink)  
Old 07-23-2007, 06:16 PM
newdigital newdigital is offline
Administrator
 
Join Date: Sep 2005
Posts: 16,311
Blog Entries: 106
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
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;
Reply With Quote