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
verdi55 Is there such a thing as a free lunch ?
maceng Thanks Nicolas for this great work! I would like to understand the math behind it in order t...
Nicolas Sorry I have no time to provide assistance for python programmers. Have a good day.
Maz Hi all, firstly happy to know that this is helping you. I look into updating it for PRT11 wh...
Nicolas just use 3 times a linear regression channel code you will find in the library.
leederbyshire Here's the link to alternative linear regression channel indicator Nicolas is referring to t...
Nicolas Thanks for contributing to the "ichimoku section" of the prorealtime code library Don't he...
sourberry Thank you , this is a great indicator works beautifully. Could you kindly modify to scr...
pp_playaflamenca Excuse me,... reading your code about spanB: [ SenkouSpanBFutureW = (Highest[SenkouSpanPerio...
Mansoor What does COI stand for?
MikeGC Hi Mansoor, COI is the abbreviation for the Coppock indicator.
nonetheless Anyone interested in this strategy please see forum topic: https://www.prorealcode.com/topic...
zilliq The reasons why I think it's time consuming and we loose time to try to do backests and Auto...
filiprb Hello Zilliq, You don't need a system to produce a walk forward test. You can easily create...
Philip Raphael It is incredible! Thanks for sharing, Doctrading!
Yannick Thanks for sharing. This strategy is flat for 11 years and winning afterwards. Don't you thi...
Doctrading Hello, As I usually say, strategies are exposed to be improved :) So yes, I think there mu...
Lior Green Doesn't work for me. Set values “compra” and “venta” to be shown as HISTOGRAM
Doctrading Hello, Someone asked me something (his results seemed to be different) on my email, but it ...
Glen Marquis Not your best..So what is your best strategy? :)
Andres Uffff, I didn't adjust the different index spreads. With the heavy spread of Italy It's nega...
davidp13 Good day. I know this was posted such a long time ago, but I though rebuilding the system on...
davidp13 Also to note that the one position in my code does not close the other, which as far as I kn...
TradSuz C'est étrange, je note donc à nouveau les deux horaires achat et vente =9H/17H, le iRSI de l...
TradSuz Merci à Doctrading pour cette trame de code super et qui marche sur d'autres supports aussi....
Bibi83 Bonsoir à tous Juste pour vous informer que j'ai enlever les conditions short et que cela ...

Top