Australian (ASX) Stock Market Forum

Dump it Here

@Skate just a quick question and maybe this should not be directed to you but to the readers of your thread who are looking for education by following your trades.

Question - What are you learning when Skate publishes a list of Exploration Signals ?

1. Are you reverse engineering trades on a chart to see conditions for entry / exit?
2. Are you learning how to place a trade with your broker?
3. Are you not learning anything at all and just blindly following a good system trader?
4. Other?

I don't really like posting anything that can be deemed negative or condescending but I do truly wonder what people are learning here as I will be honest that I look at option 1 and only option 1 to see how my system(s) can be improved.

@Skate I believe that I have said this before but I will say it again - I do really appreciate your work and giving back to the members of ASF, as I have learnt a lot and while you keep posting I will continue to learn so thanks again.

Cheers

Trav

I don't always know what I don't know (usually don't know?), well anyway, this year has really opened my eyes to just how many niches, variations, entries, exits, stops, etc are possible in our little ASX500 trend trading corner of trading. Even if I don't immediately feel a strategy, approach, diversification is suitable for me, you never know when something might become a useful tool in the future.

Its been surprising watching when Happy Cat has good and bad days too. Have come to realise there is probably genuine diversification against the way I normally trade "later" or conservative momentum. Considerably more than what I had expect from random chance/probability. Personally didn't REALLY pay too much attention to individual holdings and day to day variations when Skate shared summaries, but you sure as heck do when there is some money on the line.

Never too proud to learn when there are hard facts and data being shared. Did genuinely try to explore some volatility and BO themes based on Duc, Skate and others earlier this year without success, but starting to see glimses of how others jump on price action early in the trend as the number of shared trades piles up.
 
starting to see glimses of how others jump on price action early in the trend as the number of shared trades piles up.

@Newt, I've realised that trading daily is not for me. I'm planning to cease trading my daily systems so I'm prepared to explain the Flying Pelican Daily Strategy.

The Flying Pelican Strategy
As Newt has mentioned "price action" it's a perfect segway to explain a simple (RSI) strategy that's easy to follow with few moving parts. The Flying Pelican Strategy concentrates on picking "price swings". The only downside to the strategy is eradicating false signals. Traditionally the (RSI) is considered "overbought" when above 70 & "oversold" when below 30. I prefer 80 & 20 as the benchmark as it gives the position more latitude at both ends.

The Relative Strength Indicator
The Flying Pelican Strategy is based on a popular momentum oscillator - the (RSI). The strategy uses a 3 three-period (RSI) as its base.

The buy condition
Enter a new position when the close of a (6 period) moving average of a (3 period) RSI crosses above 20

The Sell Condition
Sell when the close of a (6 period) moving average of a (3 period) RSI is greater than 80.

That's the simplicity of the strategy
The 3 period RSI crossing above 20 & 80 drives the entry & exits conditions. Without optimised parameters, it struggles to trade effectively.

Pelican Flying Logo Forum Capture 5.jpg

The Flying Pelican Daily Strategy - A recent 6 month Backtest
The short backtest period is from 1st July 2020 to the end of trade Friday. The Flying Pelican Strategy performs better than the Panda Strategy with fewer moving parts.

Flying Pelican Capture.JPG

Skate.
 
Interesting post
"How to make money on the stock market". Sharon uses a "high-level", common-sense approach while David was taught "no one" will ever be able to time the market. “Dollar-cost averaging, in his opinion, is the best way to minimise volatility risks & grow capital over time.

As a system's trader
Both methods explained above is at odds of how I trade. Timing the market is the only way I can trade profitably. I guess its horses-for-courses, reinforcing, as "traders" we are all different.

The hyperlink to the article

Skate.
 
Yum, a new strategy to watch. Sounds fascinating. Where's my popcorn? :)
Presumably you're still have other layers of trailing stops and filters in addition the RSI "engine" Skate?

Interesting about you stopping Daily trading. Was wondering last year if you'd eventually transition into shorter timeframes, or how it might be affecting your trading/life/family balance having so many strategies on the go at once.

It has been very educational watching yourself and Peter2 trading both daily and weekly and giving insights from time to time on what you both see as the pros and cons for the extra work. Daily isn't a realistic or fun proposition for me holding down a day job and keeping up with a family, but its somehow reassuring that weekly timeframe trading isn't missing out on any great proportion of possible returns.
 
@Skate just a quick question and maybe this should not be directed to you but to the readers of your thread who are looking for education by following your trades.

Question - What are you learning when Skate publishes a list of Exploration Signals ?

1. Are you reverse engineering trades on a chart to see conditions for entry / exit?
2. Are you learning how to place a trade with your broker?
3. Are you not learning anything at all and just blindly following a good system trader?
4. Other?

I don't really like posting anything that can be deemed negative or condescending but I do truly wonder what people are learning here as I will be honest that I look at option 1 and only option 1 to see how my system(s) can be improved.

@Skate I believe that I have said this before but I will say it again - I do really appreciate your work and giving back to the members of ASF, as I have learnt a lot and while you keep posting I will continue to learn so thanks again.

Cheers

Trav

In my case I am hitting all of your 4 points but only a part of the third one. :)

I load all the stocks for each strategy in my amibroker watch list and I try to reconcile the buy and sell signals by scrutinising the charts. Mostly I can see the trigger for the buy and sell in the chart but some do leave me stumped.

A big learning for me is the buying at auction approach. Its a simple concept and easy to execute but I probably wouldn't have considered it without a having been guided to use it. With my recent work commitments I wouldn't have managed without it.

Another big one is allowing the price room to breathe. Left to my own devices I would have bailed on a number of the stocks in Action, Happy Cat and Zebra Strategies. In fact I almost had my finger on the button in the early days of Action strategy trades. So yes it has taught me to blindly follow the programme. I'm a lot more relaxed now about the trading process than I was 6 months ago, than you Skate.
 
Yum, a new strategy to watch. Sounds fascinating. Where's my popcorn? :)
Presumably you're still have other layers of trailing stops and filters in addition the RSI "engine" Skate?

Interesting about you stopping Daily trading.
Was wondering last year if you'd eventually transition into shorter timeframes, or how it might be affecting your trading/life/family balance having so many strategies on the go at once.

It has been very educational watching yourself and Peter2 trading both daily and weekly and giving insights from time to time on what you both see as the pros and cons for the extra work. Daily isn't a realistic or fun proposition for me holding down a day job and keeping up with a family, but its somehow reassuring that weekly timeframe trading isn't missing out on any great proportion of possible returns.

@Newt the Flying Pelican Strategy is simple in its execution but you are correct there is more to exit strategy than what I have described. Trading a weekly strategy is a weekend endeavour that never ties you down to a designated time frame.

Skate.
 
Hi Skate & others, Following on Trav's question regarding Skate's follow along strategies and opportunities for learning. I am new to trading during 2020 and while I haven't posted much as yet, I have been reading throughout the year and have found Skate and many of the other contributors to be most helpful. I haven't followed the strategies as not all the stocks in a strategy fit my own ethical comfortabilities regarding some of the companies. However, I still have been trying to study and understand the rationale regardless of wether I would personally purchase the stock. I think as a new trader/investor, watching how long the trades are allowed to stand has been invaluable, my own early trades were sometimes the right buy, but then I sometimes panicked at the slightest drop, fearing a crash. Consequently, I missed out on some healthy profits due to fear. This has been a privilege to watch many of you trade and explain what your rationale has been. I continue to learn and find my own comfort level. So thankyou. Craig

I just finished the audio book, 'Trend Trading' by Michael Covel. The concept of holding onto a stock and a lot of bits of wisdom were used through the book. Give it a read as well. Being able to take a loss is hard, but its an important part of trading (at least how we do it here as equities trend traders).
 
gday @Skate
ive spent the last couple of weeks working and learning amibroker and started with your WTT code. its been a really nice learning process. i got lots of help from @DaveDaGr8, absolute legend.

i have a question regarding your trailing stop loss.

//=================================================================================
//6. Add a two-stage trailing stop
//=================================================================================
ts1 = 20;
ts2 = 10;
ts = IIf( Indexbuyfilter , ts1 , ts2 );

ApplyStop( stopTypeTrailing , stopModePercent , ts , exitatstop = 2 ); // Apply Stop = [ts] Trailing Stop [exitatstop = 2] means check High-Low prices but exit NEXT BAR on regular trade price.


does that look at the previous highest candle and calculate 20% from there if the index is above x moving average and 10 if its below x moving average. If that is what it does, i am unclear on how exactly it does it from a coding perspective. please enlighten us :)
i believe thats how radge had it in his WTT just not clear if thats exactly how its coded..


Thank you
 
ApplyStop( stopTypeTrailing , stopModePercent , ts , exitatstop = 2 ); // Apply Stop = [ts] Trailing Stop [exitatstop = 2] means check High-Low prices but exit NEXT BAR on regular trade price.
Question - does that look at the previous highest candle and calculate 20% from there if the index is above x moving average and 10 if its below x moving average. If that is what it does, i am unclear on how exactly it does it from a coding perspective. please enlighten us :)
i believe thats how radge had it in his WTT just not clear if thats exactly how its coded..
Thank you

@othmana86, let me clear up a few points
Nick Radge uses a "looping trailing stop" NOT an "ApplyStop" function. The WTT strategy I uploaded was an example of how to code a simple strategy in a dozen steps. The basic code uploaded was one of my first attempts from (2015) & it served me well at the time. The strategy uploaded was something to "learn with" & definitely "not to trade with". The "ApplyStop" is an Amibroker function. It's a trailing stop which means it trails under the closing price of the last bar starting from the "signal bar". (Radge uses a 40% Trailing Stop when the Index Filter is on & reduces to 10% when the Index Filter turns off). I personally prefer to start my (looping trailing stop) from the "buy bar" & not the signal bar. It's a minor different but important.

The Radge WTT Strategy
The WTT turnkey strategy uses a looping trailing stop & doesn't use an "ApplyStop" function. ApplyStop doesn't plot stops – it only triggers them in backtest mode whereas the WTT plots the trailing stop on the chart.

@Trav. "Amibroker-tips-and-tricks" thread has posted practical looping trailing stop examples & explanations "with Amibroker code"

Below is reading material on how a trailing stop works
How to plot a looping trailing stop can be found here: https://www.amibroker.com/kb/2007/0...iling-stop-in-the-price-chart/comment-page-1/

ApplyStop - apply built-in stop
SYNTAX : ApplyStop( type, mode, amount, exitatstop, volatile = False, ReEntryDelay = 0, ValidFrom = 0, ValidTo = -1, ActivationFloor = 0 )
RETURNS : Nothing
FUNCTION: Controls built-in stops from the formula level (allows optimization of stops)

Parameters:
type =
0 = stopTypeLoss - maximum loss stop,
1 = stopTypeProfit - profit target stop,
2 = stopTypeTrailing - trailing stop,
3 = stopTypeNBar - N-bar stop

Mode:
0 - disable stop (stopModeDisable),
1 - amount in percent (stopModePercent), or number of bars for N-bar stop (stopModeBars),
2 - amount in points (stopModePoint);
3 - amount in percent of profit (risk)

Amount:
Percent / point loss / profit trigger / risk amount. This could be a number (static stop level) or an array (dynamic stop level)

ExitAtStop:
* ExitAtStop = 0 - means check stops using only trade price and exit at regular trade price (1) - (if you are trading on the close it means that only the closing price will be checked for exits & the exit will be done at the closing price)
* ExitAtStop = 1 - check High-Low prices & exit intraday on a price equal to stop level on the same bar when a stop was triggered
* ExitAtStop = 2 - check High-Low prices but exit NEXT BAR on regular trade price.

Skate.
 
Last edited:
@Skate
Here are the results of a run of dpong's WTT Strategy from Jan 1 2019 through Jan 6 2021. Initial equity was set to 300,000 per other examples I've seen. The universe of stocks is the Russell 3000 for stocks priced between $1 and $20. The regime filter uses the S&P 500.

As my first attempt at coding a strategy I tried to do it "pure" and true to the Weekend Trend Trader book as best I could. I took Skate's WTT strategy that he shared with us and then modified the heck out of it. I would not be this far along without that starting place! So thanks, Skate!

I am using free data from yahoo finance at this time.

If the SPX is above it's 10 week moving average we use 10% trailing stops.
If the SPX is below it's 10 week moving average we use 40% trailing stops.

In 2020 I was physically trading this system against the SPX400, SPX600, and NASDAQ100. What I have learned so far from backtesting is that this system does much better when run against Russell 3000 for stocks priced between $1 and $20. This is the universe of stocks for which Nick published the backtest in his book.


Windows_10-2.jpg
 
The one thing I do in the strategy which was not in the book is I use Nick's bang for buck to set the ranking. This, too, was shared here by @Skate . I have found that it has a significant impact on the results.

PositionScore = ((10000/Close) * ATR(200))/100; //Nick Radge - "bang for buck".
//PositionScore = ROC(20); //I used to use this.
 
Oops, reverse that:

If the SPX is above it's 10 week moving average we use 40% trailing stops.
If the SPX is below it's 10 week moving average we use 10% trailing stops.
 
_SECTION_BEGIN( "Weekend Trend Trader 4.7" );
/********************************************
Skate's WTT Weekly Modified Strategy for ASF Members
Created by: Skate - Last revision 12th August 2020
Heavily Modified by: dpong 6th January 2021
*********************************************/

//=================================================================================
//1. The "SetOptions" are management options & they are a feature of Amibroker
//=================================================================================
TradingFunds = Param( "Trading Funds - $", 5000, 1000, 10000000, 1000 ); // User-definable parameter, accessible via Exploration parameters - changes are reflected immediately. (Default $5k bets) - INSERT any amount
SetOption( "InitialEquity", 100000 ); // $100k Inital Equity (allows for 20 X $5k bets)
SetOption( "PriceBoundChecking", 1 ); // True: Adjust prices so that they fall within the High-Low range
SetOption( "CommissionMode", 2 ); // Use $ amount
SetOption( "CommissionAmount", 0.0 ); // CommSec commission rate
SetOption( "UsePrevBarEquityForPosSizing", 1 ); // True: Use previous bar closing equity to perform position sizing
SetOption( "AllowSameBarExit", False ); // False: Trade is exited & we move to next bar ignoring other signals
SetTradeDelays( 1, 1, 1, 1 ); // Trade delays, the delay is required for backtesting


//=================================================================================
//2. The "Index Filter" - decides when we will trade & also our trailing stop levels
//=================================================================================
SetForeign( "^SPX", True , True ); // I've used the new Norgate Updater (NDU) format - change if the format is different to your data supplier
MAfilter = MA( C, 10 ); // 10 week lookback period
RegimeFilter = C > MAfilter; // Index Filter = ON: When the close is greater than the 10 week simple moving average the Index Filter is ON [trailing stop set to 20%] + [buy + sell signals generated]
RestorePriceArrays( True ); // Restores original price and volume arrays after the call to SetForeign.
//=================================================================================
//3. Add all our other filters
//=================================================================================

TimeFrameSet(inDaily); //Switch to Daily time-frame
AvgVolumeInDaily = MA(V, 7); //Get 7 day average Volume
AvgTurnoverInDaily = MA(C, 7) * AvgVolumeInDaily; //Get 7 day average of Close * Volume

TimeFrameRestore(); //Switch back to weekly time-frame.

AvgVolume = TimeFrameExpand(AvgVolumeInDaily, inDaily);
AvgTurnover = TimeFrameExpand(AvgTurnoverInDaily, inDaily);

//Make sure AvgTurnover > $500,000 and AvgVolume > 500,000 shares
LiqFactor = (AvgTurnover > 500000) AND (AvgVolume > 500000);


//Liqfactor = MA(V,20) > 100000; // Avg volume 20 periods greater than 100,000.
ROCFilter = ROC( C, 20 ) > 30; // Rate Of Change (ROC) Momentum filter

BreakoutPeriod = Param( "Breakout Period", 20, 5, 100, 1 ); // 20 week Lookback period

//Compute Donchian Channel upper AND lower
DonchianUpper =HHV(H,BreakoutPeriod);
DonchianLower = LLV(L,BreakoutPeriod);


//=================================================================================
//4. Add a Buy condition
//=================================================================================

// Condition 1 is a *new* 20 week breakout, so look back 8 weeks.
Cond1 = Ref(DonchianUpper, -1) < C;
Cond1 = Ref(DonchianUpper, -2) >= Ref(DonchianUpper, -1) AND Cond1;
Cond1 = Ref(DonchianUpper, -3) >= Ref(DonchianUpper, -2) AND Cond1;
Cond1 = Ref(DonchianUpper, -4) >= Ref(DonchianUpper, -3) AND Cond1;
Cond1 = Ref(DonchianUpper, -5) >= Ref(DonchianUpper, -4) AND Cond1;
Cond1 = Ref(DonchianUpper, -6) >= Ref(DonchianUpper, -5) AND Cond1;
Cond1 = Ref(DonchianUpper, -7) >= Ref(DonchianUpper, -6) AND Cond1;
Cond1 = Ref(DonchianUpper, -8) >= Ref(DonchianUpper, -7) AND Cond1;


Cond2 = RegimeFilter; // Buy ONLY when the Index Filter is ON
cond3 = C >= Param("Min Buy Price", 1.00, 1.00, 500.00, 1); // Buy only if the closing price is greater than min price.
cond4 = C <= Param("Max Buy Price", 20.00, 10.00, 5000.00, 1); // Buy only if the closing price is less than max price
cond5 = liqfactor; // Buy only when the Liquidity filter is TRUE
cond6 = ROCFilter; // Buy only when the Rate of Change filter is TRUE

Buy = cond1
AND cond2
AND cond3
AND cond4
AND cond5
AND cond6;



//=================================================================================
//5. Add a sell condition
//=================================================================================

Sell = 0; //We will handle sells "manually" when stop loss is hit

//=================================================================================
//6. Add a two-stage trailing stop
//=================================================================================


longTrailPerc = IIF(RegimeFilter, 0.40, 0.10);
stopValue = H * (1.0 - longTrailPerc);

bBuySignal = 0;
trailARRAY = Null;
trailstop = 0;

for( i = 1; i < BarCount; i++ )
{

if( trailstop == 0 AND (Buy[ i ] OR bBuySignal) )
{
if(bBuySignal) {
trailstop = stopValue;
bBuySignal = 0; //turn off the signal
}
else
bBuySignal = 1;
}
else Buy[ i ] = 0; // remove excess buy signals

if((trailstop > 0) AND Close[ i ] < trailstop )
{
Sell[ i ] = 1; //This is the sale!
trailstop = 0;

if (i+1 < BarCount)
SellPrice = Open[i+1]; //Use tomorrow's open
else
SellPrice = Close; //Use today's close.
}

if( trailstop > 0 )
{
trailstop = Max( stopValue, trailstop );
trailARRAY[ i ] = trailstop;
}

}





//=================================================================================
//7. Add "Position Sizing"
//=================================================================================
BuyPrice = Open; // Buy the next day at open
SellPrice = Open; // Sell the next day at open

Buy = ExRem( Buy, Sell ); // Removes additional buy signals
Sell = ExRem( Sell, Buy ); // Removes additional sell signals
InTrade = Flip(Buy, Sell); //Array is 1 if in the trade, otherwise 0

PosQty = 20; // Position Quantity = Maximum 20 positions
PositionSize = -100 / posqty; // 100% of the equity divided by the Position Size
SetOption( "MaxOpenPositions", PosQty ); // Maximum number of open position

//=================================================================================
//8. Add "Filters for the Exploration Analysis"
//=================================================================================
Filter = Buy OR Sell; // Buy & Sell Filters

//=================================================================================
//9. Add Buy & Sell coding for use in trading the pre-auction
//=================================================================================
BuyOffered = Close * 1.03; // +3% Buy premium over the last closing price
BuyOffer = ceil( BuyOffered * 100 ) / 100; // The amount is rounded up no matter the price (ceil function used)

SellOffered = Close * 0.97; // -3% Sell premium below the last closing price
SellOffer = floor( SellOffered * 100 ) / 100; // The amount is rounded down no matter the price (floor function used)

//=================================================================================
//10. Add the Exploration code
//=================================================================================
ToBuyPosSize = floor( TradingFunds / BuyOffer ); // Trading Funds divided by buy offer of (+3%) buy premium over the last closing price
ToBuyPosCost = BuyOffer * ToBuyPosSize; // The cost of buying the amount of share

PositionScore = ((10000/Close) * ATR(200))/100; //Nick Radge - "bang for buck".
//PositionScore = ROC(20); //I used to use this.

//=================================================================================
//11. Add columns to report & sort the Exploration Analysis results
//=================================================================================
AddColumn( IIf( Buy, ToBuyPosSize, Null ), "# shares", 1, colorWhite, colorDarkGreen, 90 ); // Exploration Analysis - this column displays quantity of shares to buy
AddColumn( IIf( Buy, BuyOffer, Null ), "$ Buy Offer", 1.2, colorWhite, colorDarkGreen, 110 ); // Exploration Analysis - this column displays pre-auction buy offer price (+3% premium added to the last closing price)
AddColumn( IIf( Buy, ToBuyPosCost, Null ), "$ Cost", 1.2, colorWhite, colorDarkGreen, 80 ); // Exploration Analysis - this column displays the total ($) you will pay for the qty of shares at the +3% primum
AddColumn( IIf( Sell, SellOffer, Null ), "$ Sell Offer", 1.2, colorWhite, colorRed, 110 ); // Exploration Analysis - this column displays pre-auction sell offer price (-3% discount to the last closing price)
AddColumn( Ref(trailARRAY, 1), "Stop Loss", 1.2, colorWhite, colorGreen, 110); //see stop loss
//AddColumn( IIf(Buy, AvgVolume, Null), "Avg Vol" , colorWhite, colorGreen, 90);
//AddColumn( IIf(Buy, AvgTurnover, Null), "Avg Turn", colorWhite, colorGreen, 90);


SetSortColumns( 2, -3, -4, -5, -6, 1 ); // Sort the columns in correct order
_SECTION_END();

//=================================================================================
//12. Add code to the chart & plots the signals. Also adding an Index Ribbon
//=================================================================================
_SECTION_BEGIN( "Price" );

SetChartOptions( 0, chartShowArrows | chartShowDates );
_N( Title = StrFormat( "{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " + WriteVal( V, 1.0 ) + " {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ) ); // Chart settings

Plot( C, "Close", ParamColor( "Color", colorBlack ),
ParamStyle( "Style", styleNoTitle | styleCandle, maskAll ) ); // User-definable parameter, accessible via Chart parameters - changes are reflected immediatelly. (Bar Chart Default)

PlotShapes( Buy*shapehollowUpArrow, colorBlack, 0, Low, -20 ); // Displays Buy up arrow on the signal bar
PlotShapes( ( Sell > 0 ) * shapeDownArrow, ColorRed, 0, High, -40 ); // Displays Sell down arrow on the signal bar
PlotShapes( Ref( Buy, -1 ) * shapeHollowSquare, colorBlack, 0, O, 0, 0 ); // Displays a white square on the buy bar
PlotShapes( Ref( Sell, -1 ) * shapeHollowCircle, colorRed, 0, O, 0, 0 ); // Displays a yellow circle on the sell bar


Indexfilter = IIf( RegimeFilter, True, False ); // If Index Filter is TRUE (ON), or If Index Filter is FALSE (OFF),
RibbonColor = IIf( Indexfilter, colorGreen, colorRed ); // If Index Filter is TRUE (ON) the ribbon is GREEN, or If Index Filter is FALSE (OFF) the ribbon is Red
Plot( 1, "", RibbonColor, styleArea | styleOwnScale | styleNoLabel, -0.0001, 190 ); // Plots Index Filter Ribbon [green = ON] [Red = OFF]

for( i = 1; i < BarCount; i++ )
{
if( Buy[i - 1] ) PlotText( "Buy\n@ " + O, i, L * 0.9, colorBlack ); // Displays white buy price (opening price) under the white box (buy bar)

if( sell[i - 1] ) PlotText( "Sell\n@ " + o[ i ], i, H[ i ] * 1.1, colorRed ); // Displays yellow sell price (opening price) above the yellow circle (sell bar)

}


//Plot Donchian high and low
Plot(DonchianUpper,"DU",colorBlue,styleThick, zorder=-5);
Plot(DonchianLower,"DL",colorBlue,styleThick, zorder=-5);
//PlotOHLC(DonchianLower, DonchianUpper, DonchianLower, DonchianUpper, "", ColorRGB(250, 250, 255) , style=styleCloud, zorder=-5);

//Plot Stop Loss Levels
for( i = 1; i < BarCount; i++ )
{

if (Buy) PlotTextSetFont("+", "Arial", 14, i, H + (H * 0.07), colorRed);

if( InTrade ) PlotTextSetFont( "+", "Arial", 12, i, trailARRAY, colorBlack ); //plot stop loss

}
//Plot(MAFilter, "SMA", colorOrange, styleLine | styleThick, zorder = 5);

_SECTION_END();
 

Attachments

  • WeekendTrendTrader_v4.7.afl
    11.8 KB · Views: 45
I have a correction for my code.

I had coded:

PositionScore = ((10000/Close) * ATR(200))/100; //Nick Radge - "bang for buck".

But I realized ATR(200) is coded for a daily system. The equivalent for a weekly system is ATR(40).

So it should be:

PositionScore = ((10000/Close) * ATR(40))/100; //Nick Radge - "bang for buck".

[UPDATE: I'm still finding some bugs, so I probably should have waited before posting.]
 
Last edited:
The code was sometimes missing a sell signal. So I moved the code that raises the stops to the beginning of the loop instead of the end.

Code:
//=================================================================================
//6. Add a two-stage trailing stop
//=================================================================================


longTrailPerc = IIF(RegimeFilter, 0.40, 0.10);
stopValue = H * (1.0 - longTrailPerc);

bBuySignal = 0;
trailARRAY = Null;
trailstop = 0;

for( i = 1; i < BarCount; i++ )
{

    //Raise stops first, before checking for
    if( trailstop > 0 )
    {
      trailstop = Max( stopValue[i], trailstop );
      trailARRAY[ i ] = trailstop;
    }

   if( trailstop == 0 AND (Buy[ i ] OR bBuySignal) )
   {
      if(bBuySignal) {
        trailstop = stopValue[i];
        bBuySignal = 0; //turn off the signal
        }
      else
        bBuySignal = 1;
   }
   else Buy[ i ] = 0; // remove excess buy signals

   if((trailstop > 0) AND Close[ i ] < trailstop )
   {
      Sell[ i ] = 1;  //This is the sale!
      trailstop = 0;
      
      if (i+1 < BarCount)
        SellPrice[i] = Open[i+1];  //Use tomorrow's open
      else
        SellPrice[i] = Close[i];   //Use today's close.
   }

}

I don't think my chart is very pretty, but here it is. Using "+" sign for stop loss levels and red "+" for signal bar.

NLS.png
 

Attachments

  • WeekendTrendTrader_v5.0.afl
    12.1 KB · Views: 80
The code was sometimes missing a sell signal. So I moved the code that raises the stops to the beginning of the loop instead of the end.

Code:
//=================================================================================
//6. Add a two-stage trailing stop
//=================================================================================


longTrailPerc = IIF(RegimeFilter, 0.40, 0.10);
stopValue = H * (1.0 - longTrailPerc);

bBuySignal = 0;
trailARRAY = Null;
trailstop = 0;

for( i = 1; i < BarCount; i++ )
{

    //Raise stops first, before checking for
    if( trailstop > 0 )
    {
      trailstop = Max( stopValue[i], trailstop );
      trailARRAY[ i ] = trailstop;
    }

   if( trailstop == 0 AND (Buy[ i ] OR bBuySignal) )
   {
      if(bBuySignal) {
        trailstop = stopValue[i];
        bBuySignal = 0; //turn off the signal
        }
      else
        bBuySignal = 1;
   }
   else Buy[ i ] = 0; // remove excess buy signals

   if((trailstop > 0) AND Close[ i ] < trailstop )
   {
      Sell[ i ] = 1;  //This is the sale!
      trailstop = 0;
     
      if (i+1 < BarCount)
        SellPrice[i] = Open[i+1];  //Use tomorrow's open
      else
        SellPrice[i] = Close[i];   //Use today's close.
   }

}

I don't think my chart is very pretty, but here it is. Using "+" sign for stop loss levels and red "+" for signal bar.

View attachment 117968

@dpong, sharing is caring & your posts reflect your willingness to help. Helping others is the heart & soul of the "Dump it here" thread, well done.

Skate.
 
@dpong, sharing is caring & your posts reflect your willingness to help. Helping others is the heart & soul of the "Dump it here" thread, well done.

Skate.
Thank-you, sir. I was afraid I might have been using up too much band-width in your thread.

I look forward to following your Flying Pelican Strategy outline. Too bad it's a daily system. Like you, I think once you've done weekly you never want to go back.

I'm very happy to be here.
 
Thank-you, sir. I was afraid I might have been using up too much band-width in your thread.

I look forward to following your Flying Pelican Strategy outline. Too bad it's a daily system. Like you, I think once you've done weekly you never want to go back.

I'm very happy to be here.

@dpong post to your heart's content. Forget the daily "Flying Pelican Strategy" & the daily "Panda Strategy" - the only thing I'll miss is the income from both but the funds will be deployed in other strategies waiting their turn to have a go at live trading.

The HappyCat Strategy
I'll be reporting the ongoing progress of the HappyCat Strategy this afternoon after the end of trading. For those who want to understand the entry & exit points of the strategy, signals are posted on a Saturday well in advance of the markets open on Monday. It's an exercise so others can follow along to get a better understanding of why positions are taken.

Skate.
 
After bug fix:

Windows_10-3.jpg

In Nick's backtest run he very specifically said he filters for 7 *day* moving average of volume > 500,000 and 7 *day* moving average of "turnover" > $500,000. The area of the code where I tried to accomplish this is here. It is working as if I did it properly. I had to temporarily change the time frame to daily, grab the moving averages I needed, and then switch back to weekly. This could be of interest. All criticisms of this code are welcomed.

Code:
//=================================================================================
//3. Add all our other filters
//=================================================================================

TimeFrameSet(inDaily);          //Switch to Daily time-frame
AvgVolumeInDaily = MA(V, 7);                    //Get 7 day average Volume
AvgTurnoverInDaily = MA(C, 7) * AvgVolumeInDaily;      //Get 7 day average of Close * Volume

TimeFrameRestore();   //Switch back to weekly time-frame.

AvgVolume = TimeFrameExpand(AvgVolumeInDaily, inDaily);
AvgTurnover = TimeFrameExpand(AvgTurnoverInDaily, inDaily);

//Make sure AvgTurnover > $500,000 and AvgVolume > 500,000 shares
LiqFactor = (AvgTurnover > 500000) AND (AvgVolume > 500000);
 
Trading returns are unpredictable
I don't want to steal @ducati916 thunder by posting an excerpt from the "Fly" blog but it serves a purpose here in this thread.

"I ended the day down 0.5%, more or less a nothing-burger, done via 89 trades that makes you wonder why go through all the trouble. But then you "look at the longer term returns" and know you’re doing the right thing. These types of days happen and there is nothing you can do about it. Admittedly"

Skate.
 
Top