Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ATM in ninja script strategy

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

    #76
    Hello Bertran please help me on this

    if (Stochastics(StoPeriodD, StoPeriodK, StoSmooth).K[0] < 20)
    {
    Print("Stochastic this bar" + Stochastics(StoPeriodD, StoPeriodK, StoSmooth).K[0]);
    Print("Time:" + Time[0]);

    if (Stochastics(StoPeriodD, StoPeriodK, StoSmooth).K[0] > Stochastics(StoPeriodD, StoPeriodK, StoSmooth).K[1])
    {
    if (atmStrategyIdS.Length > 0 && GetAtmStrategyMarketPosition(atmStrategyIdS) == Cbi.MarketPosition.Short)
    {
    AtmStrategyChangeStopTarget(0, breakevenplusS, "STOP1", atmStrategyIdS);
    AtmStrategyChangeStopTarget(0, breakevenplusS, "STOP2", atmStrategyIdS);
    AtmStrategyChangeStopTarget(0, breakevenplusS, "STOP3", atmStrategyIdS);
    Print("Stochastic after move" + Stochastics(StoPeriodD, StoPeriodK, StoSmooth).K[0]);
    Print("Breakeven plus" + breakevenplusS);
    Print("Time:" + Time[0]);
    }

    }
    }

    I want to move my stop when Stochastic reaches below 20 and the stochastic of the current is greater than the stochastic on the last bar. It works when the stochastic only reaches below 20 once but if stochastic will stay below 20 for 3 bars it will not work.
    Last edited by luxurious_04; 12-06-2010, 03:16 AM.

    Comment


      #77
      Also how to remove the imported assembly compiled strategies on my ninja? I have exported my strategies to a assembly compiled file and imported it on my own ninja here and what I want is to remove it because I will replace it with the new one.

      Comment


        #78
        Hello,

        Goto Control Center->File->Utiltiies->Remove NinjaScript Assemblies.

        Let me know if I can be of further assistance.
        BrettNinjaTrader Product Management

        Comment


          #79
          Hello, Anyone there could help me on getting the Current Ask and Current Bid? How can I get the number of Ask and the number of Bid on OnBarUpdate?
          Last edited by luxurious_04; 12-20-2010, 01:33 AM.

          Comment


            #80
            Hello,

            Please see these samples on how to do this:



            Then please go down to

            GetCurrentAsk()
            GetCurrentAskVolume()
            GetCurrentBid()
            GetCurrentBidVolume()


            Let me know if I can be of further assistance.
            BrettNinjaTrader Product Management

            Comment


              #81
              Hello help me on the date filter. I want to reset all my variable within 1 day or in 24 hours. If it starts to record at 5pm on this day then I want to reset it in 5 pm tomorrow. Thanks in advance.

              Comment


                #82
                Hello,

                You would need to use a time filter to do this.

                An example of this is here:



                Let me know if I can be of further assistance.
                BrettNinjaTrader Product Management

                Comment


                  #83
                  Hello, someone could help me on this. I want my strategy to plot something in the chart when it trades. I tried to drawtext and it will only plot on 1 chart. What I want is that when the strategy trades it will plot something like a letter in all open chart. For example, there are 3 CL charts open with different time frames and I want the strategy to plot all those 3 CL open charts when it trades.

                  Comment


                    #84
                    hi luxurious_04, this is unfortunately not possible - adding programmatic Global Draw objects is on our suggestion list.

                    Comment


                      #85
                      Does a dataseries plots string? I used Drawtext but if the other condition is true the drawn text in the last bar will be gone. I also used drawtextfixed but it is not what I want because all bars will have the string that I want to be plotted on the chart. I want that if my condition 1 will be true then plot something then if in the next bar my condition 2 is true then it will plot something again. What can I use to plot it fixed to the bar wherein my condition is true and it never be gone in case condition 2 will be correct in the next 2 bars or 3 bars. Please help.

                      Comment


                        #86
                        Hello,

                        DataSeries/Plot Does not support String. You would need to use DrawText. DrawText should work for you however. Just make sure to give the text object a new name when you want to draw a new Text Object instead of move the old one. You can do this with a counter variable.

                        Let me know if I can be of further assistance.
                        BrettNinjaTrader Product Management

                        Comment


                          #87
                          Originally posted by NinjaTrader_Brett View Post
                          Hello,

                          DataSeries/Plot Does not support String. You would need to use DrawText. DrawText should work for you however. Just make sure to give the text object a new name when you want to draw a new Text Object instead of move the old one. You can do this with a counter variable.

                          Let me know if I can be of further assistance.
                          Hello Brett, please give example on how to do a counter variable?

                          Comment


                            #88
                            Is there a way that indicator can access market position or open position? Just like in a strategy wherein we can use Position.MarketPosition if we want to know if there is a market position or open position.

                            Comment


                              #89
                              Hello,

                              Sure,

                              To do this: DrawText("tag1" + BarsInProgress, "Text to draw", 10, 1000, Color.Black);

                              or

                              To do this: DrawText("tag1" + CounterVariable, "Text to draw", 10, 1000, Color.Black);

                              Then increment the CounterVariable when your ready for a new Text to be drawn.




                              Also, only strategies are able to get this information on the strategy position.
                              BrettNinjaTrader Product Management

                              Comment


                                #90
                                Hello, please help me on getting the actual bar length.

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                671 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                379 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by Mindset, 02-09-2026, 11:44 AM
                                0 responses
                                111 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                                0 responses
                                575 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                582 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X