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!
See more
See less

Partner 728x90

Collapse

Indicator Logic

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • koganam
    replied
    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,
    Send me a note from the website, or a PM. I will email you a Trial.

    Leave a comment:


  • MillenniumTrader
    replied
    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,
    Attached Files

    Leave a comment:


  • koganam
    replied
    Originally posted by MillenniumTrader View Post
    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
    That is fairly obviously the "Hidden Gaps" setup. Well, there is good news and there is not so good news. It can obviously be coded because we have already coded it. That is the good news. The not so good news is that we are a commercial outfit who are selling that indicator, so I cannot give you the source code.

    Is this not what you are talking about?
    Attached Files

    Leave a comment:


  • futurestrack
    replied
    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:


  • MillenniumTrader
    replied
    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
    Attached Files

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    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:


  • futurestrack
    replied
    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:


  • koganam
    replied
    Originally posted by MillenniumTrader View Post
    Thanks for your response, Is there any special setting for this behavior or it has to be custom coded
    What special behavior?

    Leave a comment:


  • MillenniumTrader
    replied
    Thanks for your response, Is there any special setting for this behavior or it has to be custom coded

    Leave a comment:


  • koganam
    replied
    Originally posted by MillenniumTrader View Post
    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??

    Thanks
    Not unless you ask it to. It will simply run through the code block sequentially once for each barUpdate.

    Leave a comment:


  • MillenniumTrader
    started a topic Indicator Logic

    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??

    Thanks

Latest Posts

Collapse

Topics Statistics Last Post
Started by usazencort, Today, 01:16 AM
0 responses
1 view
0 likes
Last Post usazencort  
Started by kaywai, 09-01-2023, 08:44 PM
5 responses
603 views
0 likes
Last Post NinjaTrader_Jason  
Started by xiinteractive, 04-09-2024, 08:08 AM
6 responses
22 views
0 likes
Last Post xiinteractive  
Started by Pattontje, Yesterday, 02:10 PM
2 responses
21 views
0 likes
Last Post Pattontje  
Started by flybuzz, 04-21-2024, 04:07 PM
17 responses
230 views
0 likes
Last Post TradingLoss  
Working...
X