Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy and Indicators synchro on Historical data

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

    Strategy and Indicators synchro on Historical data

    I'm developing a strategy system with an logical graphic editor and i'm facing to a problem when i'm want test a strategy on historical data:

    All historical bar data are processed on strategy before indicators, so i'm can't use plot or custom dataserie on my indicators for my strategy on historical.

    How i'm can insure all indicators have processed it's own historical bar before the strategy ?

    Of course i'm don't have these sync problem on market replay or realtime, but sometime i'm facing sync problem when a first tick of new bar arrived, some indicators have processed this tick before the strategy, some other don't.

    In my system, the strategy init and add on graph all indictor it use by calling the generated methode for have a indicator instance like:

    public partial class Strategy : StrategyBase
    {
    /// <summary>
    /// Enter the description of your new custom indicator here
    /// </summary>
    /// <returns></returns>
    [Gui.Design.WizardCondition("Indicator")]
    public Indicator._MyIndicator _MyIndicator(int boxSizeChart, string indicatorName, ....)
    {
    return _indicator._MyIndicator(.....);
    }
    Last edited by Twanaar; 06-14-2016, 04:57 PM.

    #2
    Hello Twanaar,

    Thank you for your post.

    You can force the update of indicator using Update(): http://ninjatrader.com/support/helpG...nt7/update.htm

    For example, in the Strategy code:
    Code:
    MyIndicator().Update();
    You will notice it will load the data with the Strategy that called it rather than loading the historical data for the strategy alone and then the indicator.

    Comment


      #3
      Hello Patrick,

      I'm miss this Update() méthode

      That fix totaly fix my synchro problems, big thanks !

      For records, i'm dev a graphical state machine editor (in java, external code, communicate with web-socket with my code in NinjaTrader.Custom.dll), who generate script text file for my HCMS (Hierarchical concurency state machine) who send orders to my strategy ninja trader code.
      All of that use specific indicators.

      i'm planed to port that on NinjaTradre 8 when the dev are finished.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by mdsvtr, 11-18-2013, 05:56 PM
      9 responses
      3,352 views
      0 likes
      Last Post davidl93  
      Started by reynoldsn, Today, 01:26 PM
      0 responses
      5 views
      0 likes
      Last Post reynoldsn  
      Started by willthebill, 02-06-2025, 11:02 AM
      2 responses
      11 views
      0 likes
      Last Post willthebill  
      Started by dwrety, Today, 10:31 AM
      1 response
      11 views
      0 likes
      Last Post dwrety
      by dwrety
       
      Started by apgapg2, Today, 10:04 AM
      0 responses
      16 views
      0 likes
      Last Post apgapg2
      by apgapg2
       
      Working...
      X