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
ggolfet Thanks Nicolas, I imported the itf file and solved the problem.
Hasardeur Hallo Nicolas, i tried to code the multi period heat map in combination with the Ehler’s ...
Nicolas Please open a new topic with the code in forum.
Vinks_o_7
5 years ago
IV Mcm I've always wondered how to make the ADX faster, thank you!
Vinks_o_7 You welcome !
Vinks_o_7 Another variation that may be more accurate : we calculate the average of normalized DI's in...
nfulcher Please could someone explain how the following code is calculated:- iDI = TEMA[3](DI[DI2]...
oakenstream Jan, I find sometimes that the priceexit variable is never set. It seems to happen when the ...
Matt66612 I do not understand the first time I launch the backtest I got the same result as you. but ...
avatar
unkown ;-) sfido chiunque a riuscirci!
avatar
unkown infatti basta leggere i post degli altri....
nicola papangelo ciao Francesco vorrei contattarti su facebook o in privato. Grazie
Janfi Hello, I'm new to ProRealCode and I do not understand the following summation[n](indicator...
Kaci It seems he's just checking that the previous MACD is < 0 for maximum one period ? I'...
Daniel Martin Hi do you know how have and entry after the second cross? There is crosses below 0 and cross...
Leo I don't know, I just copy paste the strategy. The optimisation of the values I wrote them in...
bertrandpinoy hello Leo I'm spending time on your strategy code. do you agree to try to include this code ...
bertrandpinoy //version a: ajout filtre MM defparam cumulateorders=false // --- paramètres taille =...
3agl3 voglio l indicatore
tradingpro salve io faccio spread trading e volevo sapere come impostare un profitto da chiudere in a...
Nicolas Per favore non fare domande generali, non correlate al post. Usa invece il forum.
Bard Incredible, that is the clearest depiction of the trend I've ever seen Nicolas. (I just chan...
Vonasi Discussion on this indicator/filter can be found here: https://www.prorealcode.com/topic/121...
Vonasi Forum discussion on these indicators can be found here: https://www.prorealcode.com/topic/av...
jennr29 Hi. Is it possible to convert this code to an mq4 file?
Nicolas Sorry but our website is dedicated to prorealtime programming. However, you can ask for priv...
snow_onar Very interesting indicator. Thanks for contributing it. What volume node or volume profile i...
Leo Does it opens pending orders?... maybe they were not trigger.
Mattzi Dont know, all i can see is that it opened an order yesterday in backtest but not live. Th...
Jean-Christophe Hello Leo, when running the strategy from 29/12/2015 to 31/08/2018 on ProRealTime Premium, I...
Gordon101 Hi when I added your Guppy indicator to my chart it went below the chart beside the oscilla...
Nicolas Add it on the price by using the wrench located on the left upper side of your price chart.
Gordon101 Thanks Nicolas, worked a treat.
Geronima Ortiz I watched the video three times, but I can not put the npips parameter as a variable. I do...
Geronima Ortiz I think the video is for an old version of prorealtime, the images do not correspond at all ...
Nicolas indicator1 = CALL “PRC_StopReversal”[npips, 1] and define npips in the optimization window ...
dertopen HI Wwhy you said avoiding bear market? Don't you think that we can use this code for short...
maurizio dove si trova lo screener?
macdopa Thanks...
Caribeengeek Bonjour j’avais vu que vous proposiez d’écrire des codes pour ceux qui s’y connaisse pas Mai...
Caribeengeek Les devises unité
Nicolas Merci d'utiliser le forum pour les demandes de programmation personnalisée
Actabi Thank you ! Have you realised your "next step" ?
Jessar guten Tag, gibt es bereits die Aktualisierte Datei?
Per Inge Gents - An update - I have been studying various trading approaches, as this one that is bas...
juanj This gets me thinking about creating a strategy on the 5min timeframe that only takes trades...
GraHal I noted above does okay on DAX 10 min with even a reduction to 30 of the Stop Loss. I've s...
Kris75 Hi Grahal, What about making the same great work you did with the snipet on google doc but...

Top