Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Check for Nth candle on intraday chart

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

    Check for Nth candle on intraday chart

    Hi,

    I had a couple of questions.
    I am using 15min intraday chart. How do I code for following for my 15M chart:

    1. Check for todays first candle and very first tick:
    This is required so that I can reset and initialize some variables. This should be independent of my sesion since I am concerned about only days first candle here.

    2. Check for close of todays second candle or start of third candle:
    This is required because I want to process some data on close of second candle

    3. Check for todays Nth candle has begun on intraday chart??

    How do I code for this? I have CalculateOnBarClose = false; and i need this as I want
    to process each tick. Also, I am read about FirstTickOfBar but I could not figure out how it can help me here.


    Please help

    Thank You
    Last edited by bhongya; 10-03-2012, 12:48 AM. Reason: added more info

    #2
    bhongya, welcome to our forums - for the session start / reset you can refer to FirstBarOfSession - http://www.ninjatrader.com/support/h...rofsession.htm

    The session bars would be counted then by your BarsSinceSession property - http://www.ninjatrader.com/support/h...ncesession.htm

    As an alternative you could also run your own counter in each OnBarUpdate() call for FirstTickOfBar (doing this in FirstTickOfBar would ensure you're counting on bar close events only and not all intrabar tick updates you would get normally with CalculateOnBarClose = false).
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Great! Thanks. Just couple of questions more...
      1. If on a Chart, I click "Reload Historical Data" option, will the FirstBarOfSession event be trigerred for each bar that will be reloaded or just for the latest tick that is received??? I can try this myself, but markets will be live tomorrow as I am from Asia and want to check the behavior of reload on a live chart so that I can code accordingly.

      2. Is there a technical difference if I attach a strategy to a open chart OR if i use the Strategies tab on main window and add a new strategy by specifying the instrument and the strategy name in it?

      3. How do I do a "Reload Historical Data" operation on a instrument in strategies tab of main window? Will that reload the strategy as well ?

      Comment


        #4
        You're welcome.

        FirstBarOfSession will trigger historically without any further checks if it's running on realtime or historical data (using the Historical property) - http://www.ninjatrader.com/support/h...historical.htm

        For the Strategies tab it's important to remember that no signals / trades would be visualized then on any charts, it's merely a resource friendly option to run strategies for execution - for getting starting and potentially debugging signals, it's not ideal.

        You would need to disable / re-enable the strategy - on the chart you would see the same effect, so the strategy is restarted as well if you reload historical data.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Karado58, 11-26-2012, 02:57 PM
        8 responses
        14,828 views
        0 likes
        Last Post Option Whisperer  
        Started by Option Whisperer, Today, 09:05 AM
        0 responses
        1 view
        0 likes
        Last Post Option Whisperer  
        Started by cre8able, Yesterday, 01:16 PM
        3 responses
        11 views
        0 likes
        Last Post cre8able  
        Started by Harry, 05-02-2018, 01:54 PM
        10 responses
        3,204 views
        0 likes
        Last Post tharton3  
        Started by ChartTourist, Today, 08:22 AM
        0 responses
        6 views
        0 likes
        Last Post ChartTourist  
        Working...
        X