Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ticks of profit for a bool

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

    ticks of profit for a bool

    i'm setting up my strategy to have a profit trigger that is represented by a bool and ticks of profit. if ticks of profit 102. then bool set to true. if bool is true. then exit long trade at 62 ticks. is there a way to have ticks of profit calculated in a method? i remember having something like that on a previous script. (lost my tablet so don't have it anymore)

    #2
    Hello SteveReiza,

    Thanks for your post.

    So we may accurately assist, could you please provide more detail on exactly what 'ticks of profit' is in the script?

    Is this an int variable called something like 'TicksOfProfit' in the script and you want to compare if the variable is equal to 102?

    Are you trying to get the PnL of the last trade made by the strategy?

    We look forward to assisting further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      thanks for the reply. i have it figured out. my only question is though since i have a bool in multiple sets in the do something section. is it okay if the bool gets triggered more than once to "true". it won't affect anything will it? in another set i have a exit stop limit order if the bool is set to true (which happens on execution of entry). but, i have multiple sets with the bool.

      Comment


        #4
        Hello SteveReiza,

        Thanks for your notes.

        You would ultimately have to test your strategy and add debugging prints to the script to see if setting the bool to true in multiple Sets affects how you want the strategy to behave.

        The bool will be set to true in your logic anytime those conditions occur and you are setting the bool to true in the actions section of a Set.

        Below is a link to a forum post that demonstrates how to use prints to understand behavior.
        https://ninjatrader.com/support/foru...121#post791121
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment


          #5
          thanks for the reply. okay sweet. i'll dial in and see.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          52 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          130 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          70 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          44 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          49 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X