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

Set TriggerPrice / Set TriggerState

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

    Set TriggerPrice / Set TriggerState

    Hello

    can somebody direct me to where I can find information on Set TriggerPrice and Set TriggerStop

    I am working with a break even stop from this forum see link below



    It uses the strategy builder with those functions but I cannot find any documentation explaining the parameters or how exactly they are used.

    Thank you

    Stefan

    #2
    Hello sdauteil,

    Thank you for your post.

    Are you referring to the BreakEvenBuilderExample?

    TriggerState, TriggerPrice, and StopPrice in that example are simply variables that are manipulated by the strategy.

    Here's where those variables are initialized in the Strategy Builder:

    Click image for larger version

Name:	2019-06-14_1254.png
Views:	214
Size:	78.0 KB
ID:	1060814

    And then they are used as parts of conditions and values for them are updated here in the conditions and actions, for example here:

    Click image for larger version

Name:	2019-06-14_1257_001.png
Views:	235
Size:	88.8 KB
ID:	1060815

    As we can see, these variables are set as the Average Position Price, + the number of ticks specified by the InitialStopDistance and BreakEvenTrigger user inputs.

    Thanks in advance; I look forward to assisting you further.

    ​​​​​​​
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Thank you for the help

      I am trying to figure out the function of the Set TriggerPrice and Set TriggerState that is under the Misc box that comes up when you edit the TriggerPrice line in the action box.

      I looked at the code and I couldn't find this function nor could I find it in the help files.




      Click image for larger version

Name:	Set Trigger Price.JPG
Views:	223
Size:	102.4 KB
ID:	1060862


      Comment


        #4
        Hello sdauteil,

        Thank you for your post.

        "Set TriggerPrice" in the Misc box basically means "TriggerPrice =" whatever value you choose for that box. It is used to reassign the value of that variable to whatever you choose.

        In the case of your screenshot, it's currently being reset to the Current Average Position Price plus the number of ticks away from breakeven you wish multiplied by the ticksize, which is the dollar amount of each tick.

        Please let us know if we may be of further assistance to you.


        Kate W.NinjaTrader Customer Service

        Comment


          #5
          One more question

          If I use the set profit target feature in the strategy builder (1st picture) the break even function will no longer trigger.

          The Break even function does work If I set the profit target in the action window (2nd picture) but if the profit target is hit the position doesn't close until the candle in which the profit target was hit closes.

          Basically I would like the closing order when the profit target is hit to fill immediately. I tried market if touched but that didn't seem to work either.

          I appreciate the help...

          Click image for larger version

Name:	Profit Target.JPG
Views:	205
Size:	63.3 KB
ID:	1061040Click image for larger version

Name:	Strategy Target.JPG
Views:	182
Size:	81.6 KB
ID:	1061041








          Comment


            #6
            Hello sdauteuil,

            Thank you for your reply.

            You would not be able to use the Stops and Targets screen to set a stop loss that would move to breakeven. You would have to use logic in a similar fashion as the example to create a breakeven using Exit methods.

            What is your strategy set to calculate on? OnBarClose will cause your exit orders to be executed after the current bar closes. To have these orders trigger intrabar, you need to set the calculation mode to OnPriceChange (recommended) or OnEachTick (uses more PC resources).

            Here's a link to our help guide that goes over the associated screen in the Strategy Builder:


            Please let us know if we may be of further assistance to you.
            Kate W.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CortexZenUSA, Today, 12:53 AM
            0 responses
            1 view
            0 likes
            Last Post CortexZenUSA  
            Started by CortexZenUSA, Today, 12:46 AM
            0 responses
            1 view
            0 likes
            Last Post CortexZenUSA  
            Started by usazencortex, Today, 12:43 AM
            0 responses
            5 views
            0 likes
            Last Post usazencortex  
            Started by sidlercom80, 10-28-2023, 08:49 AM
            168 responses
            2,265 views
            0 likes
            Last Post sidlercom80  
            Started by Barry Milan, Yesterday, 10:35 PM
            3 responses
            11 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Working...
            X