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 • 41 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 • 41 days ago #

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

  3. juju333 • 41 days ago #

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

  4. juju333 • 41 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 • 41 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 • 41 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 • 41 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 • 39 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 • 38 days ago #

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

  9. winnie37 • 34 days ago #

    could you post for Dji please?

    • JohnScher • 33 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 • 23 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…

Register or


avatar avatar avatar avatar
Related users ' posts
Sukhdev Golen Hi Nicolas, how to use this on tradingview?
Nicolas You can't. All codes here are made for the ProRealTime trading platform: https://www.proreal...
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
HeikinAshi https://www.prorealcode.com/topic/ssl-channel/
jobswaps oyes aste uno de soportes y recistencias
jobswaps eso lo necesitamos
Zebra OpenTime < 090000 AND OpenTime > 190000 should probably be OpenTime < 090000 OR Op...
robertogozzi Well spotted Zebra!
alfcont Is this trading system generating profit on micro DAX future?
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...
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 ...
Nicolas Just add a linear regression moving average of 200 periods on the chart and you'll get the s...
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...
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,...
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...
Choliver Bonjour et merci pour cet indicateur. Toutefois, il me semble qu'il est unidirectionnel. P...
Louis Winthorp III Hi Choliver, you are right, there is a problem with the drawing instruction when the slope i...
Nicolas File and code are updated.
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