Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Super Trend For Ninja Trader Needed

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

  • badasan
    replied
    Dear Tamas,

    I don't know what went wrong when I tested first time but it is working fine now. Code is as follows.

    if (CrossAbove(Close, DownTrend[1],1))
    Alert("myAlert1", NinjaTrader.Cbi.Priority.High, "buy triggered",
    "Alert2.wav", 10, Color.Black, Color.Yellow);

    else
    if (CrossBelow(Close, UpTrend[1],1))
    Alert("myAlert2", NinjaTrader.Cbi.Priority.High, "sell triggered",
    "Alert2.wav", 10, Color.Black, Color.Yellow);

    Leave a comment:


  • tamas
    replied
    Originally posted by badasan View Post
    Thank you very much roonius,

    It now compiles fine. However, instead of making audio alert once
    only when it crosses, it is continuously making audio alert. I have no idea
    how to fix it. If not very difficult, it may be nice if you can add audio
    alert option to the code. Thanks a lot.
    badasan,

    what does your alert() method contain?

    Leave a comment:


  • badasan
    replied
    Thank you very much roonius,

    It now compiles fine. However, instead of making audio alert once
    only when it crosses, it is continuously making audio alert. I have no idea
    how to fix it. If not very difficult, it may be nice if you can add audio
    alert option to the code. Thanks a lot.

    Leave a comment:


  • roonius
    replied
    Originally posted by badasan View Post
    Hi advanced programmers!

    I added the following line to get audio alert when buy or sell signal
    is generated but I got the compile errors. Could someone tell me how
    to fix the problem? Thanks in advance.

    if (CrossAbove(Close[0], DownTrend[1],1)) alert(); for buy
    if (CrossBelow(Close[0], UpTrend[1],1)) alert(); for sell

    Compiling error says

    The best overloaded method match for 'CrossAbove' has some invalid arguments.
    Argument "2": cannot convert from 'double' to 'IDataSeries'
    if (CrossAbove(Close, DownTrend[1],1)) alert(); for buy
    if (CrossBelow(Close, UpTrend[1],1)) alert(); for sell

    Leave a comment:


  • badasan
    replied
    Hi advanced programmers!

    I added the following line to get audio alert when buy or sell signal
    is generated but I got the compile errors. Could someone tell me how
    to fix the problem? Thanks in advance.

    if (CrossAbove(Close[0], DownTrend[1],1)) alert(); for buy
    if (CrossBelow(Close[0], UpTrend[1],1)) alert(); for sell

    Compiling error says

    The best overloaded method match for 'CrossAbove' has some invalid arguments.
    Argument "2": cannot convert from 'double' to 'IDataSeries'

    Leave a comment:


  • NinjaTrader_JoshP
    replied
    Thank you for the suggestion. To access BoolSeries right now you have to custom program your strategy.

    Leave a comment:


  • r2kTrader
    replied
    Originally posted by NinjaTrader_Josh View Post
    The Wizard will only pick up plots. BoolSeries are not plots and as such are not picked up by the Wizard.
    Josh,

    Picking up Bools would be pretty nice.

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    I'm not sure which code you exactly refer to, most likely you would need to this outside the wizard by custom programming in the NinjaScript editor.

    Leave a comment:


  • geotabs
    replied
    How would I go about entering the code that totexal submitted? I would like to see what this would look like in the stratagy wizard for my own education .


    Thanks

    PS Is there already a stratagy for this posted that I may have missed?

    Leave a comment:


  • NinjaTrader_JoshP
    replied
    You will not be able to modify the code generated by the Strategy Wizard unless you unlock the code. If you unlock the code you will not be able to go back to the Wizard.

    Leave a comment:


  • geotabs
    replied
    Supertrend Stratagy

    I am Trying to make a stratagy from supertrend and tried to copy and paste tortexal code but in the strategy wizard-view code it does not let me paste? I am new to the stratagy wizard and have attended the webinar, but trying to figure this out is way over my head. Could some of you lend me a hand?


    Cheers

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    geotabs, unfortunately you would need to custom code this to work the way you had in mind.

    Leave a comment:


  • geotabs
    replied
    Market Analyzer

    How do you get this to work in Market Analyzer? What values do you use? Can't seem to figure it out. I want to have it color cell if crosses over or under trailing line on 5 min. I'm sorry but I don't know how to program

    Thanks for any help

    Cheers

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    dsherman, unfortunately I'm not familiar with the custom code you use, but if you just type the indicator name and start the paramterts entry with the left curly bracket ( Intellisense would come to help with the available overloads for this....

    Leave a comment:


  • dsherman
    replied
    Trying to create an indicator, I'm stuck here:


    If I add: "if(TSSuperTrend(Parameters).Trend[0] && !SuperTrend(Parameters)[1])"

    I get multiple error messages:
    "No overload for method 'TSSuperTrend' takes '1' arguments"
    "No overload for method 'SuperTrend' takes '1' arguments"


    I then tried the following:

    if ((TSSuperTrend(Length, TradingStudies.NinjaScript.Utility.MovingAverageTy pe.SMA, Multiplier, Smooth, TradingStudies.NinjaScript.Utility.SuperTrendMode. ATR).Trend[0] && !SuperTrend(Length, Multiplier)[1]))

    However, I get the error message: "Operator '!' cannot be applied to operand of type 'double'"





    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
    }
    Last edited by dsherman; 08-08-2009, 07:02 PM.

    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