Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Super Trend For Ninja Trader Needed

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

  • pgabriel
    replied
    TSSupertrend does not work in NT7Strat Wizard

    I get a compile error when I try to use TSSupertrend in NT7 strategy wizard...does anyone have the same problem...?

    Leave a comment:


  • geotabs
    replied
    I need some help with TsSupertrend 2.1 in NT7, when I import and or copy and paste then compile there is one setting in the Parameters that is missing, the price type with the settings close,high,low,median,open and typical. this indicator will not plot the trailing lines on the chart and therefor not change the bar colors. I have however installed the 2.3 version on NT7 and NT6.5 and this does plot the line but still is missing the parameter Price Type. The price type is important to my trade setups, can someone give me a hand or tell me if you are experiencing the same thing?
    I don't know how to program and am having a difficult time trying to figure out in the code where this setting is.

    Thank you so much

    Leave a comment:


  • marcow
    replied
    I found out something that I would like to share; it may be usefull to those having problems using the TSSuperTrend 2.1 indicator (post #217) in a strategy.
    (It's my first post, and since I learnt alot on this forum, I would like to give back something...)

    according to Roonius in post # 223 you can access the Trend boolseries from a strategy for Uptrend/Downtrend/CrossUP/CrossDown and that you don't need an extra dataseries as introduced in Velocity's version (post #220)

    It appears that this is correct when the code in Variables is :
    privatebool colorBars = false;

    If you set:
    privatebool colorBars = true;

    TSSuperTrend(Parameters).Trend[0] will always be False !

    So what's the reason for this ?
    the code of TSSuperTrend 2.1 in line 138-149 says:

    if (colorBars)
    {
    CandleOutlineColor = tempColor;
    if (Open[0] < Close[0] && ChartControl.ChartStyleType == ChartStyleType.CandleStick)
    {
    BarColor = Color.Transparent;
    }
    else
    {
    BarColor = tempColor;
    }
    }



    If I remove/comment out:
    ChartControl.ChartStyleType == ChartStyleType.CandleStick

    from the statement in line 141 everything is fine, so there is a problem with this statement.
    But why is this piece of code setting the Trend Boolseries to always false ?
    Can some of the more experienced coders have a look at this ?


    regards,
    Marco


    Originally posted by roonius View Post
    Velocity,

    Thanks.


    You don't need to add any additional "signal"
    TSSupertrend already has a boolseries:

    Uptrend:
    Code:
     
    if(TSSuperTrend(Parameters).Trend[0])
    {
     //we are in uptrend
    }
    Downtrend:
    Code:
     
    if(!TSSuperTrend(Parameters).Trend[0])
    {
     //we are in downtrend
    }
    Fresh cross up:

    Code:
     
    if(TSSuperTrend(Parameters).Trend[0] && !SuperTrend(Parameters)[1])
    {
     //Trend just changed direction up
    }
    Fresh cross down:

    Code:
     
    if(!TSSuperTrend(Parameters).Trend[0] && SuperTrend(Parameters)[1])
    {
     //Trend just changed direction down
    }

    update 6/3/2010: the ChartControl.ChartStyleTypeissue reported above applies only to backtesting, in live and or simulated playback everything is fine.
    Last edited by marcow; 06-02-2010, 08:06 PM. Reason: reported issue applies only to backtesting

    Leave a comment:


  • geotabs
    replied
    Nt7

    anyone get this to work in NT 7 I can't get it to color bars or show lines?

    Leave a comment:


  • dsraider
    replied
    Thanks vrathee. I'd export but while it complies and works on my end, NT won't let me do so. I think it has something to do with the second Trend. Don't know. Anyway, following the steps below should work. I'll be posting an automated strat template soon into which people can simply plug in these parameters. A little cutting and pasting, but should be worth it.

    Dave

    Leave a comment:


  • vrathee
    replied
    Originally posted by dsraider View Post
    Hi All,

    I am in the process of writing a strategy that trades when DoubleMA and TSSuperTrend agree. I was able to successfully compile and test the DoubleMA part alone but cannot, for the life of me, figure out the TSSuperTrend part. I've read through every post of this thread (twice) and none of the suggestions I've tried have worked. I am attaching a zip file of what I have so far. If anyone can post (or edit my current strategy and turn it around to me) I would be forever grateful. In fact, at this point, I'm ready to name my first born child after the successful coder. I am using the latest version if TSSuperTrend (2.3) with the following parameters: 14, HMA, 1.5, 14, ATR. If possible, please write it in such a way that it only trades upon an initial crossover, i.e.: if TSSuperTrend(parameters).UpTrend[0] && !TSSuperTrend(parameters).UpTrend[1] so that I only get one entry per trend crossover.

    Thank you,
    Dave

    Nice Effort dsraider !!!

    Feeling great to be back in forum

    Leave a comment:


  • schaljapin
    replied
    using of supertrend in wizard

    is it possible to use the supertrend as a buy sell signal when coding with the wizard. I did not find out how to. this would be nice for those who are not that smart with programming in code style

    Leave a comment:


  • jcook
    replied
    Yeah. I feel you. It's not that easy to program stuff in ninja. I can't get any strategy using supertrend to paint simpe, buys and sells. So really can't even experiment.

    Leave a comment:


  • dsraider
    replied
    Simple? SIMPLE? Do you have any idea how much sleep (and hair) I've lost trying to code this thing???



    I'd be happy to post but the actual strat isn't done yet. I'm still working on entries, exits, trails, order cancellation if it gets away from me without filling my limit order entry, 'if marketposition.flat' code to make sure I'm in only one position at a time, and multiple timeframe recognition. I had this set to kick in my ATM originally, but I found out yesterday that ATMs do not adhere to the 'if marketposition.flat' rule. Oh, and I've been coding C# for about ten days now, so this may take awhile

    If it helps, this code goes directly beneath the "protected override void OnBarUpdate ()" line:

    protected override void OnBarUpdate()
    {
    // Enters market when DoubleMA and Trend agree.
    if (VelocityTrend(14, TradingStudies.NinjaScript.Utility.MovingAverageTy pe.HMA, 1.5, 14, TradingStudies.NinjaScript.Utility.SuperTrendMode. ATR).Signal[0] == 1 && VelocityTrend(14, TradingStudies.NinjaScript.Utility.MovingAverageTy pe.HMA, 1.5, 14, TradingStudies.NinjaScript.Utility.SuperTrendMode. ATR).Signal[1] == -1
    && DoubleMA(5, NinjaTrader.Indicator.DoubleMA_internal.DMAType.HM A, 45, NinjaTrader.Indicator.DoubleMA_internal.DMAType.VM A).Signal[0] == 1)
    {
    do something;
    }

    Hope that helps for now...

    Leave a comment:


  • jcook
    replied
    Would you please post the .zip for this simple strategy, so that we can copy it and modify it/play with it/improve on it?

    That would help me a lot. Thanks.

    Originally posted by dsraider View Post
    SUCCESS!!
    To anyone interested: I installed Velocity's .cs file from post #220 from this thread as a new indicator. I then had my strat call that indicator instead. See attached pic to see how this thing works. The working code is as follows:

    if (VelocityTrend(14, TradingStudies.NinjaScript.Utility.MovingAverageTy pe.HMA, 1.5, 14, TradingStudies.NinjaScript.Utility.SuperTrendMode. ATR).Signal[0] == 1 && VelocityTrend(14, TradingStudies.NinjaScript.Utility.MovingAverageTy pe.HMA, 1.5, 14, TradingStudies.NinjaScript.Utility.SuperTrendMode. ATR).Signal[1] == -1
    && DoubleMA(5, NinjaTrader.Indicator.DoubleMA_internal.DMAType.HM A, 45, NinjaTrader.Indicator.DoubleMA_internal.DMAType.VM A).Signal[0] == 1)

    Opposite for shorts.

    A great many thanks to Roonius for TSSuperTrend's creation, to Velocity for ending my chainsmoking session and to laparker for his (or her) patience with me yesterday (though you may have to fight Velocity for those naming rights).

    Happy Trading,
    Dave

    Leave a comment:


  • dsraider
    replied
    SUCCESS!!

    To anyone interested: I installed Velocity's .cs file from post #220 from this thread as a new indicator. I then had my strat call that indicator instead. See attached pic to see how this thing works. The working code is as follows:

    if (VelocityTrend(14, TradingStudies.NinjaScript.Utility.MovingAverageTy pe.HMA, 1.5, 14, TradingStudies.NinjaScript.Utility.SuperTrendMode. ATR).Signal[0] == 1 && VelocityTrend(14, TradingStudies.NinjaScript.Utility.MovingAverageTy pe.HMA, 1.5, 14, TradingStudies.NinjaScript.Utility.SuperTrendMode. ATR).Signal[1] == -1
    && DoubleMA(5, NinjaTrader.Indicator.DoubleMA_internal.DMAType.HM A, 45, NinjaTrader.Indicator.DoubleMA_internal.DMAType.VM A).Signal[0] == 1)

    Opposite for shorts.

    A great many thanks to Roonius for TSSuperTrend's creation, to Velocity for ending my chainsmoking session and to laparker for his (or her) patience with me yesterday (though you may have to fight Velocity for those naming rights).

    Happy Trading,
    Dave
    Attached Files

    Leave a comment:


  • dsraider
    replied
    Almost there...

    It took the first signal in each direction perfectly but it didn't take any following pullbacks and breakouts. (Note that it does not take the initial DoubleMA crossover, which is right). Please see pic for what I'm hoping for.

    My condition code is as follows. Am I missing something? When I tried throwing an extra set of parentheses around the TSSuperTrend && !TSSupertrend part, it ended up just entering again at each new bar, which I don't want:

    if ((DoubleMA(5, NinjaTrader.Indicator.DoubleMA_internal.DMAType.HM A, 45, NinjaTrader.Indicator.DoubleMA_internal.DMAType.VM A).Signal[0] == 1)
    && TSSuperTrend(14, TradingStudies.NinjaScript.Utility.MovingAverageTy pe.HMA, 1.5, 14, TradingStudies.NinjaScript.Utility.SuperTrendMode. ATR).Trend[0] && !TSSuperTrend(14, TradingStudies.NinjaScript.Utility.MovingAverageTy pe.SMA, 1.5, 14, TradingStudies.NinjaScript.Utility.SuperTrendMode. ATR).Trend[1])

    Thanks,
    Dave
    Attached Files

    Leave a comment:


  • dsraider
    replied
    Well, I deleted my version (2.3), went back through the thread and found 2.1. After installing and following your instructions verbatim, it COMPILED! Onto testing. Will report back. Get my unborn child's name ready

    Leave a comment:


  • laparker
    replied
    The version of TSSuperTrend I have is 2.1. It uses TradingStudies.NinjaScript.Utility in the indicator code and by putting the same in a strategy with the TradingStudies.NinjaScript.Utility.cs being in the indicator directory, it works.

    Don't know what else to suggest

    Leave a comment:


  • dsraider
    replied
    Okay, just checked. Yes, I have it, but I think it's called "TSSuperTrend.Utility" (without the 'NinjaScript' part). The actual indicator matches in the code. After adding that to the declarations, I'm now back to the "...is a method" error.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
0 responses
666 views
0 likes
Last Post Geovanny Suaza  
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
0 responses
376 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