Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

add condition to change the initial stop lose some pips higher when a price moved up

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

    add condition to change the initial stop lose some pips higher when a price moved up

    add condition to change the initial stop lose some pips higher when a price moved up, and do not change again, untill the other condition is met.

    ex: The LONG opened at 1.5010 The SL is at Sell 1.5000; in any given time the price moved up to 1.5015 or higher, the SL will changed to 1.5005 and do not move up unless there is a second similar condition that change it to higher.

    It works similar to the ATM in NINJA, but i want to use it in ninjascript. It is a little bit different than trailing stop, which keep moving up as the price move up.

    Is it possible to do it in wizard? Or i would probably need to code and calculate the difference entry price and the last price, if 5(whatever) or higher, change SL, so only 1 SL order.

    #2
    in the wizard, there is a function under strategy "Unrealized PnL". What does it do?
    A preset strategy, or simply returning the current unrealized profit and lose?

    Sounds like the one im looking for to get the difference between entry and the current price. So I can use it to compare if >= 5, then change the SL order.

    let me know.

    Comment


      #3
      >> Sounds like the one im looking for to get the difference between entry and the current price. So I can use it to compare if >= 5, then change the SL order.
      This should work using UnrealizedPnL in the wizard.

      Comment


        #4
        there are 3 options in Unrealized P/L: Currency, Percent, Points.

        im trading forex, do i use points as Tick in this case? 1 Point = 1 tick?

        Comment


          #5
          A tick is a pip not a point. You e.g. would need to apply 0.0001 points for one pip/tick of EURUSD.

          Comment


            #6
            O ok. so using real math's Point.

            Let's say other pair, USD/JPY, 105.00, 1 point is 1.00, 1 tick in this case is 0.01 point?

            now back to basic math. lol

            thanks.

            Comment


              #7
              >> Let's say other pair, USD/JPY, 105.00, 1 point is 1.00, 1 tick in this case is 0.01 point?
              correct

              Comment


                #8
                Ok got it.

                now a new issue with stop order.

                In the wizard, there is a list of order types. In my original setup, for LONG order, I will enter with "enter long position by a limit order", and together with this as take profit "Exit long position by a limit order', and stop lose using "Exit long position by a stop order".

                so when I am using the new condition to check if the pip is over 5 pips, then change the Stop Lose order to something else, I choose:" Exit Long position by a stop order", which is exactly as my original order?
                Will I have 2 stop order, or just one, which is the new one will replace the original one that is placed when the entry is successful?
                Everything else is default, from what i remember, if I dont change the "From entry signal" name, new SL order will always replace the older one unless the "From entry signal" name is different between these 2 stop lose orders.

                Am i correct? Maybe a little complicated.

                Thanks.

                Comment


                  #9
                  >> Everything else is default, from what i remember, if I dont change the "From entry signal" name, new SL order will always replace the older one unless the "From entry signal" name is different between these 2 stop lose orders.
                  correct

                  Comment


                    #10
                    this is off topic.

                    is there a way to have ninja script only trade once per candle?

                    maybe after a trade is entered, put into a variable as true, then after the next candle or after 5 minutes for example, change the variable to false.

                    Comment


                      #11
                      CalculateOnBarClose=true (default) takes care of that. Please consult the docs for details.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by inanazsocial, Today, 01:15 AM
                      1 response
                      5 views
                      0 likes
                      Last Post NinjaTrader_Jason  
                      Started by rocketman7, Today, 02:12 AM
                      0 responses
                      6 views
                      0 likes
                      Last Post rocketman7  
                      Started by dustydbayer, Today, 01:59 AM
                      0 responses
                      1 view
                      0 likes
                      Last Post dustydbayer  
                      Started by trilliantrader, 04-18-2024, 08:16 AM
                      5 responses
                      22 views
                      0 likes
                      Last Post trilliantrader  
                      Started by Davidtowleii, Today, 12:15 AM
                      0 responses
                      3 views
                      0 likes
                      Last Post Davidtowleii  
                      Working...
                      X