Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom Strategy Script

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

    Custom Strategy Script

    Hi there,

    I am trying to write a custom script for strategy.

    I am writing custom code in OnBarUpdate event, now I am not sure which date data I will receive on first time this event is occured.

    For example, if below options I select:

    Lookback = 30
    Type = "Day"
    From = "3/31/2010"
    To = "6/15/2011"
    Min. bars required = 30

    Then I receive data for date "7/14/2010" first time OnBarUpdate event occurs, Now I want to know why its picking this date and what is the logic behind this all. So I can write my custom logic accordingly.

    Thanks
    Nitin

    #2
    Hi Nitin,

    Thanks for the post and welcome to the NinjaTrader forums.

    You'll receive updates for the first bar after the minimum bars required setting is satisfied. You should first use a chart to visualize how much data is available for the instrument, interval, and connection you're using. Historical data availability is determined by the data provider, so looking at a chart is first step in seeing what the script has to work with. If you're backtesting this in the strategy analyzer screen, use the Chart tab to see this.
    Last edited by NinjaTrader_RyanM1; 07-08-2011, 08:53 AM.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hi Ryan,

      I really appreciate the quick response.

      I checked in chart and I am having data from 6/3/2010, now could you please let me know why I am getting first updates as 7/14/2010 when I have lookback as 30 days and min. bar required as 30 ?

      Thanks
      Nitin

      Comment


        #4
        That seems about right. It's minimum bars required, not days. Count the number of bars from 6/ 3 to 7 / 14 and should be 30.
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by zstheorist, Today, 07:52 PM
        0 responses
        3 views
        0 likes
        Last Post zstheorist  
        Started by pmachiraju, 11-01-2023, 04:46 AM
        8 responses
        149 views
        0 likes
        Last Post rehmans
        by rehmans
         
        Started by mattbsea, Today, 05:44 PM
        0 responses
        5 views
        0 likes
        Last Post mattbsea  
        Started by RideMe, 04-07-2024, 04:54 PM
        6 responses
        33 views
        0 likes
        Last Post RideMe
        by RideMe
         
        Started by tkaboris, Today, 05:13 PM
        0 responses
        5 views
        0 likes
        Last Post tkaboris  
        Working...
        X