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

Calculating quantity order for unrealized PnL

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

    Calculating quantity order for unrealized PnL

    Hi, I'm new to NT and this is my first post, I hope someone can help me out here

    I have setup a live demo account with FXCM (UK) using SIM101 account so have access to live data. I've managed to setup the commission costs per round trip for EUR/GBP instrument 1K lot size. But how do I calculate the quantity to use in my script to at least breakeven? the commission cost is £0.12 per round trip.

    I'm hopping to see the unrealized PnL field changing value during the position and not just the commissioning costs in the final PnL.

    Is there a guideline on how to do the above or even better could someone share even a basic script that I can run and test changing the quantity order to practice how those PnL values move up and down in my demo account?

    Many thanks

    #2
    Hello juartur,

    Thank you for your post and welcome to the NinjaTrader Support Forum!

    We would not have an example specific to your request. However, you can monitor Realized and Unrealized PnL of the strategy on the Strategies tab. You can also change the quantity of order when first enabling the strategy under the Strategies menu (right click > Strategies in a chart or right click on the strategy in the Strategies tab of the Control Center and select Edit Strategy) and the Order Handling > Set order quantity to Default quantity > and set the Default quantity to the desired value.

    You can also monitor Unrealized PnL of the strategy positions from the strategy code using Position.GetUnrealizedProfitLoss: http://ninjatrader.com/support/helpG...profitloss.htm

    Please let me know if you have any questions.

    Comment


      #3
      Hi Patrick

      Thanks for the clarification. Actually I didn't setup properly the commissioning template, I've changed the charges to be based on "units" and quantity order also reflects that, so PnL is now showing as expected. Thanks

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Barry Milan, Yesterday, 10:35 PM
      5 responses
      16 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by DanielSanMartin, Yesterday, 02:37 PM
      2 responses
      13 views
      0 likes
      Last Post DanielSanMartin  
      Started by DJ888, 04-16-2024, 06:09 PM
      4 responses
      13 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by terofs, Today, 04:18 PM
      0 responses
      12 views
      0 likes
      Last Post terofs
      by terofs
       
      Started by nandhumca, Today, 03:41 PM
      0 responses
      8 views
      0 likes
      Last Post nandhumca  
      Working...
      X