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)
Is there anyway to make CurrentBar = something else?
So when calculate bar on close is set to true, the second to last bar (Close[1]) is CurrentBar right?
And when calculate on bar close is set to false, the Close[0] is CurrentBar right?
Now is there anyway to make CurrentBar = another bar? meaning I could effectively call Close[3] as CurrentBar.
Is this possible.
In other words, can I make an indicator disregard the the last x number of bars, and start calculating currentbar from x candle,
Effectively what I want to do is shift the logic from close[0] to be close[3] (meaning currentbar has shifted 3) and also everything that follows, so close[1] effectively means close[4] if I have candle logic.
Can you help answer these questions from other members on NexusFi?
Currentbar is automatically set by the platform when a new bar is added to the series.
You need to create your own variable, which you can call 'offset'.
you then assign this variable with a positive or negative value, whatever you like the offset to be
and when you refer to a bar, you add/substract this from your index.
I understand you can do this, I'm currently trying to figure:
the MAX function will start looking for the Max value of a given period. High, 10)[0]
This is will start at High[0] and look 10 bars back for the highest high.
and the HighestBar will give me the bar integer that produced that High.
However, if I use the Max function with high, 10)[5]
It will start at High[5] and look 10 bars from that point.
Now, how do I get the bar integer for that?
HighestBar only starts indexing from the currentbar, which is [0]
I can easily attain the value from the HighestBar int.
So I eliminated using the MAX function, so changing the CurrentBar would be ideal,
and not have to use the MAX function.
sorry in advance if this already exists within this forum, but at least I can't find it and that's why I'm posting this as a new thread . . . . . . . . . . . . . . Here's the Q:
How would I accomplish the below in NinjaScript . . . . …