Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to Add Leverage to Backtest?

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

    How to Add Leverage to Backtest?

    Hi all,

    My problem is that I know what I want to do, but I do not know the right lingo. So, after several hours of searching, I've found nothing.

    I am testing and developing a strategy with backtests and optimizations with the latest version of NT7. All sim, nothing real. I developed this strategy using the End-of-Day free from Kinetick, and I know it works reasonably well against most for most of the S&P500 (ie so at least I know it runs).

    After meticulously downloading Forex data from Dukoscopy, I created a $EURUSD instrument in the Instrument Manager, and imported the Dukoscopy minute data (after five tries, it worked). Plotting the forex data on a chart looks as I would expect.So far, so good.

    Now, when I run a strategy with this instrument (my new $EURUSD), I get over 1000 trades, and a whopping $0.03 profit after a loss of $0.02. How do I set the leverage for this instrument? Is this the tick size, or the margin value or the point value (in the Instrument Editor)? Do I need to pick the correct exchange? I've tried changing the Margin value to 40, and the tick size to 100,000. That doesn't work.

    Can somebody walk me through this? Thanks!

    #2
    Hello,

    QTY sizing is probably your issue here. As QTY sizing is different for forex.

    The EURUSD is correctly setup in the instrument manager by default as this is one of the more popular forex instruments therefor no changes should be needed there.

    What are you using for your QTY's?

    What are you using for your tick values for Exits and Stop losses? Most likely all these need to be changed.

    10,000
    100,000
    1,000,000


    These would be your lot sizes you would want to use depending on what size you want to trade?


    Let me know if I can be of further assistance.

    Comment


      #3
      @Brett:

      Thanks for the reply. Okay, I changed the "Set order quantity" from "by strategy" to "by default quantity" in the "Order Properties" at the bottom of the backtest tab. I set the "Default quantity" to either 10k, 100k, or 1000k. Was this correct? I guess I expected to set this number inside the instrument, or even the strategy code.

      Now, suppose I am going live. I set the order quantity the same way? (and depending on my broker, the lot size?).

      Thank for your help.

      Comment


        #4
        @Brett,

        Another followup question. Suppose I set my lot size to 1,000,000. In the sim account, where does NT check the leverage? The sim account starts at $100,000. I'm not going to buy a million Euros with that without some leverage. I know this can change with the broker. Where do I set this?

        Comment


          #5
          Hello,

          Yes, please see this guide here:



          This is set via the margin settings located under Control Center->Tools->Options->Simulator tab.


          Let me know if I can be of further assistance.

          Comment


            #6
            Brett,

            I thought I understood. Backtesting is now working as expected.

            However, I just tried running a live sim (sim101) via MBT with EURUSD. As I understood with the link above you gave me, I set the order quantity to 1 because MBT lot sizes are 10,000, and I wanted to trade one lot. Picking a random buy/sell trade, my profit/loss for that trade was simply the difference in the buy and sell price (no leverage).

            Running the sim101 account, but with the order quantity set to 10,000 yields profits/losses in the order of what I would expect (profit/loss = 10,000 * delta price).

            So, either I still do not understand, or the MBT sim account actually works in a simulated data feed / market replay mode, and *not* as a live brokerage connection.

            Can you confirm?

            Again, thanks for your help!

            Comment


              #7
              Serac, no you would need to set the quantity to the unit amount you seek, so for example to 10000 for a minilot and 100000k (0.1M) for a regular sized 100K FX spot lot.
              BertrandNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Belfortbucks, Today, 09:29 PM
              0 responses
              6 views
              0 likes
              Last Post Belfortbucks  
              Started by zstheorist, Today, 07:52 PM
              0 responses
              7 views
              0 likes
              Last Post zstheorist  
              Started by pmachiraju, 11-01-2023, 04:46 AM
              8 responses
              151 views
              0 likes
              Last Post rehmans
              by rehmans
               
              Started by mattbsea, Today, 05:44 PM
              0 responses
              6 views
              0 likes
              Last Post mattbsea  
              Started by RideMe, 04-07-2024, 04:54 PM
              6 responses
              33 views
              0 likes
              Last Post RideMe
              by RideMe
               
              Working...
              X