Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Super Trend For Ninja Trader Needed

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

  • rmcbeath
    replied
    Marco,

    I am not sure if I am doing this correctly, but this is what I did with the SuperTrendDemo.cs file.

    I moved the file into my NinjaTrader 7 strategies folder. I then tried to compile the strategy, but I got the following error message.

    The type or namespace name 'SuperTrendDemo' does not exist in the namespace 'NinjaTrader.Indicator' (are you missing an assemble reference?) Code CS0234. Lines 166, 175, 192, 201

    Is this an easy edit in the namespace area of the NinjaScript? Or maybe it is referencing another indicator that I don't have named SuperTrendDemo?

    Thanks again,

    Randy

    Leave a comment:


  • rmcbeath
    replied
    Marco,

    Many thanks, that fixed it.

    In your original post, what is does the SuperTrendDemo.cs do?

    Randy

    Leave a comment:


  • marcow
    replied
    please find attached a zip file with the 2 indicators.

    to import:
    In NinjaTrader control panel go to File/Utilities/import NinjaScript and then select the attached zip file and press ok.

    please let me know if it works now...

    Marco
    Attached Files

    Leave a comment:


  • rmcbeath
    replied
    Marco,

    Yes, I was referring to the TSSuperTrend.cs file.

    You are correct that I do not have the SMMA indicator or the HomodyneDiscriminator indicator in my indicator directory, so I am sure that is why I am having the problem.

    I guess I mistakenly assumed files you posted contained all the necessary components.

    Are the proper SMMA or the HomodyneDiscriminator indicator files on this forum or if not, do you have a link to get them?

    Thanks for your help.

    Randy



    Randy,

    from the error messages I assume you're talking about the file TSSuperTrend.cs, right ? I think the problem is that you don't have the SMMA and HomodyneDiscriminator indicator in your indicators directory , please verify.

    Did you first remove TSSuperTrend.Utility from the indicators directory, and then copy TradingStudies.NinjaScript.Utility.cs into this directory ?

    does TSSuperTrend.cs compile with TSSuperTrend.Utility (and NOT TradingStudies.NinjaScript.Utility.cs ) in the indicators directory ?

    Also did you exactly follow step 0 to 6 ? please report at wich step you get the error message.

    Leave a comment:


  • marcow
    replied
    Randy,

    from the error messages I assume you're talking about the file TSSuperTrend.cs, right ? I think the problem is that you don't have the SMMA and HomodyneDiscriminator indicator in your indicators directory , please verify.

    Did you first remove TSSuperTrend.Utility from the indicators directory, and then copy TradingStudies.NinjaScript.Utility.cs into this directory ?

    does TSSuperTrend.cs compile with TSSuperTrend.Utility (and NOT TradingStudies.NinjaScript.Utility.cs ) in the indicators directory ?

    Also did you exactly follow step 0 to 6 ? please report at wich step you get the error message.


    Marco

    Leave a comment:


  • rmcbeath
    replied
    Originally posted by marcow View Post
    after upgrading to NT7 I also had issues using TSSupertrend in a strategy. I also had the error:

    NinjaTrader.Strategy.Strategy.TSSuperTrend(int,TSS uperTrend.Utility.MovingAverageType, double, int, TSSuperTrend.Utility.SuperTrendMode)' is a method, which is not valid in the given context.

    Here's the good news, I found a solution that worked for me (and with a high probability it will for you...
    For anyone interested in using TSSupertrend in a strategy here's what I did:

    0) remove TSSuperTrend.Utility from indicators directory, and rename file extension of strategy's using TSSupertrend that failed to compile before (or temporarily remove them from strategy directory) so that you can compile without errors.
    1) copy TradingStudies.NinjaScript.Utility.cs to indicators directory
    2) open and compile TradingStudies.NinjaScript.Utility.cs
    3) copy indicator TSSuperTrend.cs (V2.3) to indicators directory
    4) add "using TradingStudies.NinjaScript.Utility; " to declarations section of TSSuperTrend.cs (on top of code )
    5) compile TSSuperTrend.cs
    6) in strategy, add "using TradingStudies.NinjaScript.Utility;" to declarations section on top of page.

    I attached the following files: (modifications listed above are already implemented here)
    TradingStudies.NinjaScript.Utility.cs
    TSSuperTrend.cs (V2.3) : the indicator
    SuperTrendDemo.cs: strategy which shows how to detect if TSSuperTrend switches Long/Short and how to access and print uptrend/downtrend values.

    Hopefully this information can be usefull to some of the NinjaTraders out here...;

    good luck,
    Marco
    Marco,

    I have imported the two files, and the first file compiled fine.

    When I tried to compile the second file, I got the following error message:

    The name "SMMA" does not exist in the current context (Code CSO103), Line 62, Column 36
    The name 'HomodyneDiscriminator' does not exist in the current context (Code CSO103), Line 101, Column 49

    Is there an update that addresses this issue, or can you suggest a fix for this?

    Thanks for your help, and thanks for sharing this SuperTrend update fix or NT7.

    Randy

    Leave a comment:


  • oldredtop
    replied
    Issue solved with the help of NinjaTrader_Ryan in another thread...

    Leave a comment:


  • oldredtop
    replied
    Compiler Error

    First...thanks to all who contributed to the SuperTrend indicator development.

    I'm trying to code a very simple strategy that uses the basic SuperTrend indicator that comes with NT7. I keep getting a compiler error "NinjaTrader.Indicator.SuperTrend.Trend is inaccessible due to it's protection level". Based on google research, I have found it may something to do with the overload syntax, but I am not sure. I was trying to follow the roadmap Roonius presented earlier in this thread. Trend does exist as a bool series in the SuperTrend indicator code. Here is my code that generates the compiler error...

    if (!SuperTrend(14, 2.66, true).Trend[0] && SuperTrend(14, 2.66, true).Trend[1])


    If any one can help me see the error of my ways, it would be greatly appreciated..


    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
    }

    Leave a comment:


  • kronie
    replied
    any updates?, alerts?, audio file link-ins? made to this indice?

    also, has anyone fixed its bar repaint issue?

    or has anyone observed just howmany bars it takes before it goes back and posts its famous arrows?

    thanks

    Leave a comment:


  • mystiq
    replied
    MA

    Originally posted by roonius View Post
    Vrathee,

    Enjoy,

    You're more than welcome...
    Edit: Added Arrows to indicate possible reversal...
    GREAT INDICATOR....CAN IT BE USED IN MARKET ANALYZER?

    Leave a comment:


  • marcow
    replied
    TSSSuperTrend in strategy

    after upgrading to NT7 I also had issues using TSSupertrend in a strategy. I also had the error:

    NinjaTrader.Strategy.Strategy.TSSuperTrend(int,TSS uperTrend.Utility.MovingAverageType, double, int, TSSuperTrend.Utility.SuperTrendMode)' is a method, which is not valid in the given context.

    Here's the good news, I found a solution that worked for me (and with a high probability it will for you...
    For anyone interested in using TSSupertrend in a strategy here's what I did:

    0) remove TSSuperTrend.Utility from indicators directory, and rename file extension of strategy's using TSSupertrend that failed to compile before (or temporarily remove them from strategy directory) so that you can compile without errors.
    1) copy TradingStudies.NinjaScript.Utility.cs to indicators directory
    2) open and compile TradingStudies.NinjaScript.Utility.cs
    3) copy indicator TSSuperTrend.cs (V2.3) to indicators directory
    4) add "using TradingStudies.NinjaScript.Utility; " to declarations section of TSSuperTrend.cs (on top of code )
    5) compile TSSuperTrend.cs
    6) in strategy, add "using TradingStudies.NinjaScript.Utility;" to declarations section on top of page.

    I attached the following files: (modifications listed above are already implemented here)
    TradingStudies.NinjaScript.Utility.cs
    TSSuperTrend.cs (V2.3) : the indicator
    SuperTrendDemo.cs: strategy which shows how to detect if TSSuperTrend switches Long/Short and how to access and print uptrend/downtrend values.

    Hopefully this information can be usefull to some of the NinjaTraders out here...;

    attention update 21-08-2011
    After a discussion with Randy in post #351 to #358 the best way to get it working is to import the SuperTrend Demo strategy directly in NinjaTrader ( ControlPanel File/Utilities/import NinjaScript ) This way, all the referenced indicators and files are included automatically. So the correct procedure would now be:
    1) remove TSSuperTrend.Utility from indicators directory (if existing)
    2) import SuperTrend Demo.zip in NinjaTrader (File/Utilities/import NinjaScript ) This is the strategy with all the indicators and referenced files.

    update 22-08-2011
    updated SuperTrend Demo.zip
    reason: Corrected strategy switching behaviour; strategy entry's where inverse to supertrend indicator. If supertrend switched to uptrend, the strategy went short, and went long if supertrend swithed to downtrend. Althought this might in fact be very profitable in a sideways market, I thought for clarity it is better to make the switching follow the indicator's up/downtrend.


    good luck,
    Marco
    Attached Files
    Last edited by marcow; 08-21-2011, 04:31 PM.

    Leave a comment:


  • AlexV
    replied
    Hi, guys!

    I'm a new here. I hope you will not mind if I join you.
    Could you help me in a problem. I cant find at all an indicator like in the thumbnail. It's Supertrend indicator, only from different Time frames. I can see Positions of ST from different Time frames. No reason to switch between different TF.
    Have anyone any idea how to create it?
    Attached Files

    Leave a comment:


  • Trader.Jon
    replied
    Originally posted by mpower View Post
    Hello,
    I tired to get the the values of the upTrend and Downtrend but unfortunatly I'm not able to to get it. I use this code as a simple test:

    Plot1.Set(TSSuperTrend(14,TradingStudies.NinjaScri pt.Utility.MovingAverageType.EMA,2.618,14,TradingS tudies.NinjaScript.Utility.SuperTrendMode.ATR).Dow nTrend[1]);

    Or is there a other way to get this data's?
    Can you please supply more details as to what is happening

    Leave a comment:


  • mpower
    replied
    get trend values

    Hello,
    I tired to get the the values of the upTrend and Downtrend but unfortunatly I'm not able to to get it. I use this code as a simple test:

    Plot1.Set(TSSuperTrend(14,TradingStudies.NinjaScri pt.Utility.MovingAverageType.EMA,2.618,14,TradingS tudies.NinjaScript.Utility.SuperTrendMode.ATR).Dow nTrend[1]);

    Or is there a other way to get this data's?

    Leave a comment:


  • garciaal
    replied
    Rayzor,

    Thanks for the quick reply and the link.

    AL

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by CaptainJack, 05-29-2026, 05:09 AM
0 responses
594 views
0 likes
Last Post CaptainJack  
Started by CaptainJack, 05-29-2026, 12:02 AM
0 responses
400 views
0 likes
Last Post CaptainJack  
Started by charlesugo_1, 05-26-2026, 05:03 PM
0 responses
289 views
1 like
Last Post charlesugo_1  
Started by DannyP96, 05-18-2026, 02:38 PM
1 response
403 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by CarlTrading, 05-11-2026, 05:56 AM
0 responses
358 views
0 likes
Last Post CarlTrading  
Working...
X