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 love2code2trade, 04-17-2024, 01:45 PM
              4 responses
              37 views
              0 likes
              Last Post love2code2trade  
              Started by alifarahani, Today, 09:40 AM
              2 responses
              13 views
              0 likes
              Last Post alifarahani  
              Started by junkone, Today, 11:37 AM
              3 responses
              16 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by pickmyonlineclass, Today, 12:23 PM
              0 responses
              2 views
              0 likes
              Last Post pickmyonlineclass  
              Started by frankthearm, Yesterday, 09:08 AM
              12 responses
              44 views
              0 likes
              Last Post NinjaTrader_Clayton  
              Working...
              X