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)
How to access the previous value of an indicator? (MC.NET)
Say i am on the 2nd bar of the daily series, I want to access the variable of trueRange of first bar so that I can calculate the average of two days. How can I do this?
Is it possible to store the indicator value of current bar into a array so that I have a series of values that I can read anytime? Cheers.
Can you help answer these questions from other members on NexusFi?
Thanks for the swirl response. Let's say I follow this to set the value into the array
How can I read the value of previous bar from the from the VariableSeries? I can't find a good example to show me this...Appreciated if you can shed some light!
Broker: NT Brokerage, Kinetick, IQFeed, Interactive Brokers
Trading: ES
Posts: 159 since Dec 2014
Thanks Given: 40
Thanks Received: 166
I have noticed that if I try to go pretty far back in the data series, I need to use Bars.FullSymbolData.Close[x]. I'm less than 1 week on MC so I'm not exactly sure why this is. I think it may have something to do with maximum number of bars (ExecInfo.MaxBarsBack) an indicator can see by default.
you are correct. By default the first bar on the chart for a study is the first bar after the maximum number of bars you set for your study to reference. This is done in order to ensure all values are probably computed.
Broker: NT Brokerage, Kinetick, IQFeed, Interactive Brokers
Trading: ES
Posts: 159 since Dec 2014
Thanks Given: 40
Thanks Received: 166
@ABCTG
Just to clarify, if MaxBarsBack = 300, then Bars.Close[0] is still the current bar but it's the same as Bars.FullSymbolData.Close[299] in terms of all bars on the chart? That would mean the the far right bar is always MaxBarsBack...
bar 0 will always be the current bar. Bars.Close[1] and Bars.FullSymbolData.Close[1] both return the bar to the left of the current bar. The only difference is that Bars.Close[x] is limited by the Max bars back setting and Bars.FullSymbolData is not.