Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Days2Load in Initialize()

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

    Days2Load in Initialize()

    This might not be supported but I have to ask;

    I have a Strategy that I don't need or want to load any historical data for the instrument it is applied to. In the "New Strategy" dialog you call up in the Strategies tab, there is a "Days to Load" field which changes based on the dataseries you call.

    Using "Days2Load = 0" in Initialize() does not seem to default it to 0 in the Strategy dialog, where as using things such as "Calculate on Bar Close = false" does.

    Is there a way to take advantage of Days2Load or any other built-in method or variable to default to NOT loading any historical data when a particular strat is Enabled?

    Thanks!

    #2
    Hello,

    Thanks for asking.

    You are correct however in that this is not supported as this has to do with the data series that the script cannot modify such as session template is not a supported parameter to set.

    The only supported why to only calculate in realtime with your strategy is

    if(historical)
    return;


    Adding this to OnBarUpdate will tell the script not to run on OnBarUpdate on historical data. I believe you are already aware of this however.


    Another option, You can set the default Days to Load by right clicking on the New Strategy window and selecting set Default for this strategy however, which should do what you need as well but will set the default for setting for the strategy. However this will only work on your PC.




    Let me know if I can be of further assistance.

    Comment


      #3
      Thanks for the prompt reply Brett,

      Strategy Defaults should actually work in this case as there is only one strategy instance per PC. Thanks for reminding me of that.

      Have a good day!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by fx.practic, 10-15-2013, 12:53 AM
      5 responses
      5,404 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Started by Shai Samuel, 07-02-2022, 02:46 PM
      4 responses
      95 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Started by DJ888, Yesterday, 10:57 PM
      0 responses
      8 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by MacDad, 02-25-2024, 11:48 PM
      7 responses
      159 views
      0 likes
      Last Post loganjarosz123  
      Started by Belfortbucks, Yesterday, 09:29 PM
      0 responses
      8 views
      0 likes
      Last Post Belfortbucks  
      Working...
      X