Trend Chaser 3.0 with Money Management

Trend Chaser 3.0 with Money Management


I have been working on the Trend Chaser concept for some time but always had a problem with false signals, large draw-downs, and sub-optimal stops.  It had value in that it averages 50% wins on most instruments with most time-frames, so I felt it was worth persevering.

I am indebted to cfta’s idea for grid-step trading and Nicolas’ assistance and development of the code for a brilliant money-management system, as well a number of traders (and my close friend Free2Trade) for their encouragement and ideas.   I have been able to find a solution to these problems through the incorporate the money management code with the Trend Chaser code.

It is early days in the testing but so far the results have been spectacular.  I have attached a spreadsheet of the test results I have run on major indices, with the optimisation of some of the money management parameters: standard deviation (line 73), risk/reward (line 11) and risk percent (line 9).  Please note that the formula in the spreadsheet are:

  1.  ME (mathematical expectancy) = % of winning trades x average gain of winning trades / average loss of losing trades – (1 – % of winning trades).
  2.  IRR (internal rate of return or compounded return per annum) = 360 x (((end $ / start $) ^ (1 / (end date – start date)) – 1)).
  3.   This is a way to compare trading systems with different time frames, starting accounts, outcomes, etc.
  4.   I have rejected ME’s < 0.5, and % wins < 50%.
  5.   The max. DD (max. draw down) is expressed in $’s but the percentage is the dollar amount divided by 100.
  6.   I have noticed that the max draw-down figures given by PRT don’t seem to bear any relationship to the reality of the charts.  Does anyone know how this is calculated?

I find that the sweet spot for the code is in the shorter time frames such as 5 and 1 minute charts.  The last two tests of the DAX were spectacular as I ran them over only the opening hours for that market.   The negatives were the draw-downs of 11% and 17% – worth the risk, Elsborgtrading????

I have attached the code for examination and critique, please.  All comments and suggestions for improvement are most welcome.

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

New! PRC is also now on YouTube, subscribe to our channel for exclusive content and tutorials

  1. Frank • 08/27/2016 #

    Syntax error: The function “MGC-Coppock” called from “Trend chaser supertrend” does not exist.

  2. MikeGC • 08/27/2016 #

    Sorry Frank, substitute COI = WEIGHTEDAVERAGE[14](ROC[11]+ROC[10]) for the MGC-Coppock line.
    Please post your other emailed questions to the forum.  Thus, if I can’t answer them, someone else might be able to.

  3. Frank • 08/27/2016 #

    Thanks Mike,
    When I was about to test it on live account, the following message occured and the model stopped:
    This trading system was stopped because the program used a negative or zero offset (ex: close[-10]) during the evaluation of the last candlestick. Please add protections to your code to prevent negative or zero offsets.

    • MikeGC • 08/27/2016 #

      Hi Frank,
      Same problem as last time.  There is some change made to the code that I can’t locate without the code. 
      “The best solution is to go back to the original code and make one change at a time.”

  4. cfta • 08/27/2016 #

    Hi Mike,
    Great stuff, I really like to the code and it seems like a terrific filter for the grid system so feel free to discuss in my thread if you like 🙂

  5. MikeGC • 08/27/2016 #

    Hi cfta, I have posted to your thread.  The combination of the two systems needs a lot more testing, but I am having trouble fully understanding the logic of the code to test the alternatives.  Thus the tests I have run purely optimise the the parameters.  There is a spreadsheet of the test results on your thread.
    Let me know your thoughts.

  6. Michael • 08/27/2016 #

    Hi MikeCG
    i’ve problem to start the  MGC Trend Chaser in 5min timeframe , because the backtest was really good . But the System gave me always an errormessage for an negative or Zero value for the last candle , i should put somewhere  ” close[-10]  . Do you know where i have to change the code ?
    BR Michael

    • MikeGC • 08/27/2016 #

      Hi Michael, please send me the code you are testing and I will track down the problem.
      Cheers, Mike

    • Michael • 08/27/2016 #

      Hi Mike,i use the mgc-trend-chaser-160914.itf exactly, starting thje backtest no problem . But i when start the code forthe real trading on the platform  , exactly after 5 min the system isinterupted. With Advice to add some or change the code with ……BRMichael

  7. MaxT • 08/27/2016 #

    Hi Mike
    Thanks for the work – am relatively new to PRT but wanted to ask in reference to what Zilliq and Sylvess have said about the conditions and your comment that you think the =1 represents ‘true’ (I’ve no idea btw!) I’ve been playing around with the code and running some ProOrders in demo and am getting orders but not sure they’re being best placed so just wanted to ask if you could clarify the conditions/logic you are after please?
    I know you’ve said it a few times above but reading and re-reading some contradicts and I am not sure if you are after consecutively rising indicators or new highs/lows plus the COI is a Weighted Moving Average from what I understand so not sure how this could be less than zero (or I have totally misunderstood of course!) but it is not represented in the code (COI < 0) so was hoping to better understand then have a go at coding what you are after in a different way (as per Zilliq and Sylvess comments) if you could perhaps explain please..?
    As I say it is generating orders so perhaps the logic as you wanted it is already there and no need to re-code but would be up for having a go if any doubt! 🙂

    • MikeGC • 08/27/2016 #

      Hello @Michael,
      My apologies for the delay in responding to your query.  When ProOrder rejects code it shows a warning yellow triangle.  Hovering the mouse over the triangle will tell you the problem.  I need to test the actual code to see the problem and fix it.   I may be able to pick the issue with the details of the warning message, but the code would be better.

    • MikeGC • 08/27/2016 #

      Hello @Michael,
      My apologies for the delay in responding to your query.  When ProOrder rejects code it shows a warning yellow triangle.  Hovering the mouse over the triangle will tell you the problem.  I need to test the actual code to see the problem and fix it.   I may be able to pick the issue with the details of the warning message, but the code would be better.
      Hello @MaxT,
      The code “HIGHEST[5](c1)=1” is saying look back 5 bars and pick the highest bar that complies with condition c1.  Condition c1 is that the Coppock for that bar is higher than the Coppock for the previous bar.  If this is true (=1), and all the other conditions are true, then do the following…..
      I am looking for a confluence of the 3 indicators and 5 conditions within 5 bars as a signal to buy or sell.  If you want to test the efficacy of the code, remove the “HIGHEST” phrase and run the code reading “IF c1 AND c2 AND ……etc”.  
      There is no requirement in the code for COI<0.  COI must be less than COI(1) for a short position.  This means that it is sloping down from a high point.
      I hope this clarifies your concerns.  Let me know if I can be of further assistance.

  8. MaxT • 08/27/2016 #

    Hi Mike
    Many thanks starting to make a bit more sense now and also seen the same code used in other strategies on here/understand you are merging ideas etc.
    Also wanted to confirm- the 3 .itf’s posted here – the MGC is your supertrend v2.0 using the supertrend indicator for sl/tp and the Trend Chaser v3.0 is the same as the Trend Chaser v3.0 with MM just that you have made the sd parameter more convenient at the top of the code in the MM version?
    And the grid ordering only works when cumulate orders are set to true but the money management is what is calculating the sl/tp yeh?

  9. MaxT • 08/27/2016 #

    Hi Mike
    I see the HIGHEST[5] condition comes from cfta’s post ‘Grid orders with…’ but he states he doesn’t think he’s quite got it figured out (and I think he/Zilliq/sylvess are right… or rather ‘wrong’ 😉 cannot post there though for some reason)
    I created new code using only the MAC and this HIGHEST[5] and it does not enter positions according to last 5 bars continuously rising
    Also assuming it did work correctly then it makes sense checking the COI, MAC and STO this way but you are also ‘asking the same’ of conditions c3, c4, c13 and c14 which doesn’t make sense/these conditions are only that the STO is greater than or less than a figure and not continuously rising (unless you are trying to ‘ask’ that they have remained above/below these figures for the last 5 bars?)
    Probably not the most elegant way/bit long winded but the attached ‘works’ for continuously rising/falling over last 5 bars (but a trade can be entered then immediately exited the next bar if MAC continues to rise/fall for 6th bar whereas I think the idea would be to ‘reset the clock’ once a position had been entered…? Not sure how to achieve that though…!)
    /// Definition of code parameters
    DEFPARAM preloadbars = 3000
    DEFPARAM CumulateOrders = FALSE // Cumulating positions deactivated

    MAC = MACDline[12,26,9]

    // Conditions to enter long/exit short
    EL1 = (MAC > MAC[1])
    EL2 = (MAC[1] > MAC[2])
    EL3 = (MAC[2] > MAC[3])
    EL4 = (MAC[3] > MAC[4])
    EL5 = (MAC[4] > MAC[5])

    // Conditions to enter short/exit long
    ES1 = (MAC < MAC[1])
    ES2 = (MAC[1] < MAC[2])
    ES3 = (MAC[2] < MAC[3])
    ES4 = (MAC[3] < MAC[4])
    ES5 = (MAC[4] < MAC[5])

    //Enter long

    //Enter short

    //Exit long

    //Exit short

    • MikeGC • 08/27/2016 #

      Hi Max,
      Many thanks for your input.
      The 5 bar look-back only checks that the condition was fulfilled in the last 5 bars.  Your idea to check that it is continually rising/falling is good, but the entry point is when, during the last 5 bars, there is a change in the indicators.  I have found that it is the turning point that is more accurate.  How did your tests work out?
      And the answer to all your questions from 2 days ago is “yes”.
      Let me know how you go.

  10. MaxT • 08/27/2016 #

    Aha! I think that was when it was entering in my tests – on a change so I guess it is working as intended! *blush* 🙂
    Many thanks all very helpful figuring out how this is working – haven’t run any tests along the way I just posted but have had a few proorders running in demo mode with some good results using your original code so perhaps I will just stick to that! 🙂

  11. Alco • 08/27/2016 #

    Hi Mike, Thanks for your great code! It is working great on backtests, but I want to test it on demo and it doesn’t work.

  12. volpiemanuele • 08/27/2016 #

    what is the latest code for these strategy ? thanks

  13. MikeGC • 08/27/2016 #

    Hi @Alco, I have responded in your post re trading errors.
    Hi @volpiemanuele, the only new code is that which I have optimised.  Now a word of warning, most automatic trading systems are quite complex with lots of variables.  If you get a spectacular result in back-testing, it does not mean that you will get the same result in ProOrder.  You need to forward test in ProOrder in demo mode for some time to be sure the code will produce a satisfactory result when run live.  And even then there is no guarantee.
    Read @cfta posts for a good strategy for using ProOrder safely.  I don’t think it is a “set and forget” opportunity.  It really needs supervision unless someone is clever enough to create some self-optimising code.

  14. Francesco78 • 08/27/2016 #

     Thank you Mike, very interesting job, seems quite peculiar with respect to all the strategies I have seen on this forum so far, but maybe Its because I’m just a beginner.
    Results looks pretty good though.

  15. Francesco78 • 08/27/2016 #

    Correct me if Im wrong, the idea is to use the Trend Chaser in 1 minute  time frame. Turn it on and then take a profit as soon as the trade capture the short term trend, take a profit and re run it.
    Is that right?

  16. Francesco78 • 08/27/2016 #

    Correct me if Im wrong, the idea is to use the Trend Chaser in 1 minute  time frame. Turn it on and then take a profit as soon as the trade capture the short term trend, take a profit and re run it.
    Is that right? Because otherwise from what I see in the recent past in the 1minutes TF it doesnt switch positions

  17. morfix • 357 days ago #

    Does anyone have this updated code? or tested in demo?

  18. Petrus • 355 days ago #

    Hi Mike.
    Thanks for sharing the code.
    Whit which indexes do you recommend to use it and in which timeframe? Only 1 min or also in other TF?

  19. MikeGC • 355 days ago #

    Hi All, apologies for the late response to your queries. I have been away and have not been trading for some months. 
    I posted the code I have used manually with some success, in the hope that someone might develop it further to the point that it could be run successfully in ProOrder. This has not happened and my trials in PO were not exciting. 
    My manual operation of this system works about 50 % of the time and depends on manual money management to make a 3:1 reward to risk. 
    I can’t tell you how best to use a system because everyone has a different style of trading.  Take the ideas, play with them and develop your own style that works best for you. 
    On that note I would like to close this post and will not be following it in the future.
    Thank you for all contributions and your interest. May you develop a successful trading system. 

  20. Mansoor • 226 days ago #

    What does COI stand for?

    • MikeGC • 226 days ago #

      Hi Mansoor, COI is the abbreviation for the Coppock indicator.

Register or


avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar

+8 more likes

Related users ' posts
odin The shorts in trouble with my own coded short term trouble indicator, its when the differenc...
odin here is my code c1 = ExponentialAverage[3](close) c2 = ExponentialAverage[5](close) c3 ...
juanj HI Odin Can you also kindly provide the code for the 'Short Term Trader Squezze' indicato...
Geronima Ortiz I watched the video three times, but I can not put the npips parameter as a variable. I do...
Geronima Ortiz I think the video is for an old version of prorealtime, the images do not correspond at all ...
Nicolas indicator1 = CALL “PRC_StopReversal”[npips, 1] and define npips in the optimization window ...
AngelPujalt Quisiera saber si este modelo de cribador repinta. Saludos
odin look at the screener i upload a new rule based screener for this strategy to find long candi...
JanWd Very nice strategy, it does work indeed !! Very long time perspective. You can use this s...
Caribeengeek Bonjour j’avais vu que vous proposiez d’écrire des codes pour ceux qui s’y connaisse pas Mai...
Caribeengeek Les devises unité
Nicolas Merci d'utiliser le forum pour les demandes de programmation personnalisée
Nicolas Thank you for this valuable stock screener. However, I can't get bearish signals with the co...
Per Inge Thanks for your advice, that is useful and I will study that option. I found that problem as...
Nicolas You can send me updates through the form on the contact page:
juanj This gets me thinking about creating a strategy on the 5min timeframe that only takes trades...
GraHal I noted above does okay on DAX 10 min with even a reduction to 30 of the Stop Loss. I've s...
styrke Hello Nicolas, Nice screener, I appreciate the way you always try to condense at maximum th...
Nicolas There's no particular reason. RSI is widely use with its default period and results seems re...
Vonasi I noticed a couple of typo errors in the code. The list of variables lines 4 to 11 should be...
Genotik Thank you for your important contribution this week which is much appreciated! Happy New Yea...
Vonasi No problem. I hope they are useful to someone. Happy and hopefully prosperous New Year to y...
DarioMazza Hi Vonasi, i have a question for you, the comand "pricetype" where did you found it in the ...
Vonasi PriceType is just a variable that I use. The value decides what type of price is used in the...
Vonasi I noticed a couple of typo errors in the code. The list of variables lines 4 to 11 should be...
Nicolas Sure, please add a new topic for this query in the automatic trading forum.
edgar degas Bonjour Nicolas, et encore bravo pour VOTRE œuvre ! Avec les vicissitudes de la vie, pas eu ...
Nicolas Super ! Merci pour le retour, à très prochainement dans le forum Anglais dans ce cas :)
primo1 Bonjour Nicolas, sur quelle échelle de temps minimum tu utilises l indicateur je pense...
primo1 Bonjour Nicolas Pour créer la strategie comment peux tu traduire l"apparition des points....
Nicolas Exemple dans ce sujet du forum ProOrder :
rafadonl2 Here it is the screener. (sorry I don't speak german). //Reglas en Heikin-Ashi: //1- Sec...
finplus Muchas gracias. Have a good day.
rafadonl2 I have modified some lines and it seems this version will work better. Even so, I recommend...
MattD Hi Nicolas, Can you assist me with writing this in excel? I'm missing something, because l'm...
Nicolas You can ask for other platforms coding through the programming services: https://www.proreal...
MattD Hi Nicolas, (me again) Can you please clarify the following. maOpen=(maOpen[1]*(MAper...
JR1976 Dear Mike , your screener seem interest and simple... Do you try to envelope an automat...
verdi55 Running a single Renko strategy with a fixed box size is usually not a good idea, because th...
Fabrizio_T Hi, have you tested on the period 30 julay - 30 September 2015?
grzemariusz Hi I use your strategy but i don't know how to implement position size to the code thanks f...