Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Buying Condition Day of Week

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

    Buying Condition Day of Week

    Hello
    I try to test a simple strategy: buying on Monday at market open, but only when before that Monday the Friday close was higher than the Friday open. I used the strategy builder and clicked me through to the point "Conditions and Actions". There I built the following sets of conditions:
    If (Times[0][0].DayOfWeek == DayOfWeek.Friday) and Default input [0] > Open[0]
    then EnterLong(DefaultQuantity,"");

    If (Times[0][0].DayOfWeek == DayOfWeek.Monday), then ExitLong(DefaultQuantity,"");

    But when I test the strategy with the strategy analyzer, the entry time is always Friday (15:32), the exit time Friday (22:00). What am I doing wrong? How must I change the strategy input to buy Monday at market open and sell at Monday's close?

    Best regards
    Value57

    #2
    Hello value57,

    Your condition says to EnterLong is the DayOfWeek is Friday. Do you have the actions switched around for the conditions. Do you mean to be exiting on friday and entering on monday?

    You can use the PriorDayOHLC indicator if you want to get the PriorClose and PriorOpen for the previous session.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Dear Chelsea
      Thank you very much for your help. I didn't knew the PriorDayOHLC indicator. But with that I managed to build my strategy :-) Best regards.

      Comment

      Latest Posts

      Collapse

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