TradingView
allanster
٩ حزيران يونيو ٢٠٢٠ ١٧:٠٠

Heikin-Ashi Source Function HTF 

Bitcoin / TetherUSBinance

الوصف

Higher TimeFrame using custom source function for toggling traditional Candle sources or Heikin-Ashi sources on a traditional Candles chart.
Thanks to PineCoders for rounding method: pinecoders.com/faq_and_code/...
Thanks to @LucF and @RicardoSantos for their advice and enlightenment as always.

NOTICE: This is an example script and not meant to be used as an actual strategy. By using this script or any portion thereof, you acknowledge that you have read and understood that this is for research purposes only and I am not responsible for any financial losses you may incur by using this script!

ملاحظات الأخبار

Simplified code due to plotcandle() function now supporting series color for wickcolor and bordercolor.

ملاحظات الأخبار

Updated for Pine Script v5.
التعليقات
kyuahn
Hi @allanster
Thank you so much for your script, your script helped me a lot in my studies and models

I have question for you regarding this script
- When I try to overlay 1D Heikinashi(using this script) on a 1h chart, somehow there's a lag, I see previous day's bar on current day's bar, I also tried switching between the Live paint/lag settings
- I also noticed that 1D HA overlays well on 1h chart when using Pinescript v1, but not on v5

Any comment on this would be very helpful, thanks again for your work
UnknownUnicorn40403838
fantastic thanks alot
nrrd4life
How can I find if the Candle is green and bullish? is that possible with this? I want to be able to get my buy signal and then if the candle is green and bullish then go in for my trade?
allanster
@nrrd4life, on indicator type scripts the closing price updates (repaints) in realtime until the final close, so to ensure the candle is truly green would require validation after close. To determine if previous HA close is green in this script the following code (placed after the preEvalX variables are defined) would return a true or false result:

wasGreen = preEvalC⦋1⦌ > preEvalO⦋1⦌

^ Notice, bracket characters are not currently achievable in comments so this code example cannot be copied and pasted. You would need to replace the pseudo bracket characters I used in example with proper bracket characters after pasting.
dadebonu90
Thank you this is great!! Sorry for the noob question :) How Can I study the last 2 candles to identify a changing trend?
allanster
@dadebonu90, you have not specified which bar element you wish to compare. For example if you wanted to compare the repainting open price from current to previous bar you could use:
isRising = rising(OrpY,1)
ICEKI
Thank You so much allanster for your great work, appreciated your generous shared for us <3
allanster
@ICEKI, thank you for your appreciation!
NicoleLomazowLowe
Well done sir
allanster
@NicoleLomazowLowe, thank you for your comment!
المزيد