Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Change DefaultQuantity

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

    Change DefaultQuantity

    Hello,

    i want to use 1% risk per Trade, but i have the problem that my code doesnt work:

    //Money Management 1%

    //double startingcapital = 10000;
    //int LotSize = (int)(((startingcapital-Performance.AllTrades.Count)*0.01 /(Instrument.MasterInstrument.PointValue * StopLoss)))*100;

    but it isnt the code; if i change the DefaultQuantity in the EnterLongLimit() for example to 10000 and use Quantity by Strategy, the tester always takes the Size 1.

    I just can change it manually in the tester (by DefaultQuantity).

    And the second problem is, that if the size is changed, the profits changes in $, but the % Performance and Drawdown never change. The Risk per Trade is always 0,12% by Ninja Trader.

    What can i do? Help would really be nice..

    best regards

    #2
    Hello FX90903,

    Thank you for your post and welcome to the NinjaTrader Support Forum!

    Use Print() to check the value is correct in the Output window (Tools > Output) and use TraceOrders to track the orders themselves.


    Please let me know if I may be of further assistance.

    Comment


      #3
      Hello,

      thx; The MoneyManagement Code Works finde, but the Quantity isnt changed in the Backtest.
      I use Set Order Quantity by Strategy, but the Quantity is always 1.
      My Trading rules work too, my problem is just the % risk per Trade and the Quantity.

      As i said, if I change the Quantity manually in the backtest, it works, but the % Profit is always the same. A StopLoss Hit is always -0,13%, independent of Quantity 100 or 1.

      Further Information would be great.

      Best regards

      Comment


        #4
        Hello FX90903,

        Thank you for your response.

        Print the LotSize before it is used as the quantity in the order method. Is it correct?

        Comment


          #5
          It works now if i backtest for example the DAX.
          But I trade Forex. I have read about it, that you have to use in Ninja Trader for a Lot 100.000. But if i do so, nothing happens in the Backtest. Always Quantity One. And as i said the % Profit is always the Same.

          Comment


            #6
            Hello FX90903,

            Thank you for your update on this matter.

            Just to clarify your point here, the value printed in the Output is also 1 on Forex when using 100,000?

            Comment


              #7
              I solved it now; i changed the Account Size to 1Mio so that the LimitSize in Forex is no problem.
              Its very complicated to set all right for Forex Backtests if you didnt use Ninja Trader in the past(MT4). The Tutorial isnt a really help for it, but now it works

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Max238, Today, 01:28 AM
              2 responses
              26 views
              0 likes
              Last Post NinjaTrader_ChristopherJ  
              Started by Shansen, 08-30-2019, 10:18 PM
              25 responses
              949 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by JonesJoker, 04-22-2024, 12:23 PM
              8 responses
              41 views
              0 likes
              Last Post JonesJoker  
              Started by timko, Today, 06:45 AM
              0 responses
              3 views
              0 likes
              Last Post timko
              by timko
               
              Started by Waxavi, 04-19-2024, 02:10 AM
              2 responses
              39 views
              0 likes
              Last Post poeds
              by poeds
               
              Working...
              X