- Joined
- 27 November 2017
- Posts
- 1,200
- Reactions
- 1,884
As far as I know the apply stop does not show in the exploration
I think that you will find the ApplyStops only works in BackTest mode hence the difference in Explore results.
Also the backtest results of the published system ( which I cannot replicate ) only has a couple of regular stops on the results when run over the entire XAO and I believe this is why you have the difference in the explore.
I believe that this line is incorrect and maybe the AND's should be OR's
Sell = C < MA( C, 50 ) AND NoStrength AND NoUpTrend;
Sell = C < MA( C, 50 ) OR NoStrength OR NoUpTrend;
This is problem with using someone else's code as it tends to throw up more questions than answers.
In Summary...Your trail stop is not the issue, but you could play with levels as per below to try to mimic the ApplyStop
Code:
StopLevel = 1 -(ts/100);
trailARRAY = Null;
trailstop = 0;
TrailStopSell = 0; // added from @Trav code
for( i = 1; i < BarCount; i++ )
{
if( trailstop == 0 AND Buy[ i ] )
{
trailstop = High[ i ] * stoplevel [i]; // was "* stoplevel;"
}
else Buy[ i ] = 0; // remove excess buy signals
if( trailstop > 0 AND Low[ i ] < trailstop ) //was "Low"
{
TrailStopSell[ i ] = 1; // was "Sell[ i ] = 1;"
//SellPrice[ i ] = trailstop;
trailstop = 0;
}
if( trailstop > 0 AND TrailStopSell [i] == 0) //was " if( trailstop > 0 )"
{
trailstop = Max( High[ i ] * stoplevel [i], trailstop );
trailARRAY[ i ] = trailstop;
}
}