Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Super Trend For Ninja Trader Needed

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

  • marcow
    replied
    hello geotabs,

    I understand that you want to run the indicator on COBC = true, but the strategy on COBC = false.
    As far as I know this is not possible with a straight forward approach, because setting the strategy COBC = false will force COBC = false on all the indicators it is using.

    However I use the following workaround:

    set COBC = true in initialize of strategy
    Code:
     
    CalculateOnBarClose = true;
    and then put the strategy switching logic in the OnMarketData() method as follows:
    (you should add this method in the code, below the default OnBarUpdate() method )

    Code:
     
    protected override void OnMarketData(MarketDataEventArgs e) 
    {
     
       if (e.MarketDataType == MarketDataType.Last)   // executes if incoming tick was a price change ( and not bid/ask change) 
         {
          // put code here to check if price is above/below   Supertrend indicator value. 
         }
    }
    So now both strategy and indiactor are on COBC = true, but because strategy switching logic is in the OnMarketData() method the stratgey will behave like it is running on COBC = false.

    I don't know your programming skills, so let me know if this works for you.

    Marco

    Leave a comment:


  • geotabs
    replied
    Thanks marcow for the response, I did try the CalculateOnBarClose = false; and what it does is plots the TsSupertrend differently than if using CalculateOnBarClose = true; so if the last price has crossed with a chart that has the setting of CalculateOnBarClose = true; a chart that has CalculateOnBarClose = false; would be plotted way above current last price, I hope this is making sense? What I want is for the indicator to CalculateOnBarClose = true; but the order entry to trigger at the last price on chart so if last price is equal to the TsSupertrend then it will place order and not wait for bar close.
    Is this possible?

    Thanks Again

    Leave a comment:


  • marcow
    replied
    How do I get it to place an order when it crosses instead of when the bar closes and start of new bar?
    while adding the strategy to a chart, in the strategy parameters window set Calculate On Bar Close (COBC) to "false".This will override the default value of "true" in the strategy code. With COBC = false, the indicator values will be calculated on verey incoming tick instead of at the end of each bar.

    To make COBC = false default, you need to change the strategy code on line 41

    from:
    Code:
     
    CalculateOnBarClose = true;
    to
    Code:
     
    CalculateOnBarClose = false;

    Also how would I go about adding an ATM strategy to this strategy?
    sorry geotabs, don't have any experience with ATM strategies. Maybe other forum members do ?

    Leave a comment:


  • geotabs
    replied
    Thanks marcow it works now. How do I get it to place an order when it crosses instead of when the bar closes and start of new bar? Also how would I go about adding an ATM strategy to this strategy?

    Thanks Again

    Leave a comment:


  • marcow
    replied
    Did you happen to install an older -previously downloaded- version of SuperTrendDemo ?
    I'm asking because I updated the version in post #346 on 22/08/2011 because of the incorrect switching behaviour you are experiencing.

    please re-download and import the current version from post #346, and click "yes" if on import NT asks to overwrite existing strategies.

    let me know if it works.

    Marco

    Leave a comment:


  • geotabs
    replied
    TsSupertrend demo

    I installed the TsSupertrenddemo as posted by marcow, the problem I get is that I apply the strategy to a chart and it goes long when it should go short and vis versa?

    Any ideas?

    I attached a pic

    Thanks
    Attached Files

    Leave a comment:


  • arbuthnot
    replied
    Thanks, MrDude, for attaching that Supertrend file.

    It looks really great on the charts. Your work on this is much appreciated.

    Leave a comment:


  • Harry
    replied
    Originally posted by Tzachi View Post
    Harry,

    Do you have any financial incentive to refer us so many times to download indicators from big mike forum? It cost $50 to join the elite section and you always refer to the site when ask to help with an indicator.
    Just wonder.....
    I am a normal member of that forum. I have paid my elite membership fee two years ago, as everybody else did. I have no contractual relationship and in particular no financial relationship with Mike, who operates the forum.

    I have personally learnt a lot from other members of the forum. You will find more than 300 indicators for NinjaTrader (I have personally coded and posted about 70). The forum is more convenient for developing indicators than the NinjaTrader forum, as it is more a trading community than a beginner's forum.

    I am only refering to that forum, because I am not going to post the 70 indicators (and probably another 70 indicators somewhere posted in various threads) a second time. For many indicators, there are threads how to use them. Without those threads it is nearly impossible to understand some of the complex indicators, so even if I post them here, you would need to go there to find out the details.

    Furthermore, I have replied to various private messages and sent some of the indicators via e-mail (only those that I have coded).
    Last edited by Harry; 07-24-2012, 12:59 PM.

    Leave a comment:


  • Tzachi
    replied
    Harry,

    Do you have any financial incentive to refer us so many times to download indicators from big mike forum? It cost $50 to join the elite section and you always refer to the site when ask to help with an indicator.
    Just wonder.....

    Leave a comment:


  • Harry
    replied
    SuperTrend version that allows for selection of 27 different moving averages.

    Reviews, Strategies, Indicators & more | NexusFi community forum

    Leave a comment:


  • psycho
    replied
    milla gracia mrdude!

    Leave a comment:


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

    Leave a comment:


  • mrdude
    replied
    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");
    }

    Leave a comment:


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

    Leave a comment:


  • stocktraderbmp
    replied

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
0 responses
663 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