Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Super Trend For Ninja Trader Needed

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

  • psycho
    replied
    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

    Leave a comment:


  • psycho
    replied
    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

    Leave a comment:


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

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    kabott, do you get any error messages in the NT log tab when the indicator fails to display?

    Leave a comment:


  • kabott
    replied
    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!

    Leave a comment:


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

    Leave a comment:


  • DaveS
    replied
    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.

    Leave a comment:


  • kabott
    replied
    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.

    Leave a comment:


  • DaveS
    replied
    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.

    Leave a comment:


  • kabott
    replied
    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.

    Leave a comment:


  • DaveS
    replied
    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?

    Leave a comment:


  • kabott
    replied
    Calling ST from an other indie

    Hi all, i been trying to call the supertrend from a script:


    double ST = SuperTrend_Regular(Close, 50, 7)[0];

    ST1.Set(ST);

    but seems i only get "half" of the indicator, the UP trend part,whats the way to properly call this indi?

    Click image for larger version

Name:	calling_supetrend.jpg
Views:	1
Size:	275.5 KB
ID:	864478

    Leave a comment:


  • marcow
    replied
    did you also check the behaviour with the different types of MovingAverageType, like HMA,SMA,EMA ? because these will have a great impact on the switching of TSSupertrend.

    I'm not sure, but it is possible that there are core-logic code differences between the old and new supertrend, which could also explain these differences...

    Marco

    Leave a comment:


  • futuros
    replied
    Thanks for your reply.

    I changed the multiplier to a very low number but still doesn't get any closer to my old supertrend.

    any other suggestions?

    thanks

    Leave a comment:


  • marcow
    replied
    Alan,

    Marco, how do you accelerate the signals w/your supertrend? what parameters would you change?
    first of all, it's not my SuperTrend, credits go to all the contributors at the beginning of this thread.....;

    What SuperTrend for NT6.5 are you referring to ? Is it SuperTrend.cs ?
    If you compare SuperTrend and TSSuperTrend, you will find that TSSuperTrend (the version posted in post #346) has an additional setting for MovingAverageType in the indicator parameters. That's probably why you see a difference between these 2 versions.

    I recommend you to test the different MovingAverageType settings, and look for a match with the older SuperTrend.
    To make TSSSuperTrend switch faster, lower the Multiplier setting in the indicator parameters.

    Marco

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
0 responses
668 views
0 likes
Last Post Geovanny Suaza  
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
0 responses
377 views
1 like
Last Post Geovanny Suaza  
Started by Mindset, 02-09-2026, 11:44 AM
0 responses
110 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
580 views
1 like
Last Post RFrosty
by RFrosty
 
Working...
X