- Joined
- 28 December 2013
- Posts
- 6,392
- Reactions
- 24,319
@Warr87 it would be wise to read about (State verses Pulse signals)
System One
Check system 1 (EMA Cross) buy criteria - Is your Buy criteria (State or Impulse) ?
Quick comment
"Cross" is an Pulse signal, and ">" is a State signal.
If you use State signals
Using a State signal ">" function you can use the "Exrem" function to eliminate duplicate signals.
Important to remember
1. State form keeps 'true' for many bars
2. Pulse form - Keeps 'true' for one bar only
IMHO
I would avoid any strategy that uses a "Cross function" as the signal is only 'true' for one bar only (on the "CROSS") a State signal holds for more than one bar. Meaning State signal keeps the signal 'true' for many bars.
It makes a difference
To keep signals you have to have them in (State) form as opposed to (Pulse) form because the signal is "true" for only one bar (on the cross)
The MAP strategy
If it was me (I'm not telling you what to do) I wouldn't fiddle with the MAP entry or stalestop (exit) code - all the other parameters go for your life.
Skate.
@Warr87 good work on your systems as you appear to be heading in the right direction.
I have a question about exits and in particular trailing stops for you.
Using one of your earlier purchases as an example - also you are still holding this stock so it makes for a practical exercise.
RBL -
Buy on the 9/8/2019 @ 1.395
High on the 15/11/2019 @ 2.08
Now still holding at a loss @ 1.10
It appears that you have a SL set at 30% on your spreadsheet.
My question is how are you managing this Stop Loss and others? Do you have an Initial Stop Loss then a Trailing Stop ?
From your entry to SP high is approx 50% gain so if you were trailing behind it ( either a % or ATR ) I would have thought that it would have been triggered in late November prior to the gap down in December for approx 30% gain.
The reason I am asking is that I have been guilty on not following my rules because I wanted to maximise profits. Greed and falling for the story of the stock was / is my weakness and the result is holding a stock at a loss for way to long or selling at a loss and taking a hit in my confidence.
Again good luck in the journey and I look forward to following your progress.
Trav.
//======================================================================|
// Trailing Stop Loop |
//======================================================================|
Buy = 0; /////////****************Your buy signal will replace this line
Multiplier = 1; //Optimize("Multi", 1, 1, 3, 1);
Period = 21; //Optimize("Period", 21, 8, 25, 1);
LATRStop = Low - (Multiplier * ATR( Period ));
LStopLevel = LATRStop; // Long Stop Level now based of the ATR
LtrailARRAY = Null;
Ltrailstop = 0;
_SECTION_BEGIN( "Long Trailing Stop");
{
for( i = 1; i < BarCount; i++ )
{
if( Ltrailstop == 0 AND Buy[ i ] )
{
Ltrailstop = LStopLevel [ i ] ; //ATRStop = High - (multiplier x ATR (period))
}
else Buy[ i ] = 0; // remove excess buy signals
if( Ltrailstop > 0 AND Close[ i ] < Ltrailstop)
{
Sell[ i ] = 1;
SellPrice[ i ] = Ltrailstop;
Ltrailstop = 0;
}
if( Ltrailstop > 0 )
{
Ltrailstop = Max( LStopLevel [ i ], Ltrailstop );
LtrailARRAY[ i ] = Ltrailstop;
}
_SECTION_END();
}}
//Plot Triling Stop
Plot( LtrailARRAY,"trailing stop level", colorRed );
Hi trav I had a play around with your code but found the exit price was the trailing stop even though the close was below it.?no problems mate
Maybe try the below code in your next back test just to see what different exits do to your performance as I am finding out this area is often neglected.
Code://======================================================================| // Trailing Stop Loop | //======================================================================| Buy = 0; /////////****************Your buy signal will replace this line Multiplier = 1; //Optimize("Multi", 1, 1, 3, 1); Period = 21; //Optimize("Period", 21, 8, 25, 1); LATRStop = Low - (Multiplier * ATR( Period )); LStopLevel = LATRStop; // Long Stop Level now based of the ATR LtrailARRAY = Null; Ltrailstop = 0; _SECTION_BEGIN( "Long Trailing Stop"); { for( i = 1; i < BarCount; i++ ) { if( Ltrailstop == 0 AND Buy[ i ] ) { Ltrailstop = LStopLevel [ i ] ; //ATRStop = High - (multiplier x ATR (period)) } else Buy[ i ] = 0; // remove excess buy signals if( Ltrailstop > 0 AND Close[ i ] < Ltrailstop) { Sell[ i ] = 1; SellPrice[ i ] = Ltrailstop; Ltrailstop = 0; } if( Ltrailstop > 0 ) { Ltrailstop = Max( LStopLevel [ i ], Ltrailstop ); LtrailARRAY[ i ] = Ltrailstop; } _SECTION_END(); }} //Plot Triling Stop Plot( LtrailARRAY,"trailing stop level", colorRed );
Could it be that the trailing stop is used intra day, simulating a conditional stop as entered in a broker platform, as per my lame attempt to add SL last week?Hi trav I had a play around with your code but found the exit price was the trailing stop even though the close was below it.?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?