Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Take one order per cross over

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

    Take one order per cross over

    Hi,

    Is there any logic that would tell a strategy to only take one trade per Moving Average crossover once specific parameters are met? IE. if there's a cross over(long or short) and all my setup conditions are met, take the trade, and if there's another set of conditions met in the same direction, to not take that trade?

    Cheers,
    Seastragg

    #2
    Hello Seastragg,

    Thank you for your post.

    What is your entries per direction setting for the strategy? You can find this in the strategy parameters. Setting entries per direction to 1 would make it so that the strategy can only have one open trade in the same direction at once (it doesn't matter the quantity of the trade, only that there's only one entry).

    Here's a link to our help guide regarding EntriesPerDirection:


    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Perfect Thanks!
      Last edited by Seastragg; 01-16-2020, 03:22 PM.

      Comment


        #4
        I might have jumped the gun on reading it too fast. If I'm reading it correctly, it will only prevent orders from being taken if you are already IN the market? What I'm looking for is a way to prevent any subsequent entries in a particular direction (regardless if they meet my criteria or not) so that if there is a crossover, it will only take 1 short and aim for a target until it crosses back (even if there are 3 more trades valid in that direction) and then it will only take 1 long once the criteria is met.

        Is there any logic to help with that scenario?

        Comment


          #5
          Hello Seastragg,

          Thank you for your reply.

          Absolutely. You could use a bool that gets set to true when a trade is taken, then reset it to false when a new crossover happens, and add a condition that the bool has to be false in order to place the trade - that'd be the simplest way I can think of.

          I've attached a similar example strategy (it's a Strategy Builder strategy, but if you like you can unlock the code). This should help you get the idea of how this could be set up.

          Please let us know if we may be of further assistance to you.
          Attached Files
          Kate W.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by geddyisodin, Yesterday, 05:20 AM
          7 responses
          45 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by gbourque, Today, 06:39 AM
          2 responses
          5 views
          0 likes
          Last Post gbourque  
          Started by cre8able, Yesterday, 07:24 PM
          1 response
          13 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by cocoescala, 10-12-2018, 11:02 PM
          6 responses
          939 views
          0 likes
          Last Post Jquiroz1975  
          Started by cmtjoancolmenero, Yesterday, 03:58 PM
          1 response
          17 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Working...
          X