Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

simple order management logic problem

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

    simple order management logic problem

    i have a very simple sytem i am trying to creat into a strategy:

    enter long when: 20 period ma crosses above 100 period ma
    exit long when: 20 period ma crosses below 50 period ma

    enter short when: 20 period ma crosses below 100 period ma
    exit short when: 20 period ma crosses above 50 period ma

    when i enter this strategy in the strategy wizard it will enter the position correctly on the "EnterLong" command, however on the "ExitLong" command it will exit the existing position ma but if the 20 period crosses below the 50 period ma again it will ENTER SHORT, this is not correct, i want it to wait again until an entry based on rules above, and only close if there is an active position open.

    please help, thank you.

    #2
    Then you should add a condition that checks if the strategy position is flat as part of the condition for entry.
    RayNinjaTrader Customer Service

    Comment


      #3
      i dont understand

      thank you for your quick reply ninjatrader ray, unfortunately i dont understand exactly how to do this, this is my first attempt at creating a simple strategy and i the way i input the strategy so far was exactly as i outlined it in my initial post

      Comment


        #4
        Maybe this link will help -

        RayNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

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