Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy does not start with Daily Timeframe

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

    Strategy does not start with Daily Timeframe

    Hello,
    Please find attached a strategy sample and a screenshot of the parameters and traces
    When I choose "5 days to load" => It starts
    When I choose less days to load => It does not start...
    In the trace or log, no error message, juste "enabling" which is the normal state. It loads data normaly.
    I am pretty sure the problem is the 1 Day time frame but I cannot explain why...
    Would you please try it and tell me why this behavior ?
    Regards
    Nextjob

    NT v7.0034 with Kinetick. Instrument in use US STOCKS YHOO (same issue with other stocks)
    Attached Files

    #2
    I made a simplier test by :
    - removing multitime frame from the strategy
    - Applying it to1 Day timeframe in Strategy parameter tab
    same problem => If less than 5 days to load, it does no start.

    Comment


      #3
      Hello nextjob,

      Thanks for writing in.

      Since the code provided only has code within Initialize(), the strategy wouldn't do anything once enabled. You will need to add code for OnBarUpdate() to have your strategy perform any trading logic.

      I tested your code for Initialize() and I am encountering errors that the symbol does not have a correct mapping. I suggest using Instrument.FullName instead of Instrument.MasterInstrument.Name so the strategy will load the contract month and it can be used for futures contracts as well.

      Once the necessary changes are made, I am not encountering any issue enabling the strategy with the parameters you have listed in your screenshot.

      I have also tested the strategy with AAPL while connected to Yahoo and I did not encounter issues enabling the strategy with the parameters listed in your screen shot.

      Can I confirm, are you testing with that same code or is the sample code just a portion of your strategy?

      Please let me know if I may be of further help.
      JimNinjaTrader Customer Service

      Comment


        #4
        "Since the code provided only has code within Initialize(), the strategy wouldn't do anything once enabled"
        => I know that. When enabled, the strategy line should turn green... It is no the case by my side. What about you ? I simplified my original strategy to avoid sending you my entire code. But I verified that the problem occured in this simplified version.

        "Can I confirm, are you testing with that same code or is the sample code just a portion of your strategy?"
        => Yes I do with the same code.

        "I tested your code for Initialize() and I am encountering errors that the symbol does not have a correct mapping. I suggest using Instrument.FullName instead of Instrument.MasterInstrument.Name so the strategy will load the contract month and it can be used for futures contracts as well."
        => I understand what you mean but it is not relevant in this case. When I increase the nbr days to load, the strategy enables correctly and turn green. The instrument is stocks, there is no end of contract.

        I cannot understand why there is no information in trace or logs to explain that...

        Comment


          #5
          Hello nextjob,

          Thanks for clearing that up.

          It is enabling for me when I have made the change to use Instrument.FullName instead of Instrument.MasterInstrument.Name.

          When I use Instrument.MasterInstrument.Name, the strategy fails on Initialize() and I am seeing errors noted in the NinjaScript Output window instead of the log. Since Instrument.FullName should work with Stocks and Futures and does not error out on Initialize(), I suggest to use this instead.

          You can use the NinjaScript output window to observe any additional errors that you wish to troubleshoot.

          I look forward to being of further assistance.
          JimNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by GussJ, 03-04-2020, 03:11 PM
          11 responses
          3,229 views
          0 likes
          Last Post xiinteractive  
          Started by andrewtrades, Today, 04:57 PM
          1 response
          14 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by chbruno, Today, 04:10 PM
          0 responses
          7 views
          0 likes
          Last Post chbruno
          by chbruno
           
          Started by josh18955, 03-25-2023, 11:16 AM
          6 responses
          441 views
          0 likes
          Last Post Delerium  
          Started by FAQtrader, Today, 03:35 PM
          0 responses
          12 views
          0 likes
          Last Post FAQtrader  
          Working...
          X