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 geddyisodin, 04-25-2024, 05:20 AM
    8 responses
    60 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by jxs_xrj, 01-12-2020, 09:49 AM
    4 responses
    3,287 views
    1 like
    Last Post jgualdronc  
    Started by Option Whisperer, Today, 09:55 AM
    0 responses
    5 views
    0 likes
    Last Post Option Whisperer  
    Started by halgo_boulder, 04-20-2024, 08:44 AM
    2 responses
    22 views
    0 likes
    Last Post halgo_boulder  
    Started by mishhh, 05-25-2010, 08:54 AM
    19 responses
    6,189 views
    0 likes
    Last Post rene69851  
    Working...
    X