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

Plot variable take profit and stop loss

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

    Plot variable take profit and stop loss

    How can I plot stop loss and take profit in the chart?

    #2
    hello, do code in NT7 or NT8?

    This video introducing the NinjaScript editor is an excellent resource,
    https://www.youtube.com/watch?v=K8v_...56536A44DD7105


    Last edited by Emma1; 02-09-2020, 10:30 AM.

    Comment


      #3
      I would like to display in the chart, evolution of stop loss and Take profit. Can you help me please?

      Comment


        #4
        I use a dynamic stop loss and take profit

        Comment


          #5
          ProfitTarget- https://ninjatrader.com/support/help...ofittarget.htm
          Stoploss-https://ninjatrader.com/support/help...etstoploss.htm

          Comment


            #6
            I would like to plot the stop loss and take profit in the chart. To plot as an indicator while the position is open. Do you understand?

            Comment


              #7
              Hello wagner4691,

              Opening Chart Trader on a chart in NinjaTrader 8 would allow you to see any working orders such as a stop loss or a profit target.


              Having Plot Executions in the Data Series window set to Text and marker would allow you to see execution markers on the chart.


              If you are not wanting to open Chart Trader, you would need to add custom drawing objects to your chart from the strategy.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Thank you. I would like to see the evolution of Take profit and Stop loss of my strategy in the chart while position is open like an indicator. It will help me to analyse the back test and strategy performance. Is it possible something like plot stoploss ? How can I do it? In my strategy My SL and my TP change but I can not see the evolution it in the chart like an indicator for exemple. In the back test I can only see when the position is closed.

                Comment


                  #9
                  For exemple , if I have a strategy the work with breakeven and traling stop using ATR ( it is not about chart trader) an an TP using ATR I would use something like
                  profitTarget = Convert.ToInt32(Math.Round( ATR(14)[0] * 2 / TickSize));
                  stopLoss = Convert.ToInt32(Math.Round( ATR(14)[0] * 2 / TickSize));

                  SetStopLoss (CalculationMode.Ticks, stopLoss);
                  SetProfitTarget (CalculationMode.Ticks, profitTarget);

                  How can I plot in the chart the position os SL and TP while position is open?

                  Thank you

                  Comment


                    #10
                    Hello wagner4691,

                    By evolution are you meaning you want to see each price level the order was changed to?

                    I recommend you draw lines at each one of these price levels any time you are changing the price of the order.
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      I would like to see the position of SL and TP in the chart while the position is open. I would like to plot the trailing stop and the trailing TP and not draw lines. Is it possible?

                      Comment


                        #12
                        Hello wagner4691,

                        Without using Chart Trader or drawing lines this would not be possible.

                        This would be possible with Chart Trader and by drawing lines.
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #13
                          Is there some variable where I can get the value of SL or TP? You told about draw lines, How can I plot TP and SL with lines. Which parameter do I have to draw?

                          Comment


                            #14
                            Hello wagner4691,

                            If you are changing the price of SetStopLoss() by calling this and supplying a new calculated price, also supply that price to a Draw.Line(). The parameter will be the startY and endY parameters.

                            If you want to get the price from the order, this is possible in OnOrderUpdate().
                            Chelsea B.NinjaTrader Customer Service

                            Comment


                              #15
                              Look in the chart below. You can see the SL position while the trade is open.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by ETFVoyageur, Today, 07:55 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post ETFVoyageur  
                              Started by janio973, Today, 07:24 PM
                              1 response
                              7 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Started by aligator, 01-06-2022, 12:14 PM
                              4 responses
                              242 views
                              0 likes
                              Last Post john_44573  
                              Started by reynoldsn, Today, 05:56 PM
                              0 responses
                              13 views
                              0 likes
                              Last Post reynoldsn  
                              Started by bortz, 11-06-2023, 08:04 AM
                              51 responses
                              1,996 views
                              0 likes
                              Last Post aligator  
                              Working...
                              X