Announcement

Collapse
No announcement yet.

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 zacharydw00, Today, 05:14 PM
      0 responses
      7 views
      0 likes
      Last Post zacharydw00  
      Started by shahabjet1, Today, 04:47 PM
      0 responses
      12 views
      0 likes
      Last Post shahabjet1  
      Started by aligator, Today, 04:32 PM
      0 responses
      10 views
      0 likes
      Last Post aligator  
      Started by timko, Today, 04:02 PM
      0 responses
      9 views
      0 likes
      Last Post timko
      by timko
       
      Started by asmmbillah, Today, 03:37 PM
      2 responses
      18 views
      0 likes
      Last Post asmmbillah  
      Working...
      X