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

Highlight a bar in timeframe A when event occurs in timeframe B

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

    Highlight a bar in timeframe A when event occurs in timeframe B

    Hi There, I am developing an indicator that identifies an event in a 400-minute timeframe. I'm looking for a candle with a really big wick (upper or lower). After that candle occurs, I want that that event to be apparent on a 15-minute chart. If I load a 400-minute chart, and look for this event in a 400-minute chart, it works. When I switch to a 15-minute chart, those events no longer appear.

    My current thinking...
    I think I'm making an error somewhere in the neighborhood of my understanding of BarsInProgress. I currently think my logic for "did the candle occur or not" should reside inside the if (BarsInProgress == 1){} section. That's my 400-minute interval, right?
    Then, the current time interval chart is technically anything that's not in the BarsInProgress == 1 bracketed section, so that is where my BackBrush should live to highlight the chart when this event occurs. However, since my chart isn't doing what I want, that is a fair indicator that I don't' know what I'm doing yet :P

    I'm missing something obviously. Please review my attached .cs file and let me know what you think. Thank you!

    Nathan.
    Attached Files

    #2
    Hello Nate G,

    If you have added a series with AddDataSeries(), yes, that series updates OnBarUpdate() with BarsInProgress 1, while the primary series will be updating OnBarUpdate() with BarsInProgress 0.

    Note, that any bar coloring, drawing objects, or plots would all be done to the primary series (BarsInProgress 0).

    If you want to understand the behavior, print the time of the bar and BarsInProgress and the values being calculated or compared in conditions.


    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by sgordet, Today, 11:48 AM
    0 responses
    1 view
    0 likes
    Last Post sgordet
    by sgordet
     
    Started by Trader146, Today, 11:41 AM
    0 responses
    2 views
    0 likes
    Last Post Trader146  
    Started by jpapa, 04-23-2024, 07:22 AM
    2 responses
    16 views
    0 likes
    Last Post rene69851  
    Started by funk10101, Today, 11:35 AM
    0 responses
    1 view
    0 likes
    Last Post funk10101  
    Started by samish18, Today, 11:26 AM
    0 responses
    1 view
    0 likes
    Last Post samish18  
    Working...
    X