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

Enter Trade by Contract Quantity

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

    Enter Trade by Contract Quantity

    I've created a strategy that is designed to purchase 5 futures contracts using the EnterLong method. I'm having a problem where, instead of treating the purchase like a futures purchase, Ninja treats the purchase like stock, deducting from my account 5 times the price of the index rather than doing the math of purchasing the contract with margin factored in

    can anyone help

    thanks

    #2
    eugenedw, thanks for your post and welcome to our support forums here at NinjaTrader! Which margin have you setup to use for your contract(s) in the Instrument Manager? (Tools > Instrument Manager) - http://www.ninjatrader-support.com/H...struments.html
    BertrandNinjaTrader Customer Service

    Comment


      #3
      I took a look at the settings for the instrument and everything looks okay. More research through Output logs shows me that the problem wasn't actually with the contract quantity calculation being wrong, but that the account cash value was being calculated incorrectly. After I exit a position I immediately enter a new position - this new position is determined in part by the cash value of the account. According to the logs, this value is not the value after the position was exited - it appears as if the strategy is moving too quickly to the next contract purchase. Do I need to put some sort of sleeper function in place so that the code waits for the account balance to be updated before it enters the new position? thanks.

      Comment


        #4
        Originally posted by eugenedw View Post
        I took a look at the settings for the instrument and everything looks okay. More research through Output logs shows me that the problem wasn't actually with the contract quantity calculation being wrong, but that the account cash value was being calculated incorrectly. After I exit a position I immediately enter a new position - this new position is determined in part by the cash value of the account. According to the logs, this value is not the value after the position was exited - it appears as if the strategy is moving too quickly to the next contract purchase. Do I need to put some sort of sleeper function in place so that the code waits for the account balance to be updated before it enters the new position? thanks.
        Hello eugenedw,

        I am forwarding your reply to NinjaTrader_Bertrand and you will receive a reply prior to the market open on Monday.

        Thank you for your patience and have a great weekend!
        Last edited by NinjaTrader_ChristopherJ; 06-20-2009, 06:01 PM.
        Christopher J.NinjaTrader Customer Service

        Comment


          #5
          eugenedw, thanks for the patience - to clarify: are you expecting to access your live brokerage account value through NinjaScript? Unfortunately this is not supported.
          BertrandNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Seneca, 08-25-2020, 08:31 AM
          2 responses
          5,941 views
          0 likes
          Last Post Tin34
          by Tin34
           
          Started by casabella, Today, 04:12 AM
          0 responses
          13 views
          0 likes
          Last Post casabella  
          Started by Ludwik, Today, 03:52 AM
          0 responses
          7 views
          0 likes
          Last Post Ludwik
          by Ludwik
           
          Started by wuannetraam, Today, 02:40 AM
          0 responses
          10 views
          0 likes
          Last Post wuannetraam  
          Started by cyberpete76, 03-27-2023, 12:29 AM
          7 responses
          272 views
          1 like
          Last Post slightly  
          Working...
          X