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

Historical Candle Formation

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

    Historical Candle Formation

    Hi,

    I have an indicator that needs to know how the candle forms. In real time this is not an issue.

    This currently works in real time however when plotting historical markers if the candle is an outside candle the indicator needs to know whether the high or low formed first.
    I can do this by adding an additional dataseries on a faster time frame however this seems inefficient as once the historical data has been processed there is no need to keep passing the faster time sereis to OnBarUpdate.

    Also using a faster timeseries can still have a problem if the high and low was formed in one candle ie as in a news announcement..

    Any suggestions would be appreciated.

    #2
    Hi cp.trader, thanks for writing in. You can either use Tick Replay or add a 1 tick series to do this. Adding a 1 tick series would be the most efficient way to do this. I attached an example for reference.

    Kind regards,
    -ChrisL
    Attached Files
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thankyou for your response. If this indicator was added to a number of larger charts such as the daily it would be very intensive also the tick data will not be stored for 365 days etc. Is it possible to determine an outside bar formation any other way?
      Also when looking through the code I can't see what is used to determine the start and end of the candle being worked on. ie if this indicator was on a 5 minute chart how does it tell the start and end of the candle when using the tick data

      Comment


        #4
        Hi cp.trader, tick replay or a 1 tick series is the only way to replay the formation of bars in historical mode. Without this, all the system has is the OHLC of the bar. I attached a better example on how one would use a 1 tick series to do this. It generates Minute bars from tick data, so it builds minute bars and partitions them correctly. It demonstrates the logic needed to detect the start of each new bar.

        Kind regards,
        -ChrisL
        Attached Files
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Brevo, Today, 01:45 AM
        0 responses
        6 views
        0 likes
        Last Post Brevo
        by Brevo
         
        Started by aussugardefender, Today, 01:07 AM
        0 responses
        3 views
        0 likes
        Last Post aussugardefender  
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        242 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        9 responses
        384 views
        1 like
        Last Post Gavini
        by Gavini
         
        Started by oviejo, Today, 12:28 AM
        0 responses
        6 views
        0 likes
        Last Post oviejo
        by oviejo
         
        Working...
        X