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

Trade Execution Price

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

    Trade Execution Price

    I am developing a strategy that uses EnterLong() and EnterShort() for trade entries. What is the best event to use to capture the actual trade price? I am particularly interested in getting this to work in Strategy Analyzer.

    #2
    Hello reynoldsn,

    Thank you for your post.

    You can check the execution.Price from OnExecutionUpdate().

    Please see the Help Guide page below which has sample code.



    Please let us know if you have any further questions.
    Gaby V.NinjaTrader Customer Service

    Comment


      #3
      Thanks, Gaby,
      OnExecutionUpdate has the signature:
      Code:
      protected override void OnExecutionUpdate(Execution execution, string executionId, double price, int quantity, MarketPosition marketPosition, string orderId, DateTime time)
      {
      
      
      }

      Are the parameters, execution.Price and price the same thing?

      Comment


        #4
        Hello,

        Yes, these are the same thing. You can test by printing out execution.Price and price.

        Print("execution.Price: " + execution.Price + " price: " + price);

        Please let us know if you have any further questions.
        Gaby V.NinjaTrader Customer Service

        Comment


          #5
          Ok, thanks

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by punkiy2111, 08-31-2021, 10:42 AM
          16 responses
          951 views
          0 likes
          Last Post muchacha  
          Started by gbourque, Yesterday, 04:11 PM
          5 responses
          19 views
          0 likes
          Last Post gbourque  
          Started by dtl-saw, 12-29-2022, 09:12 AM
          42 responses
          3,114 views
          1 like
          Last Post aligator  
          Started by AlphaOptions, 06-18-2013, 08:24 AM
          4 responses
          2,162 views
          0 likes
          Last Post ybforex
          by ybforex
           
          Started by mly916, Today, 03:17 PM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Working...
          X