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
Gianluca thank you very nice screener
styrke Hello Nicolas, Nice screener, I appreciate the way you always try to condense at maximum th...
Nicolas There's no particular reason. RSI is widely use with its default period and results seems re...
Vonasi I noticed a couple of typo errors in the code. The list of variables lines 4 to 11 should be...
Genotik Thank you for your important contribution this week which is much appreciated! Happy New Yea...
Vonasi No problem. I hope they are useful to someone. Happy and hopefully prosperous New Year to y...
DarioMazza Hi Vonasi, i have a question for you, the comand "pricetype" where did you found it in the ...
Vonasi PriceType is just a variable that I use. The value decides what type of price is used in the...
Vonasi I noticed a couple of typo errors in the code. The list of variables lines 4 to 11 should be...
bazilou pouvez expliquer donchian bias merci
WarningTrading Comment peut on la comparer ? comme ceci ? cela ne me donne plus le message d'erreur manque...
sally31120 Bonjour, je n'arrive pas à créer ce screener close > supertrend extended2[1] la réponse...
Nicolas voir ce sujet pour un screener basé sur Supertrend Extended: https://www.prorealcode.com/top...
Nicolas https://www.prorealcode.com/topic/ayuda-screener-indicador-perfect-trend-line/#post-51291
Manu L. Bonjour Nicolas, suite a une de mes precedentes demande dans le forum indicateur, j'ai touv...
AntoGH C'est selon moi le meilleur indicateur, que j'ai vu, si vous trouvez mieux dîtes moi car dif...
rafadonl2 is not taken into account in the procedure. It considers only if it is a doji or when candle...
Guibourse Okay thanks, just a question : how do you plot your two lines in the same window as price ? ...
rafadonl2 sorry, I don't understand your question. Indicator draws Heikin Ashi candle, not price cand...
Nicolas Your PRT version is inferior to 10.3? So the code in its default state is not compatible. A ...
Mbulelo Hi Nicolas Hope all is well your side, do you have a specific strategy for the MFT Swing ...
Nicolas No I don't, try to make it on your own, or ask in forums (follow the posting rules please).
JR1976 Dear Mike , your screener seem interest and simple... Do you try to envelope an automat...
Player Hi Mike, What is the name of the indicator just under the MMA ? Thanks Regards Marc
Igor Hi Mike, What is the name of the indicator just under the MMA ? Thanks Regards
Bougnat bonjour, ton screener semble intéressant .... merci pour le partage
guytrc Hi Nicolas - many thanks for your screener. One question if I may - how does condition 5 wor...
Nicolas In the last 20 periods, the SMA 10 periods was above the SMA 20 periods.
stratobast Good afternoon everyone. Thanks Doctrading for your work. I have an issue while using this ...
stratobast My bad guys. I understood what was the problem. The indicator uses highs and lows for the Re...
samwarduk Has anyone tried this on Bitcoin GBP1? The results look amazing but every time mine trie...
Kris75 Hi Gabri I launched a very simple strategy based on the 3 bars trailing stop that you cre...
TimDeCat Hi. Has anyone coded a version that you could alter it to say 5 bar trailing stop? ie make ...
Nicolas Please open a new topic in forums so we can code it there, thanks.
finplus bonjour, il y a un problème à la fin du code avec elsif (close 0 then ... ne manque t il pas...
kj1988 Hello Nicolas, thank you for this useful indicator. Could you tell me how I can remove the...
Nicolas remove lines 101 to 103
GraHal Yes sorry, I set up a link to a screen shot on my google drive and then I got locked into th...
gabri Here's the thread https://www.prorealcode.com/topic/multiframe-rsi-of-rsi/
Bernard13 Bonjour Nicolas, Pourriez-vous m'indiquer si cet indicateur fonctionne avec la V11 ? Le di...
jens_kittner This strategy was posted 2 years ago. I tested it today and it works perfect with the new da...
giustim Hallo I am not able to use it on daily TF What have I to change? Thanks a lot
pac.ros Ciao Francesco, ti scrivo per un aiuto a proposito della strategia di Hofmann che anch'io ho...
David Balance thanks for sharing this excellent indicator.  Here are some thoughts.  please ad...
imokdesign Hi Everybody, when I look at the strategy I felt the need to implement a Moneymanagement-Sy...
Inertia newlevel then multiplier=multiplier+1 oldlevel=newlevel newlevel=strategyprofit+startequi...
Inertia Hi Bjoern, I was playing around with your code this morning (EUR/USD 5'). Thank you to the...
supertiti Thanks you so much Lucassen
dreif123 hi, copied the above code, not working on 10.3 the system says "return can only be used at ...
LUCASSEN Hallo , i have no problem , and i have the same versie 10.3, maybe you can ask Nicolas, tha...
Lyam Pareil ne marche pas dommage
ahmedbouaziz89 Bonjour, quand j'ajoute le code ou le fichier dans l'outils screeners de Prorealtime je ne v...
tyvix Bonjour le code marche bien c est juste qu'il n y a pas d opportunité au moment ou vous le...

Top