| New signals service! | |
|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Hi,
I've finished translate EL code to MT4. Try to test and optimize this EA. Igor
__________________
Let's improve trade skills together http://finance.groups.yahoo.com/group/TrendLaboratory |
|
|||
|
Hi Igorad how are you?
I nedd your help again. You translate this part of Easy Language... if (PositionProfit(1)<0 and PositionProfit(2)<0) then contr_plus=1; else contr_plus=0; ...with.... PastTradeProfit(); if ((pastpips[1]+pastpips[2]) < 0 && (pastpips[3]+pastpips[4]) < 0) { contr_plus = 1; } else { contr_plus = 0; } ...and.... void PastTradeProfit() { int total=HistoryTotal(), n=0; ArrayResize(pastpips,total); for (int cnt=total-1;cnt>=0;cnt--) { if ( OrderSymbol()==Symbol()) { if (!OrderSelect(cnt,SELECT_BY_POS,MODE_HISTORY) && OrderType() > OP_SELL ) continue; if (OrderType()==OP_BUY) {n = n+1; pastpips[n] = MathRound((OrderClosePrice()-OrderOpenPrice())/MarketInfo(Symbol(),MODE_POINT));} if (OrderType()==OP_SELL) {n = n+1; pastpips[n] = MathRound((OrderOpenPrice()-OrderClosePrice())/MarketInfo(Symbol(),MODE_POINT));} } } } .... in MT4. But PositionProfit(1) means the yesterday profit and PositionProfit(2) the before yesterday profit. Instead with your MT4 code, there is contr_plus=1 when I have 2 consecutive negative profit trades and not when I have 2 consecutive negative profit days. Can you change the MT4 code for this purpose? Thanks Bolla |
|
|||
|
Hi Bolla, I'm not a programmer so I don't thing that I can help you. But I have a question since you a tradestation user. How accurate is backtest in tradestation? we're all know that MT4's backtest is somehow terrible, how about tradestation?
Thank you |
|
|||
|
Hi Devil, I like TS because is user friendly, EasyLanguage is very "easy" and the back testing is affidable more than MT4. It's possible to make a perfect debug with the Commentary Expert, a function built in TS.
My project is to create a profitable trading system in TS, backtest in TS, translate in MT4, backtest in MT4 (if it's possible) and forward test in MT4 on demo account: if all this step will be positive, I'll try to trade on live account. My big problem is the MT4 enviroment: I have difficult to translate in mql4 language (I need help...... ), and backtest the EA on MT4.Bye. Bolla |
|
||||
|
Hi,
PositionProfit(num) is not profit for past days, it's profit for a previous position. In your strategy 1 Position = 2 contracts (or 2 lots in MT4), which open simultaneously. So Position(1) = pastpips[1]+pastpips[2] and Position(2) = pastpips[3]+pastpips[4]. Concerning backtesting: in MT4 with 1M data we receive very good coincidence with real trade. Igor
__________________
Let's improve trade skills together http://finance.groups.yahoo.com/group/TrendLaboratory Last edited by igorad; 05-30-2006 at 03:22 PM. |
|
|||
|
Quote:
|
|
|||
|
Hi Igorad, whta's mean with:"Concerning backtesting: in MT4 with 1M data we receive very good coincidence with real trade." ?
Do you use EA on M1 time frame for backtest? Or you use tick analisys with 1M data time frame but the EA is tested on M30 TF? Thanks. Bolla |
|
|||
|
Sorry Igorad, I have another question for you.
I would like to stop trade when there are X consecutive negative trades, enter in emulated mode and restart live trade when there are Y consecutive positive trades. I think it's a good idea! Do you could program this function on our EA? Thanks a lot. Bolla |
|
||||
|
Quote:
Concerning 2nd question: Good idea, but not simple in realization. Igor
__________________
Let's improve trade skills together http://finance.groups.yahoo.com/group/TrendLaboratory |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Please translate my idea Indonesian to english version | harryhid | Expert Advisors - Metatrader 4 | 4 | 10-18-2006 09:59 AM |
| EasyLanguage to Mql3 | harrywd | Metatrader 3 | 2 | 12-01-2005 02:58 PM |