Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Monday or Tues controlls INITIALIZE

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

    Monday or Tues controlls INITIALIZE

    Does anyone know a way to get the all the adds, Plots, ExitOnClose, BarsRequired, SetProfitTarget...etc stuff you would normally put within initialize under the control for example.... if(Time[0].DayOfWeek == DayOfWeek.Monday)

    so that on Mondays you could have a strategy running based on one customized set of adds inside of initialize and on Tuesday have a totally different set of adds?

    Maybe this is possible using OnStartUp() somehow?

    My goal is to be able to put at least 2 strategies within one algo system that have conflicting settings inside of initialize. but if I can get the conflicting settings to run separately each on a different day so that they will not conflict.

    Any advice is appreciated

    Thanks Quantismo..

    #2
    Hello Quantismo,

    Thank you for your note.

    You would not be able to test for the Time[0] as this has not been built yet on the chart when applying the indicator.

    You can use DateTime.Now.DayOfWeek to compare, however I was not able to resolve this into plugging in the correct values that I wanted for the Initialize() and don't believe there is a workaround.

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Thanks for checking

      Yeah I didn't think there was any work around for this but thanks for replying.


      Quantismo

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      40 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      20 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      26 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      44 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      37 views
      0 likes
      Last Post CarlTrading  
      Working...
      X