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
Indicator Logic
Collapse
X
-
Originally posted by MillenniumTrader View Post
-
Hello Koganam, yes it is exactly what I am trying to accomplish here. I didn't know that you have it coded already. By the way, I checked your website but I didn't see it there. Can you provide the link? I cant tell you that I will buy it because I have coded the main indicator logic with the help of many here (and without coding experience) so I will try to completed if I can. As you can see in the picture, the only missing part is stopping the rectangles. Anyways, I am really grateful for your help and others people too. the advice is not only good for this indicator but for others too.I will try to work with arrays and with the IdrawObject to see what I get.
Regards,
Leave a comment:
-
Originally posted by MillenniumTrader View PostThanks for the great support, see the attached file for more explanation. The indicator is already painting the rectangles in my chart but they dont stop when price trespass thru them in the future. I don't know if I should use "DrawLine()" , "DrawRegion()" or "DrawExtendLine()" for this specific application. The problem is that the indicator will have to go back and check if previous rectangles have been COMPLETELY cut by price. See attached picture.
Regards
Is this not what you are talking about?
Leave a comment:
-
I would think you could on each bar:
For each of the existing rectangles
See if the price has been both below and above the rectangle since its left edge bar.
If so then set the rectangle right edge coordinates as the current bar position.
I think you can define some global variable arrays to keep track of all this.
Clearly it's not an easy problem, but it can be done. (Ask yourself if it's really worth it)
Hope this helps.
futurestrack
Leave a comment:
-
Thanks for the great support, see the attached file for more explanation. The indicator is already painting the rectangles in my chart but they dont stop when price trespass thru them in the future. I don't know if I should use "DrawLine()" , "DrawRegion()" or "DrawExtendLine()" for this specific application. The problem is that the indicator will have to go back and check if previous rectangles have been COMPLETELY cut by price. See attached picture.
Regards
Leave a comment:
-
Hello MillenniumTrader,
Thank you for your post.
Koganam is correct, OnBarUpdate() would process bar by bar from oldest to newest. If you want to look back over a period of time you would generally use a period to do so. A period such as the one used for the SMA sets the number of bars used for the calculation.
And like futurestrack mentioned, if you can provide an example of what you wish to do we can provide more details.
Leave a comment:
-
Millennium,
Can you tell us why you need this, perhaps by giving an example? The program does keep track of the data on prior bars in order to make calculations on the current bar.
futurestrack
Leave a comment:
-
Thanks for your response, Is there any special setting for this behavior or it has to be custom coded
Leave a comment:
-
Originally posted by MillenniumTrader View PostHello,
This question is about an indicator Logic. I am new to programming. My question is, when you create an indicator and the OnBarUpdate() is executed bar after bar, does the code goes back again to the first candle to recalculate everything from the beginning on every new bar??
Thanks
Leave a comment:
-
Indicator Logic
Hello,
This question is about an indicator Logic. I am new to programming. My question is, when you create an indicator and the OnBarUpdate() is executed bar after bar, does the code goes back again to the first candle to recalculate everything from the beginning on every new bar??
ThanksTags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by usazencort, Today, 01:16 AM
|
0 responses
1 view
0 likes
|
Last Post
by usazencort
Today, 01:16 AM
|
||
Started by kaywai, 09-01-2023, 08:44 PM
|
5 responses
603 views
0 likes
|
Last Post Today, 12:32 AM | ||
Started by xiinteractive, 04-09-2024, 08:08 AM
|
6 responses
22 views
0 likes
|
Last Post Today, 12:31 AM | ||
Started by Pattontje, Yesterday, 02:10 PM
|
2 responses
21 views
0 likes
|
Last Post
by Pattontje
Yesterday, 11:49 PM
|
||
Started by flybuzz, 04-21-2024, 04:07 PM
|
17 responses
230 views
0 likes
|
Last Post
by TradingLoss
Yesterday, 11:45 PM
|
Leave a comment: