Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Entry order quantity.

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

    Entry order quantity.

    Hello.
    How to change entry order quantity?? It have to be int not double.
    I would like to change quantity depend of last trade was profitable or not.
    Czarek.

    #2
    Hello Czarek,

    All the Enter() methods will have overloads that allow you to specify quantity. For the strategy to use these quantities you set order quantity by strategy.

    If you would like to change quantity based on performance of last trade, you can work with TradePerformance class for this.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hi.
      Everywhere is :
      EnterLong(int quantity)
      quantity must me int. How to change int value by strategy??
      Can I use double?
      Czarek.

      Comment


        #4
        Yes, the quantity must be integer. In C#, you can cast a value as another data type like this:

        EnterLong((int) myDouble);

        You can Set Order Quantity by strategy as an option available when you run the strategy. Please see the following link > Understanding strategy properties

        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by cmoran13, Yesterday, 01:02 PM
        0 responses
        27 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        18 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        160 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        95 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        148 views
        2 likes
        Last Post CaptainJack  
        Working...
        X