Long only strategy with the TMA channel

Long only strategy with the TMA channel

as simple as it gets

I stole the indicator from here.
Then I rewrote the indicator into a strategy.

The action instruction is Long after the price crosses over (!) the lower band with the target the middle line of the channel.

thats all
until then

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. ALZ • 134 days ago #

    Hi JohnScher,

    Nice work
    Is system works well in production ?

    With these parameters, the resultat is even better
    HalfLength = 151
    AtrLength = 151
    AtrMultiplier = 2.5

  2. ALZ • 134 days ago #

    With same parameters, it works as well on DJI / H1

  3. juju333 • 134 days ago #

    Thanks JohnScher for sharing and ALZ for optimization. I’ll try it !

  4. juju333 • 134 days ago #

    Slightly better in 100K (DAX H4) with this :
    TradingTime = time = 090000 or time = 130000 or time = 160000
    set target %profit 2

  5. ALZ • 134 days ago #

    thanks juju
    of course time isn’t optimized for DJI
    See below new version with optimized parameters
    with profit 1.5 and time = 090000 or time = 120000 on DJI H1
    we have 50.42 for the profit factor with only 2 losses

    • juju333 • 134 days ago #

      Not sure to have the good parameters : on DJI H1 (100 K, which brings back to 30 july 2015) ? could you repost the all code ? thanks !

  6. juju333 • 134 days ago #

    Quite good results with ‘Soy Flour’ (SM) too : +63.99 % in H4 100 K (dont’ really know the spread) :
    // maincode : TMA Channel 4H co lowerband
    // coded by johnscher

    // works on dax 1 euro
    // timeframe 4H
    // timezone europetime, berlin

    defparam cumulateorders = false

    // parameters
    HalfLength = 151
    AtrLength = 151
    AtrMultiplier = 2.5

    avg = average [1](close)

    sum = (HalfLength+1)*avg
    sumw = (HalfLength+1)
    k = HalfLength

    for j = 1 to HalfLength do
    k = k-1
    sum = sum+(k*avg[j])
    sumw = sumw+k

    myrange = AverageTrueRange[AtrLength](close)*AtrMultiplier

    middleband = sum/sumw
    //higherband = buffer1+myrange
    lowerband = middleband-myrange

    TradingDay = opendayofweek = 1 or dayofweek = 2 or dayofweek = 3 or dayofweek = 4 or dayofweek = 5
    TradingTime = time = 090000 or time = 170000 or time = 230000

    IF TradingDay and TradingTime then
    if average [1] (close) crosses over lowerband then
    buy at market

    if average [1] (close) crosses over middleband then
    sell at market

    set stop %loss 3
    set target %profit 4 // as insurance

  7. JohnScher • 132 days ago #

    Thank you very much. I am glad that the code is so well accepted here.

    As for improvements through optimization, I would like to say that I have not optimized through. I was more interested in trading the track from crossover the lowerline to the finish midline.

    Furthermore I would like to add that the system has been running in demo since 28.12.2018 with tema 12 close as avg and sl tp 2.4%.
    Number of trades = 12
    Won = 10
    loss = 2
    gains = 554 Euro

    From 01.01.20 it goes live at ig.com/australia with the germany 30 cash (1£)

    have good times
    until then

  8. ALZ • 131 days ago #

    Nice JohnSchern, thx for your contribution
    i’m going too with my parameters

  9. winnie37 • 128 days ago #

    could you post for Dji please?

    • JohnScher • 126 days ago #

      I’m sorry, I specialized in the Dax. I’m sure the basic idea of the strategy also works in the Dow Jones. Maybe, you can try the optimization for Dow Jones.

  10. ALZ • 116 days ago #

    Regarding the DAX, it’s good too with 200k bars (with parameters of the basic idea)

    For DJI with 200k, i try to have good result but it seems to be impossible to apply this strategy on DJI… maybe other markets…

  11. Crystal Babe • 73 days ago #

    Hi John,
    this strategy is Great for DJI -justneededa bitof tweaking for the 1 hr chart. Thanks a million.
    though its coded to eit early at lowerchannel level , i have edited them to exit at higher levels with lovely results.
    John, if you dont mind can you explain which parameters i need to inverse to go short? ( planning for the near future:))

  12. sfl • 1 day ago #

    What is the meaning of the time filer ?
    Why 9:00 13:00 and 17:00 ?

    • JohnScher • 27 mins ago #

      The 4H candles begin at 09.00 13.00 17.00

Register or


avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Nicolas Not at all, we have tested it and it is the right file that contains the same code as the on...
Violet Nicolas, I downloaded the .itf it again. This time the .itf version is different from the o...
Nicolas in this case, change the line 18 with: dev = mult * std[length](source)
bob789 Once you download it, how do you upload it into PRT? thanks
Nicolas How to import file page: in the help section of the website explains howto
kenssa import through the indicator page/window in the Proreal time
swedshare You got some potential here. A couple of things I think about: 1, The opening hours in this...
phoentzs Ich habe hier mit Spread 2 gerechnet, also etwa dem Mittelwert zwischen Tag und Nacht. Das G...
phoentzs Hab festgestellt, das US500 fast noch besser funktioniert als der Dax. Was aber auch daran l...
Jan Wind Thanks for sharing ! The Gain/Loss ratio is a bit low, 1,16, hardly offset the risks take...
drive whats the period ?
Byggtrader Hi Nicolas! How do I get the indicator in the price chart? It only stays under i new chart.
Nicolas Just add it on the price chart by using the wrench on the left upper side of the chart (pric...
scarphace38 Bonsoir, je découvre PRT et je n'arrive pas a afficher le meme résultat pour l'indicateur de...
Dom Hello, hello....je commence le trading et découvre par la même occasion le codage....et ce n...
Nicolas Merci, ça fait plaisir !
HeikinAshi https://www.prorealcode.com/topic/ssl-channel/
jobswaps oyes aste uno de soportes y recistencias
jobswaps eso lo necesitamos
alfcont Is this trading system generating profit on micro DAX future?
frenqle can i put a completely different strategy under this strategy in the same code? or do i have...
robertogozzi You can read this topic (https://www.prorealcode.com/topic/multiple-strategies-within-one-tr...
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...
ALZ Hello, currently, I don't have the same result as above and don't no if it works good in...
JJ Tec Hola. Me gustaría contactar contigo para ver la estrategia..
nilsla1981 Has someone already tested in real ?
swapping Excellent Nicolas ;)
Violet Hi Nicolas, There seems to be a small error in the code, which causes the channel not to...
Nicolas Hmm, I don't think so, otherwise the channel will have a moving start and not anchored anymo...
Alberto Aguilera Hi! Thanks for your strategy Anyone can check it with 200 bars?
Nicolas I don't know, that code is a 1:1 translation from another platform.
jm1111enator Hello Nicolas, Is this a conversion from Tradestation Easy Language? If so, do you have a ...
Nicolas Sorry I do not provide assistance for Tradestation code.
Santi Salut, les amis. L'indicateur avec la nouvelle version de PRT 11 fonctionne très mal, ne fon...
oeil62 Bonjour quelles sont les valeurs des variables pour une utilisation journalière ? merci pour...
ALE As soon as the final version of ProRealtimeV11 is released, I will check for any changes to ...
Partha Banerjee Hello Nicolas, this is great, however the actual PRT standard error and standard deviation c...
Nicolas If you want to anchor the channel to a specific candlestick, that would be possible but with...
Newbie Would it be possible to modify this so it drew each bar one at a time? So with say 3 dots pe...
sir_i Bonjour à tous, Je suis nouveau sur le forum et sur la plateforme, pourriez-vous me dire com...
Nicolas Il faut simplement l'appliquer sur le prix.
sir_i Merci pour la réponse, je ne suis pas familier avec l'application de cette procédure simple,...
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...
darbes Hi How does it go on live ? JC