NexusFi: Find Your Edge


Home Menu

 





Mixing Renko with HA candles


Discussion in EasyLanguage Programming

Updated
    1. trending_up 4,196 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread

Mixing Renko with HA candles

  #1 (permalink)
bakaroni
San Francisco, CA
 
Posts: 7 since Jan 2022
Thanks Given: 0
Thanks Received: 0

I know that on a chart you can't have two data sources with one being Renko and the other being a time-based bar like HA candles. But is there a workaround to it? Or has anyone synthetically created virtual renko candles in code from HA candles using ticks?

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Exit Strategy
NinjaTrader
ZombieSqueeze
Platforms and Indicators
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
 
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

bakaroni,

while creating virtual bars might be the most complex work around, it is likely the one giving you the most flexibility, too. You would for example be able to backtest strategies more accurately since your code could utilize Look-Inside-Bar-Backtesting when applied to tick or time based bars.
Another idea that comes to mind would be using a PriceSeries Provider for providing the time based data that you would use to compute the Heikin Ashi values from.

Regards,

ABCTG


bakaroni View Post
I know that on a chart you can't have two data sources with one being Renko and the other being a time-based bar like HA candles. But is there a workaround to it? Or has anyone synthetically created virtual renko candles in code from HA candles using ticks?


Follow me on Twitter Reply With Quote
  #3 (permalink)
bakaroni
San Francisco, CA
 
Posts: 7 since Jan 2022
Thanks Given: 0
Thanks Received: 0



ABCTG View Post
bakaroni,

while creating virtual bars might be the most complex work around, it is likely the one giving you the most flexibility, too. You would for example be able to backtest strategies more accurately since your code could utilize Look-Inside-Bar-Backtesting when applied to tick or time based bars.
Another idea that comes to mind would be using a PriceSeries Provider for providing the time based data that you would use to compute the Heikin Ashi values from.

Regards,

ABCTG

Thanks for your response. Yes, backtesting with Renko is utterly useless in my experience. The disparity between the backtest and reality is night and day.

Now I have a very basic question: strategy code gets called by TS when a bar closes or a tick is received. But how does one store data across these invocations? For example, I want to be able to store the number of ticks over a period of time, etc.

Reply With Quote
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

bakaroni,

I am not sure I correctly understand your question. In general, you would for example use a variable to store values within your code. How often your variable can be updated throughout the bar depends if you declared it as intrabarpersist or not.

Regards,

ABCTG


bakaroni View Post
Thanks for your response. Yes, backtesting with Renko is utterly useless in my experience. The disparity between the backtest and reality is night and day.

Now I have a very basic question: strategy code gets called by TS when a bar closes or a tick is received. But how does one store data across these invocations? For example, I want to be able to store the number of ticks over a period of time, etc.


Follow me on Twitter Reply With Quote
  #5 (permalink)
bakaroni
San Francisco, CA
 
Posts: 7 since Jan 2022
Thanks Given: 0
Thanks Received: 0


ABCTG View Post
bakaroni,

I am not sure I correctly understand your question. In general, you would for example use a variable to store values within your code. How often your variable can be updated throughout the bar depends if you declared it as intrabarpersist or not.

Regards,

ABCTG

I meant that I would like to calculate the value of a variable at the close of one bar and make it available to me in another bar. For example to synthetically construct either a Renko or HA candle from the other you'd need data to persist across bars.

Reply With Quote
  #6 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

bakaroni,

in TS variables are tied to the datastream. When it comes to computing virtual bars within your code you can have more than one virtual bar per chart bar. In this case referencing values for previous bar will become problematic when using variables and other approaches like using a vector for example are more suitable.

Regards,

ABCTG


bakaroni View Post
I meant that I would like to calculate the value of a variable at the close of one bar and make it available to me in another bar. For example to synthetically construct either a Renko or HA candle from the other you'd need data to persist across bars.


Follow me on Twitter Reply With Quote




Last Updated on February 21, 2022


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts