Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

backtest with levearge

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

    backtest with levearge

    Dear Support !

    I am working on a strategy for the ES mini.
    I would like to buy a contract per $15000, so the leverage would be around 5-6.
    How can I set the margin so that the backtest results ( cum profit, etc ) reflect the leverage.

    Thank you,
    Arnold

    #2
    Hi Arnold,

    You can set the margin for the ES from the Instrument Editor:



    The backtesting engine uses a fixed account size. If you'd like to set this up to $15000, you can set the variable in the Initialize() section of your code:

    AccountSize = 15000



    Please note that this does not update the account size in real-time by increasing or decreasing the value. It will set the original value to calculate your order sizes and they will be dynamically updated based on the margin set in the instrument manager and your original account size used.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Hi Matthew !

      Thank you for the help.
      I set it up as you described and it buys/selsl the correct amount of futures, however the backtest results do not seem to reflect the leverage.

      I get the usual 8% instead of the significantly higher cummulated return...

      What am I doing wrong ?

      Comment


        #4
        Hello Arnold,

        Thank you for your response.

        Can you provide a screenshot of these results n the Strategy Analyzer and a screenshot of the normal results you see on real-time or Market Replay so I may investigate this matter further?

        I look forward to your response.

        Comment


          #5
          leverage issue

          Hi Matthew !

          AccountSize=5000
          Total Net Profit=1592

          Cumulative Profit 2.05%

          This does not seem to be correct, but let me know if I am wrong...
          Attached Files

          Comment


            #6
            Hi Arnold,

            I'm sorry - i'm not sure what your expected outcome is here. What do you expect the Cumlative Profit to be?

            Please keep in mind that the cumlative profit is not a precentage based on your account value.

            You can think of it like reinvesting your account and winnings back into the trade:

            Start with $1 and make 3 trades at profit of $0.25, $0.50, $0.75

            The trade profit is then 25%, 50% and 75%

            The results you're going to see is a weighted average of these percentages
            MatthewNinjaTrader Product Management

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by RideMe, 04-07-2024, 04:54 PM
            5 responses
            28 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by f.saeidi, Today, 08:13 AM
            1 response
            4 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by DavidHP, Today, 07:56 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Erick  
            Started by kujista, Today, 06:23 AM
            3 responses
            9 views
            0 likes
            Last Post kujista
            by kujista
             
            Started by Mindset, Yesterday, 02:04 AM
            2 responses
            18 views
            0 likes
            Last Post NinjaTrader_RyanS  
            Working...
            X