Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Quantity for forex in automated strategy

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

    Quantity for forex in automated strategy

    Hallo,

    If I want to buy 1/100 of 100,000 eurodollar (microlot, is it called that?) how shall I say it in the strategy?

    a) EnterLong(Defaultquantity/100, "");??
    or
    b) EnterLong(0.01, "");

    Thanks for the help!

    #2
    jriverac, it would depend if you're backtesting or running it live in simulation, please review the info given in this link - http://www.ninjatrader-support.com/H...trategies.html
    BertrandNinjaTrader Customer Service

    Comment


      #3
      I want to run a live strategy.

      In my strategies for futures, I always define a integer variable called "Contracts", and it can take values like 1, 2, etc.

      My question is for forex. I tried to define "Contracts" as double, so as to give it values like 0.01, 0.02 etc, but I got an error message. And in the chart trader the size is specified as 0.01M. (with an added M)

      So what is the exact syntax if I want to place an order to buy 0.01 lot in a real account?

      Thanks

      Comment


        #4
        M in 0.01M means millions. So 0.01M = 10,000. Submit at 10,000 quantity if you want that.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Well, I am still confused, sorry.

          In a live automated strategy, in broker IB who has a standard lot=100,000$, I want to buy 10,000$ (ten thousand dollars) of whatever forex pair, say eurodollar.

          Which one is correct?

          a) EnterLong(10,000, "");
          b) EnterLong(0.1, "");
          c) EnterLong(0.01M, "");

          Thanks and sorry for not being able to get this!!

          Comment


            #6
            You would need to enter 0.025 as IB has a 25K minimum - you can easily check the sizes if you connect to your IB demo / paper account and check the order placed in the TWS.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              autotraded strategy

              so we would have to place this in an autotraded strategy or not?
              EnterLong(25,000, "");

              as no double values (0.025) is accepted in ninja script ...

              please confirm what worked for you

              Originally posted by NinjaTrader_Bertrand View Post
              You would need to enter 0.025 as IB has a 25K minimum - you can easily check the sizes if you connect to your IB demo / paper account and check the order placed in the TWS.

              Comment


                #8
                Hello,

                Bert will reply to your post on Monday. Thank you for your patience.
                DenNinjaTrader Customer Service

                Comment


                  #9
                  Yes, please use the EnterLong(25000 , "")
                  BertrandNinjaTrader Customer Service

                  Comment


                    #10
                    can you confirm this works in ninjatrader 7?

                    Originally posted by NinjaTrader_Bertrand View Post
                    Yes, please use the EnterLong(25000 , "")
                    can you confirm this works in ninjatrader 7?

                    so if the automated strategy orders 25000 in a live strategy I am only ordering 0.025 (two and a half micro lots) and not 25000 full lots?

                    still its confusing to have two differnt variables (for backtesting and live trading)
                    however I found a workaround for this: if Historical = true set tradesize to 10000x times the actual tradesize

                    Comment


                      #11
                      Yes, that's what IB's limit for using IdealPro would be, 2.5 minilots - 25K units.

                      BertrandNinjaTrader Customer Service

                      Comment


                        #12
                        Hi,
                        Its not different in Back testing and live.
                        10,000 = 1 mini lot
                        100,000 = 1 lot
                        In NT instead of entering lots or mini lots you enter 10K for mini or 100K for full lot.
                        For IB you cannot enter 10K, because IB minimum is 25K!

                        Baruch

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Lcorreia82, Today, 12:37 AM
                        0 responses
                        5 views
                        0 likes
                        Last Post Lcorreia82  
                        Started by Lcorreia82, Today, 12:35 AM
                        0 responses
                        3 views
                        0 likes
                        Last Post Lcorreia82  
                        Started by eleanorreichert, Today, 12:13 AM
                        0 responses
                        7 views
                        0 likes
                        Last Post eleanorreichert  
                        Started by FAQtrader, Yesterday, 10:05 PM
                        0 responses
                        7 views
                        0 likes
                        Last Post FAQtrader  
                        Started by Damocoleman, 03-30-2022, 09:49 AM
                        17 responses
                        1,235 views
                        0 likes
                        Last Post Mykro
                        by Mykro
                         
                        Working...
                        X