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

Major Differences Between Live and Simulation In Strategy Function

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

    #16
    Hello Jesse, thank you for your reply.

    No, the Exit is not attempting to scale out of the market. It's intended to serve as a reverse to my prior position and the Exit is submitted on one and the same price level, that's why I'm using the calculation (Position.Quantity * 2). The strange thing is that my Prints are showing the correct value of 4 with this calculation, in a scenario where my position size is 2. But adding that same calculation to my Exit doesn't seem to give me a value of 4, and instead returns me a value of 2.

    A few days ago I did not check for Null when submitting "ASL1", the Exit order, and what would happen is that the strategy would submit 2 contacts first, and then another 2 contracts on the second price movement (Calculation set to .OnPriceChange), instead of submitting all 4 contracts at once. Then I added the "ASL1 == null" in my If statement, and now it seems like the strategy is no longer submitting the second 2 contracts that would make up the total of 4 that I am trying to get.

    I haven't had a chance yet to test different setups the markets are still open and I have other strategies running that are preventing me from trying the Simulated Data Feed where I can purposely trigger the scenario to see different outcomes depending on different factors in my script.

    Comment


      #17
      Hello GLFX005,

      I re reviewed the prior information with these details however I am not certain what the problem would be with the given details. I would likely need a more specific example here that shows the entry and the target logic so I can get a better idea of what would be expected for the target.

      As a test you could try changing the logic to have hard coded values, instead of Position.Quantity * 2 just use 4 and see if that works right. If not this likely relates somehow to the situation in total.

      I look forward to being of further assistance.
      JesseNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by usazencort, Today, 01:16 AM
      0 responses
      1 view
      0 likes
      Last Post usazencort  
      Started by kaywai, 09-01-2023, 08:44 PM
      5 responses
      603 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by xiinteractive, 04-09-2024, 08:08 AM
      6 responses
      22 views
      0 likes
      Last Post xiinteractive  
      Started by Pattontje, Yesterday, 02:10 PM
      2 responses
      21 views
      0 likes
      Last Post Pattontje  
      Started by flybuzz, 04-21-2024, 04:07 PM
      17 responses
      230 views
      0 likes
      Last Post TradingLoss  
      Working...
      X