Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
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?
Can you help answer these questions from other members on NexusFi?
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.
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.
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.
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.
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.