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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      90 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      137 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      120 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      71 views
      0 likes
      Last Post PaulMohn  
      Working...
      X