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

SetStopLoss and SetProfitTarget not working as intended

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

    SetStopLoss and SetProfitTarget not working as intended

    Hello forum,

    I would like to get some feedback based on the attached log snippet.

    My strategy opens a short position with 2 contracts and uses SetStopLoss and SetProfitTarget to set the exit orders.

    An error of some kind happens when submitting the Target, but execution continues and the log seems to show that orders made it to the state where they could exit the trade as intended.

    Then the profit target is hit and partially filled and chaos ensues.

    Instead of my position reducing from Short 2 to Short 1 contract, it is now Long 4 contracts. ?!?!

    Next, the target order continues to fill (buy to cover) and the final position is now Long 5 contracts instead of Flat.

    It appears that after the error on submitting the target, Ninja thinks the strategy is Long and not Short

    This is running on a sim account with a live feed from Continuum and there is no manual intervention. This is 100% the strategy.

    Each call for the stop loss is: SetStopLoss ( TradeNumber + " Entry", CalculationMode.Ticks, StopLossTicks, false );
    Each call for the Target is: SetProfitTarget( TradeNumber + " Entry", CalculationMode.Ticks, TargetTicks );
    Attached Files
    daqu40
    NinjaTrader Ecosystem Vendor - QTradez

    #2
    Hello daqu40,

    Thank you for your post.

    We'd definitely need more of your logs to determine what may be occurring. Please send me your full log and trace files so that I may look into what occurred.

    You can do this by going to the Control Center-> Help-> Email Support

    Ensuring 'Log and Trace Files' is checked will include these files. This is checked by default.

    Please reference the following ticket number in the body of the email: 2778343 ATTN Kate W.

    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Email with logs and trace, referring the above tick has been sent.
      daqu40
      NinjaTrader Ecosystem Vendor - QTradez

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by arvidvanstaey, Today, 02:19 PM
      4 responses
      11 views
      0 likes
      Last Post arvidvanstaey  
      Started by samish18, 04-17-2024, 08:57 AM
      16 responses
      60 views
      0 likes
      Last Post samish18  
      Started by jordanq2, Today, 03:10 PM
      2 responses
      9 views
      0 likes
      Last Post jordanq2  
      Started by traderqz, Today, 12:06 AM
      10 responses
      18 views
      0 likes
      Last Post traderqz  
      Started by algospoke, 04-17-2024, 06:40 PM
      5 responses
      47 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X