Trend Breakout

Trend Breakout

Good Day Everyone

This is probably the craziest strategy I have ever written. It is based on diagonal trend line breakouts. The trend lines are calculated from the extreme of the highest/lowest pivot to the extreme of the next highest/lowest point in the trend. The calculation uses the Tan trigonometry function to calculate the size of the angle between the pivot extreme and the close of the last bar. Violation of the trend line triggers a new stop order and trend direction.

Below the code as adapted for the EUR/USD Mini on the 1Hr timeframe:

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. Francesco78 • 09/08/2017 #

    very interesting idea! thanks

  2. Francesco78 • 09/08/2017 #

    would you mind to specify what are the optimized parameters? many thanks

  3. juanj • 09/08/2017 #

    Optimize parameters:

    1. Outside market hours (line 9)
    2. Highest Point of Violation look back period (line 98 and 102)
    3. ATR period and multiplication factor (line 99 and 103)
    4. Bollinger Standard Deviation (line 120)
    5. Bollinger Period (line 125)

  4. Francesco78 • 09/08/2017 #

    Thank you!

  5. juanj • 09/08/2017 #

    @Nicolas @Wing @Francesco78 I am thinking of ways to make the strategy more robust but will require visual cue’s to assist me in analyzing the strategy. Can one of you possibly assist me in graphing the lines? I will require each revision of the trend line (i.e. every time the trend line is updated it needs to be graphed). This will help me better determine when is the best time to update the trend line and/or when it can be considered violated. Thanx

    • Nicolas • 09/08/2017 #

      Should be better with an indicator. As long as we can determined at least 2 coordinates for each line.

  6. juanj • 09/08/2017 #

    The last fractal will be coordinate 1 and the high/low of the candle that generates an angle greater than the previous angle will be coordinate 2

  7. juanj • 09/08/2017 #

    And the point of violation is the close of the candle that violates the line by generating an angle greater than the current angle and closes opposite the active trend

  8. juanj • 09/08/2017 #

    For the latest version of the strategy or to follow updates and developments see the thread here:

Register or


avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Vonasi Change line 76 to if opendayofweek opendayofweek[1] and opendayofweek 0 then if ...
Vonasi There has been a minor bug fix as lines were drawn incorrectly if both HH or both LL values ...
dario ti Excellent, i was looking for something like that, but could be great if you add the option t...
Vonasi There has been a minor bug fix as lines were drawn incorrectly if both HH or both LL values ...
Vinks_o_7 Thanks !
dario ti Thank you!
coscar Ottimo lavoro. come sempre!
luxrun Nello studio di Sepiashvili viene descritto anche un altro indicatore, il Q-indicator, che è...
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,...
TheDisciplinedTrader Much appreciated Nicolas! I have been looking for something to highlight reversal bars for q...
Matthew Darling Hi Nicolas, should this work on all software. Wont work on tradingviews pinescript
Nicolas No. The code delivered on our website is for ProRealTime trading platform: https://www.pror...
Vonasi There is another version of this indicator that can plot the same lines but onto an indicato...
Martin35 Hello Vonasi, do you think it is possible with PRT to code with the same principle as on thi...
abhay I am getting a shading between the lines, how can I avoid that. I just want to see lines as ...
Vonasi Delete the 'Color Zone' in the indicator settings window.
juanj DId some tests using MACD validations on higher timeframes using MTF functionality and unfor...
FREDNC Hi Francesco I tried with :
FREDNC adx[14]>adxmin and adx[14] > adxr[14] and adx[14]>adxmin and adx[14] DIminus[3](clo...
PastaPesto Paul, Im sorry but where do I open a topic?
Paul in ProOrder support, at the bottom
Maik2404 wie kann ich den Code bekommen Paul?
rama This is one of best indicator to trade any time frame
Madrosat Is this indicator as it is , useful in strategy automatic
Maik2404 es sind leider nur long Positionen und keine Short zu erkennen.
Maik2404 Vytautas: es bleibt aber nur bei long Auslösungen
ullle73 this one is not a winner, have backtested it on almost all pairs, does not have an edge
osupero Buenisimo Sr Nicolas, seria posible que sólo marcara por encima o por debajo de una media mo...
capgros Bonjour @Nicolas, Thanks a lot for this tool, it is very useful for me. I would like to s...
6 months ago
JvdG I meant of course: since ld56 is one of the constituents of ld48;
Nicolas You are right about ld56. Since this is a translation from another programming language, I d...
Florian Legeard C’est à dire sur le prix et non sur le temps ? Merci
Paul updates are posted in topic below
eugenio buongiorno paolo , volevo farti i complimenti x il lavoro fatto , funziona molto bene sul 3 ...
Modes68 muy buena estrategia, gracias por compartirla thank yoy for your estrategy, I like me
cfta Hi Fulvio, many thanks for sharing this clever indicator, much appreciated. As Pepsmile ment...
cfta Sorry adding the PRT to code didn't work in the above comment so I guess we will have to set...
juanj Something appears to be wrong with this formula as graphing t shows t to almost never be wit...
Nicolas Thanks a lot for this new valuable addition to our library. I changed line 76 with "barindex...
Horance Thanks. I've noticed this leftover after submission, but it was too late for editing. BTW, I...
Etienne Thanks Horance for porting this code to PRT. I would like to bring some speedup to your cod...
8 months ago
Maxime Baudin Interesting, Thank you! :)
franck-david Bonjour Nicolas , actuellement je me forme grace a vos videos tres tres bien expliques mer...
Nicolas Merci. ça n'est pas le lieu pour poser ce genre de question :) Merci d'utiliser le forum Pro...