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

Stopping Strategy

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

    #16
    Using on Forex, so wanted to clsoe out with gain of 10 pips.

    Comment


      #17
      Then you likely would need to try 10 * 0.0001 instead of just 10.

      Comment


        #18
        Thanks, I'll give that a try.
        Jim

        Comment


          #19
          Note: Might be different on the JPY pairs, like 10 * 0.01.

          Comment


            #20
            Understood,
            Thanks

            Comment


              #21
              Stop Strategy after certain profit gain in pips

              In case it helps anyone, this is the coding that works for closing positions, and stopping a strategy, after reaching a certain pip gain, on GBP, including unrealized and realized profit:

              // If the profit on real-time trades is >= 20 pips stop trading
              if ((Performance.AllTrades.TradesPerformance.Points.C umProfit + Position.GetProfitLoss(Close[0],PerformanceUnit.Points) >= 20*.0001))
              {
              StopStrategy();
              return;
              }
              Thanks NinjaTrader_Dierk for your help.

              Comment


                #22
                Jim, or anyone else. Use the variable TickSize in place of 0.0001 because it has the same value but NT automatically changes it for other pairs like USDJPY with a different ticksize.

                Wayne

                Comment


                  #23
                  Stopping Strategy

                  Thanks Wayne,
                  That is excellent,
                  Jim

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Vietanhnguyen2hotmailcom, Yesterday, 10:29 AM
                  4 responses
                  23 views
                  0 likes
                  Last Post Vietanhnguyen2hotmailcom  
                  Started by PhillT, 04-19-2024, 02:16 PM
                  4 responses
                  35 views
                  0 likes
                  Last Post PhillT
                  by PhillT
                   
                  Started by ageeholdings, 05-01-2024, 05:22 AM
                  5 responses
                  37 views
                  0 likes
                  Last Post ageeholdings  
                  Started by reynoldsn, Today, 02:34 PM
                  0 responses
                  13 views
                  0 likes
                  Last Post reynoldsn  
                  Started by nightstalker, Today, 02:05 PM
                  0 responses
                  21 views
                  0 likes
                  Last Post nightstalker  
                  Working...
                  X