Kama & Sma Trading System DAX mtf

Kama & Sma Trading System DAX mtf

Coded for micro DAX €1 (simply multiply by 25 to run on standard DAX €25 or by 5 to run on mini DAX €5), 1-hour TF.

I used the Multiple Time Frame support to allow Breakeven/Trailing Stop to run on 1-minute bars (default TF).

Strategy from https://www.forexstrategiesresources.com/trend-following-forex-strategies/111-kama-strategy/.

Compared to the original version at the above link, I only optimized the SMA (called MVA in the above site) and set it to 22, instead of 7.

I also added SL & TP plus my own Breakeven/Trailing Stop code snippet.

Lines 10-11 allow to enable/disable Long/Short trading (both enabled by default).

Lines 21-25, along with lines 54-61 and lines 67 and 74, ban further trading before a whole 1-hour bar has elapsed, in case a trade exits within a few 1-minute bars. In such case the 1-hour signal is still set and valid, but it would most likely lead to a losing trade since the momentum is likely to have faded.

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. CN • 169 days ago #

    You mean coded for the 1-min TF?

  2. robertogozzi • 169 days ago #

    It’s a Multiple Time Frame strategy.
    It must be launched from a 1-minute chart, but signals are generated on the 1-hour TF.

  3. CN • 169 days ago #

    Sure Roberto, but didn’t get any trades on the 1H TF, so trading TF should be 1-min 🙂

  4. robertogozzi • 169 days ago #

    You need to search MTF to read what it is all about and understand how it works.
    You will only see trades on your 1-minute chart.

  5. Jesper • 168 days ago #

    What should be multiplied in order to compensate för other contracts size?

  6. robertogozzi • 168 days ago #

    Line 9, nLots is the number of contracts, you can change it as best suits you.

    • Jesper • 167 days ago #

      Ah, that’s what I thought as there were no ties in to the actual logics. Thanks!

  7. Edurecio • 168 days ago #

    I do not understand.
    Even if you change “time forbidden,” the system still produces the same results, with entries within that range.

    TimeForbidden = OpenTime 190000

  8. Jungblom • 168 days ago #

    I have ran this now for today and now @15:00 i got a “Alert triggerd for a sell Qty-1” and @ 15:05 I got a new alert on Buy (exit) qty +1 but no trades where triggerd why is that? Running with max position size of 2 contracts. when i backtest it a trade should have been done at these timestamps.

  9. robertogozzi • 167 days ago #

    If you want to discuss about inner workings or detail, please open a new topic on the ProOrder Support Forum and always attach detailed pics (instrument,TF,date and time should be visible), along with details posted.
    Thank you.

  10. winnie37 • 165 days ago #

    it could be tested on larger historic?

  11. robertogozzi • 165 days ago #

    If someone has access to 200K data history might post results (it would be better to start a topic on the ProOrder support forum). Upcoming v11 will support up to 1M bars of data history.

    • Gregg • 147 days ago #

      Hi Roberto, thanks for this new strategy but I don’t understand why I can’t backtest it with 200K units… it stops after 6 trades.

    • robertogozzi • 147 days ago #

      There must be an issue with candlestick data from March 7th through March 12th. which causes backtest to stop at 15:04 om March 7th.
      If you make your backtest start from 00:00 March 13th, then it works fine.
      I will report this to PRT/IG.

  12. Ruark Baker • 159 days ago #

    Hi, I found the same problem with the time forbidden code but I have messed about with it using some code that I use for day trading and money management along with altering the stop size based on the trades taken in the last 100k bars.

    • robertogozzi • 147 days ago #

      There must be an issue with candlestick data from March 7th through March 12th. which causes backtest to stop at 15:04 om March 7th.
      If you make your backtest start from 00:00 March 13th, then it works fine.
      I will report this to PRT/IG.

  13. Ruark Baker • 159 days ago #


  14. Jan Wind • 159 days ago #

    Sorry if I missed the latest discussions recently, but is MTF now usable and reliable in PRT production environment ?

  15. robertogozzi • 159 days ago #

    MTF was officially made available to all customers 2-3 months ago after almost a year being beta tested.

  16. Zebra • 134 days ago #

    OpenTime < 090000 AND OpenTime > 190000 should probably be OpenTime < 090000 OR OpenTime > 190000

  17. alfcont • 124 days ago #

    Is this trading system generating profit on micro DAX future?

Register or


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

+3 more likes

Related users ' posts
winnie37 could you post for Dji please?
JohnScher I'm sorry, I specialized in the Dax. I'm sure the basic idea of the strategy also works in t...
ALZ Hi Regarding the DAX, it's good too with 200k bars (with parameters of the basic idea) F...
anthon Salut à tous et merci !
Varadero54 Bonjour Anthon ... pourrais-tu me communiquer l'adresse ou le nom de ta chaine YOUTUBE ... j...
cedric croze a premiere vue la chaine youtube n'éxiste plus
Alai-n @Vonasi Thanks
jiddan78 how to convert to afl amibroker ?
Nicolas We do not supply free coding assistance for AFL Amibroker on the website. You can ask for pa...
GraHal Is there a switch to start / stop the Trailing SL / TP as when I GRAPH SL & TP neither a...
robertogozzi No GraHal, there's no topic open. It would be great if you could start one and post that lin...
GraHal Discussion Topic started here ... https://www.prorealcode.com/topic/discussion-re-auto-sy...
Gubben Since july 24th it's doing well. Started with a longer drawdown than expected but now it's 1...
Tony87 Gubben do we have a progress report?
Gubben So far so good. After a long drawdown it was winning four times in five weeks. Since 24 jul...
TempusFugit Interesting idea and with a lot of room for improvement.... maybe a trailing stop? Thanks fo...
Jan Wind Unglaubich das dieser Strategie Gewinne generiert ! Es erschient leider nicht so gleichmaßi...
BobFlynn Very good strategy, still works good in demo today ! :)
herke036 Hello is there an update about this strategy. New code, results, Anyone tried it live?
ALZ Hello, currently, I don't have the same result as above and don't no if it works good in...
Alberto Aguilera Hi! Thanks for your strategy Anyone can check it with 200 bars?
9 months ago
rrenaud_ig Great work ! My only concern is about risk management. Your results are based on 10k. Max lo...
Tony87 can we have a update on this one please?
Nicolas Discussions with many other versions and improvements can be found here: https://www.proreal...
LancerX Please indicate the trade stat to show ave gain against average lost..
Jan Wind Thanks for sharing the strategy !. Did you do an Out of Sample run when testing on the 100k...
jmf125 I don't know if anyone is following this thread anymore. Anyway I will post my comment. Aft...
unkown ;-) sfido chiunque a riuscirci!
unkown infatti basta leggere i post degli altri....
nicola papangelo ciao Francesco vorrei contattarti su facebook o in privato. Grazie
hartgeld Hallo Atxeel, sehr interessanter Code, habe das installiert und funktioniert. Danke! Kannst ...
atxeel Hallo hartgeld, die Ziele sind schlicht, bspw. die Range beträgt 10 Punkte, dann ist das Zie...
Maik2404 wie kann ich den Code bekommen Paul?
jens_kittner Works with US Crude at 1h as well!
Jean-Claude REGIS Je préconise de regarder les graphiques H1 et M15 pour visualiser la tendance de fond et d'...
Paul the last update can be found in topic Strategy DayOpen Straddle for DAX on page 14.
bertrandpinoy l instruction GRAPH pose problème sur PRT... pas vous? cordialement
Nicolas Supprimer simplement les lignes avec GRAPH pour passer en ProOrder, trading live.
bala Hi Kris, I have imported the screen. I don't see any instrument loaded under this screen....
Kris75 Hi Bala, you need first to install ZeroLagMACDWeek indicator and then add on it the diverg...
berga Hi, thank you very much for this very useful screener. I would like to get another very clos...
2 years ago
Bebbo Thank you for your contribution. I have tested your system on some instruments and I like i...
bertrandpinoy bonjour j ai tente l installation mais PRT m indique que ce code ne peut etre utilisé qu en ...
Nicolas en effet, il faut utiliser l'éditeur de code ProBacktest, il ne s'agit pas d'un indicateur m...
Xusto Hello, Fully Agree, I will update it with your advice. Btw Can would you like share you co...
Niklas johansson hägglund do you now if it's possible to use this strategy with this code in tradingview also?
Alexander9 This code for metastock ?, can for amibroker . Thanks