Market Phase

Market Phase

Inspired by a script seen on TradingView, I translated and adapted this indicator.

It shows the relation of price against different period moving averages.

The arrows indicates possible retracements in a general trend direction, so they can be used as entry point.

No ground breaking math here, but I am finding very useful and some algo based on it is giving good results in demo live.

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?

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

  1. cjr30 • 05/27/2019 #

    Please, could you tell me how can i to put yours colours on the indicator and how colour the zones.
    Thanks and sorry for my english

  2. luxrun • 05/27/2019 #

    AlexF, thanks for the market phase indicator; please, you could give an indication of how to set the resulting graph (color zones and line colors) in order to reproduce a visual effect similar to yours. Thanks again

  3. AlexF • 05/27/2019 #

    Set the “phases” as histograms with different shades of green and red for above/below zero. Set the other ma values as lines.

  4. Jan Wind • 05/27/2019 #

    Thanks for the post !
    Have you tried it with the volume indicator, maybe it gives another good restriction /confirmation for a trading strategy?
    At least I will try around with this indicator for a trendfollowing strategy.
    KR Jan

  5. Jan Wind • 05/27/2019 #

    I added the (boring) coloring coding to this indicator, see below, so the indicator will immediatly be colored when you add it,

    // This indicator shows the relation of price against different period ma’s.
    // When put in daily Timeframe it gives the 1400 Day (= 200 Weekly) and the 200 ,100 an 50 Daily.
    // Features:
    // – The lines show the 200,100 and 50 ma in relation to the 1400 ma.
    // – The arrows indicate possible (retracement) entry points
    // Coded by AlexF

    ma50=close-ExponentialAverage[50](close)
    ma100=close-ExponentialAverage[100](close)
    ma200=close-Average[200](close)
    ma1400=close-Average[1400](close)
    dma50=ma1400-ma50
    dma100=ma1400-ma100
    dma200=ma1400-ma200
    if ma50 < 0 then
    r = 255
    g = 0
    b = 0
    else
    r = 0
    g = 128
    b = 0
    endif
    if ma100 < 0 then
    r1 = 192
    g1 = 0
    b1 = 0
    else
    r1 = 51
    g1 = 204
    b1 = 51
    endif
    if ma200 < 0 then
    r200 = 255
    g200 = 51
    b200 = 0
    else
    r200 = 153
    g200 = 255
    b200 = 102
    endif
    if ma1400 < 0 then
    r14 = 162
    g14 = 43
    b14 = 30
    else
    r14 = 204
    g14 = 255
    b14 = 153
    endif

    if dma50 < 0 then
    dr = 255
    dg = 0
    db = 0
    else
    dr = 0
    dg = 128
    db = 0
    endif

    if dma100 < 0 then
    dr1 = 192
    dg1 = 0
    db1 = 0
    else
    dr1 = 51
    dg1 = 204
    db1 = 51
    endif

    if dma200 < 0 then
    dr2 = 255
    dg2 = 51
    db2 = 0
    else
    dr2 = 153
    dg2 = 255
    db2 = 102
    endif

    return ma1400 coloured(r14,g14,b14)style(histogram) as "1400 phase",ma200 coloured(r200,g200,b200)style(histogram) as "200 phase", ma100 coloured(r1,g1,b1)style(histogram) as "100 phase", ma50 coloured(r,g,b)style(histogram) as "50 phase", dma50 coloured(dr,dg,db)style(line,3) as "50", dma100 coloured(dr1,dg1,db1)style(line,3) as "100", dma200 coloured(dr2,dg2,db2)style(line,3) as "200", 0 as "zero"

  6. winnie37 • 05/27/2019 #

    hello,
    thanks, could you post somes algos suggestions to improve, based on this indicator?

  7. Jan Wind • 05/27/2019 #

    Hallo Winnie37,
    Not sure about your question,
    I will have investigate if I can make a new trading algo for myself based on this indicator. I am a trendfollowing trader, so I hope this indicator can contribute..

  8. winnie37 • 05/27/2019 #

    yes. “No ground breaking math here, but I am finding very useful and some algo based on it is giving good results in demo live” in description; I investigate too but not very good results for the moment…

  9. Jan Wind • 05/27/2019 #

    Also interesting to know what does not work, which set up you use, saves me investigating ! Do you mind sharing this ?

  10. winnie37 • 05/27/2019 #

    i just set the proorder like this: buy when 50/100/200 phase >0 and sell when under 0, good backtest but no effective trades in demo…strange thing…Ok to share 🙂

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
MaoRai54 Thanks, now it's OK. in your first code at line 15-16 it's missing.
Madrosat Hello Ivan Did you try a strategy with this indicator
Iván Hi. No I didn't. This is a code translation requested by an user a few days ago.
GustavoLoboOrenstein Is it possible to add histogram with only increasing bars?
JohnScher Postscript: It's running in the live right now. One position after the other is opened. ...
ullle73 nice!! how's it been since your last post on going live? :)
thomas2004ch Hi, Is this strategy suitable for daily SPY? Regards
AndPar Buongiorno Nicolas, vorrei provare questo indicatore, ma quando lo inserisco in PRT mi vengo...
Nicolas Basta aggiungerlo al prezzo https://www.prorealcode.com/blog/video-tutorials/how-to-add-an-i...
Aragorna hello Nicolas, this indicator works with the last Beta version of PRT? Ive seen tha many in...
wally Hola soy nuevo en el mudo robots. Alguien seria tan amable de poner el archivo itf.file ya q...
Darren Nash I found this works well on the DOW
thomas2004ch Hi John, Is your strategy suitable for daily SPY? Regards
KAMJKAZE thanks, really interesting!
2c95 thanks, why do U prefer average than lowest ? to close under average does'nt mean another...
Stenozar Hi Sever, how can I visualize the coloured areas?
Sever Hi Stenozar, You need to add the color zones yourself , just go to Add Color Zone To set ...
Nicolas change the last line with: return v coloured(r,g,b) style(line,2), v+band coloured(168,168,1...
Paolo.B Thanks ... works as i wanted.
Kanamax Bonjour Nicolas, comme Paolo.B je souhaiterais utiliser cette indicateur au sein d'un code. ...
Boris Hi IVMcm, thanks for your amazing work. I have tested all of your indicators and use some of...
IV Mcm With pleasure and thanks!
ashiash how to use this indicator can i use tradingview platform
zilliq Thanks @Nicolas. I tried to use it as Trend in a proorder system, but don't know why, it doe...
Suzu Yuk He is right. MT and mavgMT are not defined and causing errors.....
Maxime Baudin Super travail !
Yanic c'est top j'adore
Maxime Baudin Merci l'ami, passe une bonne semaine
IV Mcm Merci de même ;)
Nicolas C'est dans ce sujet: https://www.prorealcode.com/topic/trendline-une-approche-du-trading/ M...
Pensera Bonjour Nicolas, comment est-il possible de backtester cet indicateur? cela fait une erreu...
Nicolas Oui bien sûr, il doit y avoir pas mal de sujets dans le forum à ce propos.
IV Mcm The use of this indicator is however logical, it gives you potential movement departures dep...
Nicolas The updated version (v2) is available to download and discuss in this forum thread: https://...
IV Mcm Thanks Nicolas
Manu L. Bonjour Nicolas, j'ai créé un screener avec l'aide à la prog en TF weekly mais je voudrai...
wtangsiri C'est exactement le même signal que donne le croisement et le décroisement de deux EMA (7 et...
PHAN100 bonjour, j'ai un bug sur le programme recopié prorealtime me dit qu'il y a un problème à ...
IV Mcm Vous devez faire un clic droit sur le prix > propriété > ajouter indicateur Si vous...
punch1 Fonctionne pas chez moi il s'affiche rien pourtant j'ai bien fait le clic droit sur le prix ...
punch1 Je peux te faire un screen d'ecran si tu as un email :)
ferros bonjour , super votre indicateur!!!! est-il possible de l'avoir en histograme +1 /-1 por en...
IV Mcm V2 is coming
SudhirRN is this code working for on tradingview plartform?
Nicolas No. All our codes are made to be used with ProRealTime trading platform: https://www.proreal...

Top