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
bool statement
Collapse
X
-
Originally posted by NinjaTrader_CodyB View Post
-
Hello,
Yes you could do this by checking the BarColorSeries property. For example:
Code:if(BarColorSeries == Color.Pink) { //DO Something }
Leave a comment:
-
Originally posted by NinjaTrader_CodyB View PostHello,
Referencing parts of an indicator really depend on how the indicator is set up. There is not a general protocol for this though. It depends on if the indicator has the plots exposed,if the indicator has multiple plots, and how the overload methods are set up for this. I highly recommend that you contact the third party vendor on how you can call this indicator and its overload methods in NinjaTrader. If you would like to learn more on calling indicators in general I'd recommend to take a look at the indicator methods section of the help guide: http://ninjatrader.com/support/helpG...indicators.htm
Thank you.
Leave a comment:
-
Originally posted by imalil View PostPlease don't misunderstand, I'm not asking for an explanation on ThirdPartyIndicator.Test, which is impossible for you to do, I'm asking for an explanation about its type. As Koganam says: "if you can manage to reference it, it is most likely to be a Plot, rather than an IntSeries". I'm asking for a way to research referencing a plot from a 3rd party ind. I know other inds supply such functions, so there must be, generally speaking, a recognized protocol or way to incorporate them in an ind. I simply want to educate myself on how this is done.
Thank you.
Ultimately, to reference anything from an object, that object needs to expose that entity for public access. There are more restrictive access methods, between private and public, that may be used, but public is the level most often used. You will have to read the literature on OOP principles.
Here is one reference: https://www.google.com/search?q=c%23...utf-8&oe=utf-8
Leave a comment:
-
Hello,
Referencing parts of an indicator really depend on how the indicator is set up. There is not a general protocol for this though. It depends on if the indicator has the plots exposed,if the indicator has multiple plots, and how the overload methods are set up for this. I highly recommend that you contact the third party vendor on how you can call this indicator and its overload methods in NinjaTrader. If you would like to learn more on calling indicators in general I'd recommend to take a look at the indicator methods section of the help guide: http://ninjatrader.com/support/helpG...indicators.htm
Leave a comment:
-
Originally posted by NinjaTrader_CodyB View PostHello,
I do not have a link on information on ThirdPartyIndicator.Test as this is a custom method from the third party product. Koganam may be able to elaborate on how he deduced it is double. It is likely that it is a double as most indicator methods return a variable. To get the best information on this you will need to contact the vendor though so they can elaborate on their custom method.
Thank you.
Leave a comment:
-
Originally posted by imalil View PostCan you link me something that explains what something like ThirdParty.Test[0] is? What tells you this is a double? I don't know enough about it to ask a clear question.
Thanks.
Why I know that it is probably a logic error is simply from what CurrentBars[0] portends arithmetically. It is a monotonically increasing value with no real upper limit. Hence, we deduce that it is unlikely that any Plot will manage to reach the upper values of CurrentBars[0], at which time, your filter will always return false. A filter that will get pinned probably is a logic error, as, as soon as it gets pinned, it ceases to be a filter.
Leave a comment:
-
Hello,
I do not have a link on information on ThirdPartyIndicator.Test as this is a custom method from the third party product. Koganam may be able to elaborate on how he deduced it is double. It is likely that it is a double as most indicator methods return a variable. To get the best information on this you will need to contact the vendor though so they can elaborate on their custom method.
Leave a comment:
-
Originally posted by NinjaTrader_CodyB View PostHello,
As Koganam has outlined CurrentBars[0] == ThirdParty.Test[0] is indeed a logic error.
Can you clarify what you are trying to call with CurrentBars[0] as it is likely you need to call something else here.
&&+ is not an operator. Can you clarify what you are trying to call here as well?
I look forward to your reply.
Thanks.
Leave a comment:
-
Hello,
As Koganam has outlined CurrentBars[0] == ThirdParty.Test[0] is indeed a logic error.
Can you clarify what you are trying to call with CurrentBars[0] as it is likely you need to call something else here.
&&+ is not an operator. Can you clarify what you are trying to call here as well?
I look forward to your reply.
Leave a comment:
-
if (CurrentBars[0] == ThirdPartyInd.Test[0] && + imbalance > Buyimbal)
What is in blue simply is a syntax error. What are you even trying to say there?
Leave a comment:
-
There's no doubt it's a syntax or logic problem on my part. The error I get on the IF statement line is CS0119. This is the first time I've tried to use a function from another ind. in my ind.
if (CurrentBars[0] == ThirdPartyInd.Test[0] && + imbalance > Buyimbal)
{ DrawText("imbalance" + CurrentBar, AutoScale, (+ imbalance).ToString(), 0, Low[0], -47,
Color.Pink, ChartControl.Font, StringAlignment.Center, Color.Transparent, Color.Transparent, 0);
DrawText("AvgTradeSize" + CurrentBar, AutoScale, (String.Format("{0:0.0}", avgtradesize)), 0, Low[0], -64,
Color.DodgerBlue, ChartControl.Font, StringAlignment.Center, Color.Transparent, Color.Transparent, 0);}
Leave a comment:
-
Hello,
As Koganam says it would be very useful if we can see what code you are writing exactly so that we can assist further as this is most likely an issue with the syntax.
I do just want to clarify that CurrentBar returns the number of the bar from the first bar being 0 and and each subsequent bar from left to right is incremented by 1.
If you are wanting you get the Volume you would need to use the Volume method. For example if you wanted to check if the Volume of the current bar is greater than 100 you would do the following:
Code:if(VOL()[0] > 100) { //Do Something }
For more information on the Volume method please see the following link: http://ninjatrader.com/support/helpG...oscillator.htm
Leave a comment:
-
Originally posted by imalil View PostI can't print because I keep getting compile errors: CS0119, "not valid in given context". Then when I try to make a variable I get CS1002, 0270, 1519. I'm clearly missing a crucial step.
I'll try to be clearer by giving you a conceptual example since I can't see the code: the 3rd party ind will look at volume. Let's say it gets 100 for the current bar. The ThirdPartyInd.Test[0] function says 'if current bar volume > 50, then paint the bar pink.'
So what I'm trying to do: if the current bar == ThirdPartyInd.Test[0], (meaning "if the current bar has volume > 50"), then my ind will print its results via drawtext.
I realize my logic is way off on this, but I do know many people use these functions to add to their own inds and strategies. That is what I'm trying to do.
Thanks for the help.
Leave a comment:
-
I can't print because I keep getting compile errors: CS0119, "not valid in given context". Then when I try to make a variable I get CS1002, 0270, 1519. I'm clearly missing a crucial step.
I'll try to be clearer by giving you a conceptual example since I can't see the code: the 3rd party ind will look at volume. Let's say it gets 100 for the current bar. The ThirdPartyInd.Test[0] function says 'if current bar volume > 50, then paint the bar pink.'
So what I'm trying to do: if the current bar == ThirdPartyInd.Test[0], (meaning "if the current bar has volume > 50"), then my ind will print its results via drawtext.
I realize my logic is way off on this, but I do know many people use these functions to add to their own inds and strategies. That is what I'm trying to do.
Thanks for the help.
Leave a comment:
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by f.saeidi, Today, 12:14 PM
|
1 response
3 views
0 likes
|
Last Post Today, 12:25 PM | ||
Started by aprilfool, 12-03-2022, 03:01 PM
|
2 responses
326 views
0 likes
|
Last Post Today, 12:23 PM | ||
Started by AnnBarnes, Today, 12:17 PM
|
1 response
2 views
0 likes
|
Last Post Today, 12:22 PM | ||
Started by Lopat, 03-05-2023, 01:19 PM
|
4 responses
168 views
0 likes
|
Last Post
by Sam2515
Today, 12:15 PM
|
||
Started by giulyko00, Today, 12:03 PM
|
1 response
4 views
0 likes
|
Last Post Today, 12:25 PM |
Leave a comment: