Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Super Trend For Ninja Trader Needed

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

    Hi kabbott
    Been doing some stuff with supertrend so I was going to take a look at this. Where did you find the Supertrend_Regular indicator?

    Comment


      hi Dave, i dont remember, i think i got it from Big Mike's , ill share it if you need it. let me kno.

      (i added the "_Regular" cause i tweaked it a lil bit but it was just a normal supertrend , nothing fancy)
      Last edited by kabott; 01-10-2012, 08:39 AM.

      Comment


        Ah right, think I know the one then.
        The SuperTrend line is actualy made from two different plots, one Red one Green. You need to do something like -

        double STUp = SuperTrend(14, 1.4, false).UpTrend[0];
        and
        double STDown = SuperTrend(14, 1.4, false).DownTrend[0];

        to get both. The .Uptrend and .Downtrend give you access to the public plots that you can find in the 'Properties' section, near the bottom of the code.

        Parameters are length, multiplier, show arrows?

        If you want to use this as a trailing stop there is an easier way.

        Comment


          aa i see, how do i set the same plot to both stages? how do i build the condition to test which one is "true", my c sharp is very basic :P
          Last edited by kabott; 01-10-2012, 11:05 AM.

          Comment


            You would have to find some way of knowing which plot was active and always use that one. You could make another ( dummy ) plot within SuperTrend and access that.

            But are you using this in a strategy, do you want it for a trailing stop? If so. there is an easier way.

            Comment


              its part of a strategy yep, ok i think i got an idea, thanks

              Comment


                hi, i been trying to call a supetrend from inside an other indicator, i created a new plot called "MarketAnalizer" that goes 1 if its up or -1 if its down (see image) looks like its working fine, tho wen i try to call it from the other indicator this one just goes empty, it dissapears, can someone gave me hand with this? ill appreciate it.


                this is my "marketanalizer" code (looks like its working fine):

                Click image for larger version

Name:	supetrend.jpg
Views:	1
Size:	513.1 KB
ID:	864496

                this is how i call the supertrend:


                protected override void Initialize()
                {

                Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "EM"));
                Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "LT"));
                Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Black"));
                Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "SPTrend"));
                Overlay = false;

                }


                protected override void OnBarUpdate()
                {
                if (CurrentBar < 50)return;



                double T3O = T3(Open,4,3,0.7)[0];
                double T3C = T3(Close,4,3,0.7)[0];
                double ST = SuperTrend_Regular (Close,50, 7).MarketAnalyzerTrend[0];

                SPTrend.Set(0);
                EM.Set(center);
                LT.Set(center);
                Black.Set(center);





                if (T3O >= T3C)
                PlotColors[1][0]=cDown;
                else
                PlotColors[1][0]=cUp;


                if (T3O >= T3C && Close[0] < Open[0])
                PlotColors[0][0]=cDown;
                else if (T3O >= T3C && Close[0] > Open[0])
                PlotColors[0][0]=colorDis;
                else if (T3O <= T3C && Close[0] > Open[0])
                PlotColors[0][0]=cUp;
                else if (T3O <= T3C && Close[0] < Open[0])
                PlotColors[0][0]=colorDis;


                if ( ST > 0)
                PlotColors[2][0]=cUp;
                else if ( ST < 0)
                PlotColors[2][0]=cDown;


                }


                if i remove the Supetrend calling part the rest of the plots re-appear and seems to work fine again. heelppppp!

                Comment


                  kabott, do you get any error messages in the NT log tab when the indicator fails to display?
                  BertrandNinjaTrader Customer Service

                  Comment


                    ok, that was wierd, i recompiled and now it worked lol, damn it. thanks for your quick reply Bertrand

                    Comment


                      supertrend trail stop

                      Hello,
                      I would like to use the supertrend to closing my open trades.
                      It should seems like an ATR trailing stop.
                      Somebody can help me, how can I rebuild the script for it?
                      tnx
                      Psycho

                      Comment


                        supertrend stop

                        Deart programmers,
                        I would like to use the supertrend for close my open positions.
                        (It should seems like an ATR trailing stop, with (h-l/2 value))
                        Somebody can write it for me?
                        tnx
                        Psycho

                        Comment


                          Thank you very much..
                          but I think about a supertrend-trail stop, not an atr-trail stop..
                          It is very similar, but I can't programming it.

                          psycho

                          Comment


                            Originally posted by psycho View Post
                            Deart programmers,
                            I would like to use the supertrend for close my open positions.
                            (It should seems like an ATR trailing stop, with (h-l/2 value))
                            Somebody can write it for me?
                            tnx
                            Psycho
                            This is how I use supertrend to close open positions. You should also be able to do this from the strategy wizard

                            if (Position.MarketPosition == MarketPosition.Long
                            && BooleanSuperTrend(DefaultInput, iPeriod, dMultiplier,
                            false)[0] == 0
                            && BooleanSuperTrend(DefaultInput, iPeriod, dMultiplier, false)[1] == 1
                            )
                            {
                            ExitLong(
                            "ExitLong");
                            }

                            Comment


                              Thanks to everyone who has contributed scripts or knowledge, I've really learned a lot about the SuperTrend from reading though these pages.
                              I'm still playing around with SuperTrend, but so far I like pairing it with Aroon to validate my entries. I'm basically looking for BooleanSuperTrend to change and Aroon to equal 100. I still need to optimize the strategy a little, but I've uploaded what I have so far. I ran one backtest against 6 months of EURUSD on 1m timeframe with a profit factor of 1.59
                              Attached Files
                              Last edited by mrdude; 07-16-2012, 06:35 PM.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Jonafare, 12-06-2012, 03:48 PM
                              5 responses
                              3,986 views
                              0 likes
                              Last Post rene69851  
                              Started by Fitspressorest, Today, 01:38 PM
                              0 responses
                              2 views
                              0 likes
                              Last Post Fitspressorest  
                              Started by Jonker, Today, 01:19 PM
                              0 responses
                              2 views
                              0 likes
                              Last Post Jonker
                              by Jonker
                               
                              Started by futtrader, Today, 01:16 PM
                              0 responses
                              9 views
                              0 likes
                              Last Post futtrader  
                              Started by Segwin, 05-07-2018, 02:15 PM
                              14 responses
                              1,792 views
                              0 likes
                              Last Post aligator  
                              Working...
                              X