Cost Averaging System - page 44

 
Maji:
Here is the updated records for the RSI trend v4 running on m5 with the following settins:

//----------------------- USER INPUT

extern int MagicNumber = 12413;

extern double LotExponent = 2;//1.666667;

extern double slip = 3;

extern double pLots = 0.01;

extern double TakeProfit = 5;

extern double Stoploss = 500;

extern double PipStep = 5;

extern int MaxTrades = 55;

extern bool UseStopLoss = false;

extern double TotalEquityRisk = 25; //loss as a percentage of equity

extern bool UseSafeMode = false;

extern bool UseRSIforAddTrade = false;

extern double BuyLevel = 30;

extern double SellLevel = 90;

extern double ShortLevel = 70;

extern double CoverLevel = 10;

extern int SlowPeriod = 8;

extern int FastPeriod = 5;

extern int PriceType = 5;

extern bool UseTrend = false;

extern int sMAPeriod = 40;

extern int MAPeriod = 10;

extern int MATimeFrame = 1440;

extern int MAMethod = 0;

extern int MAPrice = 0;

extern bool UseMASlope = false;

extern int MinPips = 10;

extern int MALookBack = 5;

extern bool UseTrailingStop = true;

extern double TrailStart = 30;

extern double TrailStop = 30;

extern bool MM = false; //Use Money Management or not

extern double RiskPercent = 0.1; //% of equity used as margin per trade

Hi Maji,

I still do not understand how UseTrailingStop works in the system. I have similar setting as yours as:

extern double TakeProfit = 15;

extern double Stoploss = 500;

extern double PipStep = 15;

.....

extern bool UseTrailingStop = true;

extern double TrailStart = 30;

extern double TrailStop = 30;

Could you please take a look at the following trades and see if the SL was set by TrailingAlls? Initially, I thought those lossing trades were closed by Margin call, but seems not. They were triggered by SL. But I do not understand why the SL are set.

15972376 2006.11.21 16:10 buy 0.05 usdchfm 1.2419 1.2252 1.2345 2006.11.23 08:11 1.2252 0.00 0.00 0.20 -6.82

15985109 2006.11.21 19:35 buy 0.10 usdchfm 1.2408 1.2252 1.2345 2006.11.23 08:11 1.2252 0.00 0.00 0.40 -12.73

16001812 2006.11.22 01:55 buy 0.20 usdchfm 1.2394 1.2251 1.2318 2006.11.23 09:05 1.2251 0.00 0.00 0.59 -23.35

16010792 2006.11.22 04:10 buy 0.40 usdchfm 1.2384 1.2252 1.2345 2006.11.23 08:11 1.2252 0.00 0.00 1.19 -43.10

16020333 2006.11.22 08:05 buy 0.80 usdchfm 1.2372 1.2252 1.2345 2006.11.23 08:11 1.2252 0.00 0.00 2.38 -78.35

16022719 2006.11.22 08:40 buy 1.60 usdchfm 1.2362 1.2252 1.2345 2006.11.23 08:11 1.2252 0.00 0.00 4.75 -143.65

16034106 2006.11.22 12:10 buy 3.20 usdchfm 1.2346 1.2252 1.2345 2006.11.23 08:11 1.2252 0.00 0.00 9.50 -245.51

16038923 2006.11.22 12:25 buy 6.40 usdchfm 1.2333 1.2252 1.2345 2006.11.23 08:11 1.2252 0.00 0.00 19.01 -423.11

16043012 2006.11.22 13:20 buy 12.80 usdchfm 1.2314 1.2252 1.2345 2006.11.23 08:11 1.2252 0.00 0.00 38.02 -647.73

Thanks!

Scott

 

Scott,

There maybe a small bug in the trailing stop routine that I can't lay my finger on. Basically, it takes the current average price and compares it to the average entry price. It then uses the standard trailing stop logic.... which is, if the current profit is above the trailstart pips then put the stop trailstop pips behind the current price.

From your settings, the trailing stop should not work. Basically, if the take profit is lower than the trailstart. So, trailing should not start.

Take a look at your journal and see if you can find a clue.

thanks.

 
Maji:
Scott,

There maybe a small bug in the trailing stop routine that I can't lay my finger on. Basically, it takes the current average price and compares it to the average entry price. It then uses the standard trailing stop logic.... which is, if the current profit is above the trailstart pips then put the stop trailstop pips behind the current price.

From your settings, the trailing stop should not work. Basically, if the take profit is lower than the trailstart. So, trailing should not start.

Take a look at your journal and see if you can find a clue.

thanks.

Hi Maji,

There are many trades modified for ST for different pairs. The acount for my test is small, say 5000$ with about ten pairs. It happened for various pairs when it went to big negative area.

Two cases that I can think would trigger the tailing All:

1). Power off/ start EA. This is similar bug as I found before for other variables. In this case, when power off/restart, the variable AveragePrice is reset to 0 when we get:

if (UseTrailingStop)

{

CurrAvgPrice = CalculateCurrentAveragePrice();

TrailingAlls(TrailStart, TrailStop, AveragePrice, CurrAvgPrice);

}

In TrailingAlls(int start,int stop, double AvgPrice, double CurAvg) method,

We see for OP_BUY:

profit=NormalizeDouble((CurAvg - AvgPrice)/Point,0);

If AvgPrice is zero, then profit will always larger than the value of parameter stop (in my case it is 30). So it will try to modiy all open positions with new ST.

Question is, if AvgPrice is zero, will the OrderModify succeed?

OrderModify(OrderTicket(),AvgPrice,stopcal,OrderTakeProfit(),0,Aqua);

Get confused here, AvgPrice is passed to modify the open price.

I haven't seen the order open price gets modified.

2) Assuming the Average open price AvgPrice for Buy is 1.2000 for a set of opening positions, and the TP was modified to, say 100 pips from the AvgPrice, these positions will closed when TP is hit. We are happy then. But often, the currency increases slightly, say, the current average is 1.2040 at some moment. I think, all opening positions for the pair will then get modified with a SP. Is this right? If currency is now going to the wrong direction (decrease for Buy), then the ST would be hit resulting from a big loss.

The case 1 might be considered as a small bug. But I think my case is not the cace since I have not restarted the MT, and no power off. The second case (I think it is not a bug) is possiblly my case. Can the second case happen? If so, perhaps, the parameter "stop" may be set bigger.

Thank you very much.

Scott

 

Scott,

Thanks for the post. I will take a look at what you suggested in (1). I think that needs to be corrected.

Now let us consider 2. The trailing will only start when the current price - average price (for longs) is greater than trailstart and the the stop loss is placed trailstop away from the current price. Thus, it is under your control. if you set it such that the trailstop is placed only when there is a profit, then if the market retraces, your position will be closed out for a profit. The trailing stop should not be triggered unless your current set of trades are profitable by the trailingstart amount.

Thanks.

 

The system with common RSI blew up during the two days of trend.

Check the comments in the results... what does those weird numbers stand for?

 

The aggressive version using nano lots survived and made some nice pips too. This reinforces my thoughts that capitalization is the only way to handle this system.

My trend following EAs had orgasms over the last couple of days... Systems that were down about 30% are now in the green. Just two days of trend... Trend following is much more fun and I hope it stays that way. I think these antitrend systems should be a small portion of the portfolio with trend following systems forming the bulk of it. It probably will help in smoothing out the equity curve... kind of diversification.

 
Maji:
The aggressive version using nano lots survived and made some nice pips too. This reinforces my thoughts that capitalization is the only way to handle this system. My trend following EAs had orgasms over the last couple of days... Systems that were down about 30% are now in the green. Just two days of trend... Trend following is much more fun and I hope it stays that way. I think these antitrend systems should be a small portion of the portfolio with trend following systems forming the bulk of it. It probably will help in smoothing out the equity curve... kind of diversification.

Hello Maji!

This your result with this settings or any?

----------------

Originally Posted by Maji

Here is the updated records for the RSI trend v4 running on m5 with the following settins:

//----------------------- USER INPUT

extern int MagicNumber = 12413;

extern double LotExponent = 2;//1.666667;

extern double slip = 3;

extern double pLots = 0.01;

extern double TakeProfit = 5;

extern double Stoploss = 500;

extern double PipStep = 5;

extern int MaxTrades = 55;

extern bool UseStopLoss = false;

extern double TotalEquityRisk = 25; //loss as a percentage of equity

extern bool UseSafeMode = false;

extern bool UseRSIforAddTrade = false;

extern double BuyLevel = 30;

extern double SellLevel = 90;

extern double ShortLevel = 70;

extern double CoverLevel = 10;

extern int SlowPeriod = 8;

extern int FastPeriod = 5;

extern int PriceType = 5;

extern bool UseTrend = false;

extern int sMAPeriod = 40;

extern int MAPeriod = 10;

extern int MATimeFrame = 1440;

extern int MAMethod = 0;

extern int MAPrice = 0;

extern bool UseMASlope = false;

extern int MinPips = 10;

extern int MALookBack = 5;

extern bool UseTrailingStop = true;

extern double TrailStart = 30;

extern double TrailStop = 30;

extern bool MM = false; //Use Money Management or not

extern double RiskPercent = 0.1; //% of equity used as margin per trade

 

That is the settings for the aggressive version run on IBFX 5min charts using nano lots.

 

Hi Maji.

I can test your EA on my MIG,NEUIMEX demo.

My mail - noni.lucien@wanadoo.fr

 
Maji:
Check the comments in the results... what does those weird numbers stand for?

Those are the MagicNumbers

Reason: