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 sgordet, Today, 11:48 AM
          0 responses
          1 view
          0 likes
          Last Post sgordet
          by sgordet
           
          Started by Trader146, Today, 11:41 AM
          0 responses
          2 views
          0 likes
          Last Post Trader146  
          Started by jpapa, 04-23-2024, 07:22 AM
          2 responses
          16 views
          0 likes
          Last Post rene69851  
          Started by funk10101, Today, 11:35 AM
          0 responses
          1 view
          0 likes
          Last Post funk10101  
          Started by samish18, Today, 11:26 AM
          0 responses
          1 view
          0 likes
          Last Post samish18  
          Working...
          X