Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetProfitTarget() and SetStopLoss() not working

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

    #16
    Hello samish18,

    Are you able to place a manual order to the account?

    This appears to be tested on a live demo, is this correct?

    Can you reproduce using the Sim101 account or in Playback?

    If so, may I test the script in it's current state?

    You have made a modification to the script after post # 7. I would like the script you are currently testing with the modification you have made.

    Please provide an export.

    To export a NinjaTrader 8 NinjaScript so this can be shared and imported by the recipient do the following:
    1. Click Tools -> Export -> NinjaScript Add-on...
    2. Click the 'add' link -> check the box(es) for the script(s) and reference(s) you want to include
    3. Click the 'Export' button
    4. Enter the script name in the value for 'File name:'
    5. Choose a save location -> click Save
    6. Click OK to clear the export location message
    By default your exported file will be in the following location:
    • (My) Documents/NinjaTrader 8/bin/Custom/ExportNinjaScript/<export_file_name.zip>
    Below is a link to the help guide on Exporting NinjaScripts.​
    Chelsea B.NinjaTrader Customer Service

    Comment


      #17
      I am able to place a manual order to the account.
      Yes, this was tested in a demo account.
      I run into the same issue on a sim account as well.
      Attached is the script
      Attached Files

      Comment


        #18
        Hello samish18,

        I think you may have provided the wrong version of the script.

        In post # 11 you have stated that you have removed the call to CancelOrder() and the behavior can still be reproduced.
        The script you have posted in post # 17 calls CancelOrder() on line 62 and this has not been removed as you have stated.

        Attached is a screenshot.
        Click image for larger version

Name:	2024-10-28_8-06-44.png
Views:	66
Size:	56.2 KB
ID:	1322922

        Further, the script should print the order.ToString() at the top of OnOrderUpdate().

        May I have the version of the script where you have made the directed changes and you are still able to reproduce?

        Note, it is preferred to always provide an export when sharing a script instead of providing the .cs file. This will ensure the dependencies are met, should there be dependencies necessary.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        50 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        126 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        69 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        42 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X