Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EntriesPerDirection used as position limit

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

    EntriesPerDirection used as position limit

    Hi Ninjas,

    I'm coding a very simple procedure for scaling in/out with managed orders. An obvious requirement would be set a limit for maximum opened positions, either Long or Short. Reading about EntriesPerDirection property, it seems to serve as limit for maximum position indirectly, as it depends on the order's quantity. But my doubt is:

    EntriesPerDirection property refers to ONLY the maximum number of orders for one side, Long or Short, independently of its quantity, right ? So, if the order size is set "By the Strategy" , the maximum amount position will be variable as orders might come with different size.

    Is there any other way to set a maximum limit position ?

    #2
    Hello pstrusi,

    EntriesPerDirection property refers to ONLY the maximum number of orders for one side, Long or Short, independently of its quantity, right ?

    Correct.

    Is there any other way to set a maximum limit position ?

    Using the managed position there would be no good way to set a maximum limit position since changing the Strategy Parameters can come into play but you can check the "DefaultQuantity" variable inside of your code and make your strategy "return" if it is over a certain amount so it does not trade.
    JCNinjaTrader Customer Service

    Comment


      #3
      Simple question:

      Imagine that I have a LONG position of 400.000 EURUSD, and the Algo calculates that it has to change to a new SHORT position of 200.000, under managed orders, this would be as simple as to write:

      EnterShort (200000);

      The system by itself will close the LONG of 400.000 and open the SHORT of 200.000, right ?

      Comment


        #4
        Originally posted by pstrusi View Post
        ...

        Is there any other way to set a maximum limit position ?
        Of course. Just check Position.Quantity.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        16 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        120 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        174 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        91 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        134 views
        0 likes
        Last Post cmoran13  
        Working...
        X