Thank you.
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Error Message
Collapse
X
-
Hello Trader17,
Thank you for the post.
You mentioned sample code, I just wanted to clarify did you take this code from a sample somewhere? If so can you provide detail on which sample for context?
The error you have displayed seems to indicate that you have an object named BarDelta in your script but you are trying to use it as a Series when it is not a Series.
Could you provide the whole script as an attachment so I can see the full context of what you are trying to do in the script along with the properties you have defined?
I look forward to being of further assistance.JesseNinjaTrader Customer Service
- Likes 1
-
Hello Trader17,
Thank you for the image that helps.
Can you tell me, what is the overall goal you are trying to achieve or what BarDelta are you trying to access specifically? Is this the Volumetric Bars and its BarDelta?
The variable you are using in the script "BarDelta" does not exist in that context, do you have an indicator named BarDelta imported? If you are trying to reference an indicator you likely need to modify the code like the following:
Code:BarDelta( insert any required parameters)[0] < BarDelta ( ... )[1]
I look forward to being of further assistance.JesseNinjaTrader Customer Service
- Likes 1
Comment
-
No. I am not using any indicator for the Bar Delta value. Just want to take it off the chart generated values on a volumetric chart. I am basically just wanting to compare the Bar Delta of the last 2 bars as a condition for entry. It is the Bar Delta value from Volumetric Bars.
Thank you.
Comment
-
Hello Trader17,
Thank you for clarifying that you want the Volumetric BarDelta.
To access the Volumetric information you would need to use specific syntax for that. We have an example of all available Volumetric properties along with the requirements to use them here: https://ninjatrader.com/support/help...htsub=bardelta
The sample at the bottom shows the correct syntax for the BarDelta property.
If you are using a muli series script please ensure to read the comments in the sample as the sample referes to the Volumetric being the primary series specifically.
Also please take note that the CurrentBar is being used rather than a number of BarsAgo. To use 1 BarsAgo you would need to use CurrentBar -1 and also check that you have at least 1 bar of data if(CurrentBar > 0).
I look forward to being of further assistance.JesseNinjaTrader Customer Service
- Likes 1
Comment
-
Thanks Jesse. So if I want to compare the Bar Delta on the last 2 bars and we are calculating strategy on the close of the bar then is this correct? I will be using volumetric bars on the chart.
(+ barsType.Volumes[0].BarDelta > + barsType.Volumes[1].BarDelta)
Comment
-
Hello Trader17,
No this would not be in line with how the sample is coded. The BarsAgo you have used would be correct for any indicator that uses BarsAgo but this is not an indicator and has specific indexes used instead. I mentioned in the last post that you won't be using a BarsAgo here but you are instead using the CurrentBar.
Here is the example again on how to do 1 BarsAgo when using the CurrentBar:
Code:CurrentBar - 1
Code:if(CurrentBar < 1) return;
Code:Print("Delta for current bar: " + barsType.Volumes[CurrentBar].BarDelta); Print("Delta for prior bar: " + barsType.Volumes[CurrentBar[B] - 1[/B]].BarDelta);
JesseNinjaTrader Customer Service
- Likes 1
Comment
-
Hello Trader17,
Thank you for the reply.
I am not certain I understand the way you worded your reply. The CurrentBar would represent the current processing bars Index which would also be the same as 0 BarsAgo, is this what you are asking?
I look forward to being of further assistance.JesseNinjaTrader Customer Service
- Likes 1
Comment
-
Hello Trader17,
These two values are not the same, but for this purpose, they do represent the same position in processing. This is strictly due to how the volumetric bars are created using an Index for the Volumes object instead of a BarsAgo. The CurrentBar would be the current processing index, this is similar to BarsAgo in the sense that it is the reverse of the BarsAgo.
I look forward to being of further assistance.
JesseNinjaTrader Customer Service
- Likes 1
Comment
-
Originally posted by NinjaTrader_Jesse View PostHello Trader17,
These two values are not the same, but for this purpose, they do represent the same position in processing. This is strictly due to how the volumetric bars are created using an Index for the Volumes object instead of a BarsAgo. The CurrentBar would be the current processing index, this is similar to BarsAgo in the sense that it is the reverse of the BarsAgo.
I look forward to being of further assistance.
1) So as long as I use Voulumetric Bars on the chart the strategy is running I do not need to add an additional data series, correct?
2) And as far as looking for bar lows, highs, opens, other indicators etc. on the same chart, the Bars Ago will work on the same chart along with Current Bar for the Delta logic, correct?
Thank you very much for you help and patience Jesse!!
Comment
-
Hello Trader17,
Correct, if you review the help guide sample it notes that the sample is targeted at being the Primary series and gives notes on how to use it in the case it is not the primary.
For the second question, are you asking if you use this logic, can you still use BarsAgo with other items in your script? If so, then yes the BarsAgo concept still applies toward other indicators and anything that specifically uses a BarsAgo. The Volumetric BarsType is not an indicator so it does not use a BarsAgo but instead uses Indexing. This item is fairly unique in the way it works, really the only other place you use direct indexing would be with OnRender.
I look forward to being of further assistance.JesseNinjaTrader Customer Service
- Likes 1
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by algospoke, 04-17-2024, 06:40 PM
|
6 responses
48 views
0 likes
|
Last Post
by algospoke
Today, 06:18 PM
|
||
Started by arvidvanstaey, Today, 02:19 PM
|
4 responses
11 views
0 likes
|
Last Post Today, 04:08 PM | ||
Started by samish18, 04-17-2024, 08:57 AM
|
16 responses
61 views
0 likes
|
Last Post
by samish18
Today, 03:30 PM
|
||
Started by jordanq2, Today, 03:10 PM
|
2 responses
9 views
0 likes
|
Last Post
by jordanq2
Today, 03:23 PM
|
||
Started by traderqz, Today, 12:06 AM
|
10 responses
19 views
0 likes
|
Last Post
by traderqz
Today, 02:49 PM
|
Comment