Market Bias indicator coloured

Market Bias indicator coloured

This code represents a trading strategy which smooths the price data with exponential averages and Heikin Ashi methodology, and then provides a visual representation of bullish or bearish bias with the oscillator and colored candles.

Here is a breakdown of the code:

Variables HAlen and HAlen2 are set to 100. These variables represent the lookback periods for calculating the exponential averages for the original and smoothed Heikin Ashi candles respectively.

The Exponential Moving Averages (EMA) of the open, close, high, and low prices are calculated over the HAlen period. This is done with the ExponentialAverage[HAlen](Open/Close/High/Low) calls.

The HA close (HAClose) is calculated as an average of the open, high, low, and close prices. The HA open (HAOpen) is calculated as an average of the open and close prices from the previous period and the close price of the current period.

The HA high (HAHigh) and low (HALow) are determined by taking the maximum and minimum of the high, low, open, and close prices respectively.

An additional smoothing is then applied to the HA candle’s open, close, high, and low using ExponentialAverage[HAlen2](HAOpen/HAClose/HAHigh/HALow). The results are stored in O2, C2, H2, and L2 respectively.

HAAvg represents the average of the smoothed high and low of the Heikin Ashi candle.

OSCLen is set to 7, which represents the period for the oscillator.

The oscillator bias (OSCBias) is computed as the percentage difference between the smoothed close and open, and then smoothed again using an EMA over the OSCLen period to get OSCSmooth.

Depending on the value of OscBias relative to OscSmooth, the RGB (red, green, blue) color values are assigned for the candle drawing. The RGB values are used later to color the drawn candle.

A candle is drawn using the smoothed Heikin Ashi open, high, low, and close, and it is colored according to the determined RGB values.

Finally, the smoothed high and low of the Heikin Ashi candle and the average are returned as “BIAS High”, “BIAS Low”, and “BIAS Average” respectively.

Code converted from discussion in topic: https://www.prorealcode.com/topic/market-bias-indicator/

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. BriceE • 293 days ago #

    Bonjour Nicolas,
    Je suis a la recherche d’indicateurs pour me donner la meilleure indication possible de la tendance que devrait suivre actif travaille dans la journee. Que me proposeriez-vous?
    Merci par avance,
    Brice

avatar
Register or

Likes

avatar avatar avatar
Related users ' posts
Emperor.it "style(line,2)" C'è una guida ai parametri che si possono modificare ? Tipo stile della lin...
IV Mcm https://www.prorealcode.com/programming-with-prorealtime/
IV Mcm Good job !
Daniele Maddaluno Écrivez-moi où vous préférez you can easily find me on LinkedIn
AK27 C'est payant visiblement sur linkdin je peux pas vous envoyer, discord vous avez ?
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 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 :)
Fabian Hi Thomas, thanks for your explanations. Which indicator do you use in the screenshot ...
Thomas Thats On Balance Volume and Bollinger or SMA or what you want. It shows me the volume flow. ...
bertrandpinoy @MAKSIDE I would be grateful if you send me your version. have a nice day
Nicolas Il doit s'agir d'un mauvais copier/coller. Je suggère de télécharger le fichier itf contenu ...
Bard Hello @Nicolas, I can get this to display in a separate indicator panel but not on Price as ...
Stenozar Hi @Nicolas, how can I put the bands on price? Thanks, Stefano
imran Hi I have been trying to test a strategy to buy and sell based on the indicator cross overs...
Zigo I'am sorry that I answer so late, but the code seems to be working perfect. I use the indica...
Guillaume Mcm I gave the above message fix ;)
Tradingrob Is it possible to put the itf-file in the right way here in Prorealcode? so the right 'trend...
Guillaume Mcm Update link ;) https://www.prorealcode.com/topic/trend-histogramme-cci-mise-a-jour-suite-...
oliverkeim Hi, also here not working. Only white lines.
killerplatuze Dont work anymore with the current version?
KryptoKat tolle Arbeit, professionell
Screw27 Hi man, I installed the indicator and i don't know why but my graph it is so big
HelixKing sounds interesting I'll take a look
Godo Bonjour Souhait Sam, Après de nombreux essais pour le mettre en format afin d'utiliser ce c...
Nicolas Il faut supprimer celles qui existent dans la fenêtre d'optimisation et les créer en dur dan...
crusoe76 hi there, anyone can help making this strategy work, i have a message saying replace variabl...
Screw27 Salut nicolas j'aimerais savoir tes résulats grace a cettte methode
eva.g.forsgren It dose not work, I get a strap instead of candels???????????????????????????????????????????
Nicolas That indicator is the one below the chart. The indicator to put on the price chart is this o...
pyhrus P.S : IG , que j'ai contacté ,m'indique que la version V11 , ne sera pas disponible avant un...
Hasardeur Dear Nicolas, is there someting at the arry to modify in order to run the trend at the actu...
MALIMALO Dear Nicolas, just try touse your indicator with backtest but it's not working. is anybody...
ribes65 Bonjour Nicolas, Merci pour votre travail. Est-il envisageable de créer un screener pour ...
Nicolas Bien sûr, merci de formuler une demande dans le forum des screeners pour prorealtime. En res...
ipbvba Est il possible de le transformer en indicateur (pour ne plus avoir les lignes mais uniqueme...
supertiti Bonjour Nicolas, Je ne comprend pas bien , le trend change de couleur quand les prix sont a...
Nicolas Oui ce serait possible, cependant l'indicateur est bien prévu pour conserver la couleur de l...
supertiti Quand tu pourras si tu peux nous coder la troisième couleur cela améliorerait les trades cou...
Nicolas How to import file page: in the help section of the website explains howto
kenssa import through the indicator page/window in the Proreal time
chicoteca Buenas, no consigo que se me muestre en el chart de DAX. ¿Cómo procedo? Gracias.-
frenqle Hi There.. It seems the TSL stop loss is not working.. it does not respond is that correct?
Ciccarelli Franco Per lasciare che la strategia venga eseguita (dopo aver importato il file): Basta eliminare...
JADINVEST Hello Jan, hello everyone, Thanks Jan for this strategy! Since 2020, have any of you found a...

Top