Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.
From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.
Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
Elite Section
Get access to private discussions, specialized support, indicators and trading systems reported every week.
Advanced Elite Section
For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
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
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?
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.
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.
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.
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?
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?
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
You can test it : trade couple of days and then make the same on a tester with every tick analysis.
Concerning 2nd question: Good idea, but not simple in realization.