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

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.
    Brandon H.NinjaTrader Customer Service

    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
        Brandon H.NinjaTrader Customer Service

        Comment


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

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by rhyminkevin, Today, 04:58 PM
          3 responses
          47 views
          0 likes
          Last Post Anfedport  
          Started by iceman2018, Today, 05:07 PM
          0 responses
          5 views
          0 likes
          Last Post iceman2018  
          Started by lightsun47, Today, 03:51 PM
          0 responses
          7 views
          0 likes
          Last Post lightsun47  
          Started by 00nevest, Today, 02:27 PM
          1 response
          14 views
          0 likes
          Last Post 00nevest  
          Started by futtrader, 04-21-2024, 01:50 AM
          4 responses
          50 views
          0 likes
          Last Post futtrader  
          Working...
          X