Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategies started from a chart don't perform as expected

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

    Strategies started from a chart don't perform as expected

    Hi people,

    Please, could you help me clarifying what is expected from NT on the following scenario?

    I have a strategy that does what I want to (on backtesting, optimization and even on charts with hystorical data).

    For first time, yesterday I put it to work for real (Live) from a Chart (not from the main screen).

    What I got is:
    - The bars on the chart were updated as the price evolved.
    - However, at some point I saw that the algorithm should have entered a long position one hour before, but it hadn't.
    - I reloaded the stragegy by hitting F5, and then yes... NT displayed the trade that my strategy was supposed to have launched.

    Then my question is:
    How is it that the order wasn't processed/handled while on Live?

    Is it possible that, if you start a strategy from a Chart (15 days back), NT considers that the data feed has started at the moment you launched the strategy, instead of at 00:00:00 15 days ago?
    This would produce different bars and explain somehow why the trade wasn't entered.

    Thank you!
    Last edited by jpcmann; 05-26-2010, 09:32 AM.

    #2
    Hello jpcmann,

    Welcome to the NinjaTrader forums!

    The strategy will run against available historical data prior to starting it. This could result in a strategy position that is different than your account position. If this is the case, orders are placed according to settings found under Tools > Options > Strategies > NinjaScript tab.

    If you want to run a strategy only on live data, you can do so by adding
    if (Historical)
    return;

    Add the above lines to OnBarUpdate() method.

    You can review this page on discrepencies between running a strategy live versus a backtest for potential reasons why results can be different.

    A good approach to figuring out strategy order submission issues is with TraceOrders output. You can view output through Tools > Output window.

    You can also consider additional actions to take when conditions are true besides place orders. You can be alerted through drawing objects.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hi RyanM,

      Thanks for your comments!
      I understand what you explain, but the problem is slightly different.

      The thing is that strategies perform trades over historical data (backtesting, past data of a chart, etc.), but perform none at all over the live data.

      It didn't work on strategies started from a Chart, so today I tried starting it from the Control Center, and the same: Two trades that should have been performed, were not.
      I only saw them after I reloaded the strategy, but then everything was being run over (now) hystorical data.

      The "if condition" you proposed at the beggining may not affect at all, because I've been trying with the simulated data feed with no previous data, and I got the same result. Trades were missed on live, but performed over historical.

      I attach two screenshots.
      One with the strategy running live on a chart (with the simulated data feed), and the other one right after hitting "F5".

      Any clue on what can be provoking that situation?
      I'm using NT 6.5, so I assume that if such an issue hasn't been reported before on a stable version like this one, that should be a matter of my setup (I didn't change almost anything, though).

      Thank you!
      Attached Files
      Last edited by jpcmann; 05-27-2010, 03:01 PM. Reason: typo

      Comment


        #4
        Maybe try adjusting the Minimum Bars required setting since you're starting it with no historical data. You can set this to 0.

        What has TraceOrders output shown while running the stategy?
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Hi RyanM,

          It is not a matter of minbars required, even if I wait for them to pass, the same happens. And even if I set the value to zero, still the same.

          I tried what you mention, and in a place an order should have been issued... I restarted the strategy and I got that in the output Window:


          29/05/2010 16:34:58 CancelAllOrders: BarsInProgress=0
          29/05/2010 16:34:07 Entered internal PlaceOrder() method at 29/05/2010 16:34:07: Action=SellShort OrderType=Limit Quantity=1 LimitPrice=1247,75 StopPrice=0 SignalName='FTD1_SELL' FromEntrySignal=''
          29/05/2010 16:34:07 Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='FTD1_SELL' Mode=Ticks Value=25 Currency=0 Simulated=False
          29/05/2010 16:34:07 Entered internal SetStopTarget() method: Type=Target FromEntrySignal='FTD1_SELL' Mode=Ticks Value=6 Currency=0 Simulated=False
          ************
          >> ALGORITHM SHOULD BE SELLING
          ************
          29/05/2010 16:34:18 Cancelled expired order: BarsInProgress=0: Order='NT-00000/Sim101' Name='FTD1_SELL' State=Working Instrument='ES 06-10' Action=SellShort Limit price=1247,75 Stop price=0 Quantity=1 Strategy='DiagFracTrader1' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='77e48e63a88a4601ab4e20dc9a38e59f' Gtd='01/12/2099 00:00:00'


          So almost one minute after the missed trade, I reload, and then the output window prints the info of the trade that was supposed to be launched before.

          Is this normal?
          Thank you!

          Comment


            #6
            jpcmann, are you running a MultiSeries strategy here so orders would expire to quick without the chance of getting filled? Does it change anything if you enter via market orders (just for debugging purposes)?
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by andrewtrades, Today, 04:57 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by chbruno, Today, 04:10 PM
            0 responses
            5 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Started by josh18955, 03-25-2023, 11:16 AM
            6 responses
            436 views
            0 likes
            Last Post Delerium  
            Started by FAQtrader, Today, 03:35 PM
            0 responses
            7 views
            0 likes
            Last Post FAQtrader  
            Started by rocketman7, Today, 09:41 AM
            5 responses
            19 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X