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 samish18, 04-17-2024, 08:57 AM
      16 responses
      55 views
      0 likes
      Last Post samish18  
      Started by arvidvanstaey, Today, 02:19 PM
      3 responses
      9 views
      0 likes
      Last Post NinjaTrader_Zachary  
      Started by jordanq2, Today, 03:10 PM
      2 responses
      8 views
      0 likes
      Last Post jordanq2  
      Started by traderqz, Today, 12:06 AM
      10 responses
      18 views
      0 likes
      Last Post traderqz  
      Started by algospoke, 04-17-2024, 06:40 PM
      5 responses
      47 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X