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 NullPointStrategies, Today, 05:17 AM
      0 responses
      50 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      126 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      69 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X