Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Adaptive SuperTrend
Collapse
X
-
Supertrend strategy crashes
I tried to use Supertrend in a strategy and it crashed NT on me too
Leave a comment:
-
Adaptive SuperTrend strategy problem
I like this indicator a lot. I wanted to test it in a strategy with some other indicators. The problem is the amount of memory that is uses. I have managed to complete a back test (with all other indicators removed from the strategy) on a 60 minute chart from 1 July 09 to 31 Aug 09 on the GC (gold) 12-09 contract.
As soon as I try to run it in a 466 tick chart NT crashes. I get the following errors in the log:
2009/09/02 03:53:42 PM,Default,Hosted.Adapter.OnMarketDataNow: Exception of type 'System.OutOfMemoryException' was thrown.,
2009/09/02 03:53:38 PM,Strategy,Error on calling 'OnBarUpdate' method for strategy 'testADSTunlocked': Index was outside the bounds of the array.,
2009/09/02 03:53:37 PM,Default,Failed to call method 'Initialize' for indicator 'AdaptiveSuperTrendEW': Exception of type 'System.OutOfMemoryException' was thrown.,
2009/09/02 03:53:36 PM,Default,Error on calling the 'OnBarUpdate' method for indicator 'AdaptiveSuperTrendEW' on bar 57: Exception of type 'System.OutOfMemoryException' was thrown.,
2009/09/02 03:53:36 PM,Default,Error on calling the 'OnBarUpdate' method for indicator 'AdaptiveSuperTrendEW' on bar 59: Exception of type 'System.OutOfMemoryException' was thrown.,
I have also seen OutOfMemeoryException errors thrown during the tests mentioning the HilbertTransform - which is something I believe the adaptive supertrend indicator uses.
I have attached the strategy if someone wants to see if they get the same error. I hope someone can help me use the indicator in a different way so that memory is not a problem. For those that could help but do not want to run the strategy it basically is this:
if (AdaptiveSuperTrendEW(1, true).UpTrend[0] < Close[0])
{
EnterLong(DefaultQuantity, "");
}
// Condition set 2
if (AdaptiveSuperTrendEW(1, true).DownTrend[0] > Close[0])
{
EnterShort(DefaultQuantity, "");
Any ideas are welcome.
RegardsAttached Files
Leave a comment:
-
Thank you Zoltran . . . I do have the setting to calculate on bar close . . . are you saying then that the only way out is to refresh data as often as the time interval you have?Originally posted by zoltran View PostYou are seeing the dif between live and historical data. Nothing wrong with the indicator. They all do what you see
During chop with any realtime bar, the data will fluctuate and have the effect you see.
You can stop the 'false' signals by setting ur indicators to 'bar close'.
If it was as easy as following a simple arrow or ind, we'd all be rich.
Leave a comment:
-
You are seeing the dif between live and historical data. Nothing wrong with the indicator. They all do what you see
During chop with any realtime bar, the data will fluctuate and have the effect you see.
You can stop the 'false' signals by setting ur indicators to 'bar close'.
If it was as easy as following a simple arrow or ind, we'd all be rich.
Leave a comment:
-
Bump!Originally posted by Insearch View PostI tried this tool and I have an issue with it . . .
On live trading the signals seem to come often and then after refresh it is much different . . . .
Attached is an example of what I mean . . .
Anything I can do?
Can anyone help with this . . . or is it that it won't be that useful on a 2min chart?
Leave a comment:
-
I tried this tool and I have an issue with it . . .
On live trading the signals seem to come often and then after refresh it is much different . . . .
Attached is an example of what I mean . . .
Anything I can do?
Leave a comment:
-
I have found this to be a very useful tool and wanted to express my thanks for your revision and submission.Originally posted by lgarcia3 View PostHello,
I saw a long discussion about SuperTrend. I thought the indicator was good, but still had a few whipsaw trades. So, I think this should clean it up a little. The concept of SuperTrend is based on checking how volatile the price is at some point. What I did was to check how large the period of the trend is and get a nice indicator with less whipsaw trades. In the shot you can see ES, 15-minute, with SuperTrend in its default settings and the adaptive version. The regular supertrend signals 7 different trades, while the adaptive version only one trade.
Hope that improves it a little.
Have fun!
Leave a comment:
-
ah ok ..cheers , not sure what that means though
but im sure its somthing good
Leave a comment:
-
That's because the multiplier is adaptable. The only reason its in the parameters is so you can see what the current value is.
It wouldn't be hard to make a multiplier for the multiplier that can be adjusted, maybe that's something I'll look into when I have time.
Leave a comment:
-
**
I posted a modified version, using Jcooks suggestion but it plotted almost exactly like the original SuperTrend and I didn't find it very useful so I've removed it and created a different version.
**
Basically its the original SuperTrend algorithm but the ATR period and multiplier adapt using the Homodyne Discriminator.
The reason people were getting weird plotting and using such different multiplier values is because the Homodyne Discriminator is returning a "period" which isn't necessarily related to the price. For example if you are trading forex and the price is 1.38 and the HD returns 20 and you multiply that by 0.5, SuperTrend will plot at 11.38 which is obviously way out of the price scale.
I always found the multiplier had a much larger impact on the indicator than the ATR period so in this version both the period and the multiplier adapt.
I haven't tested this, aside from making sure it plots, so let me know if its useful.
(*As this is my 666th post this indicator may be evil and blow up the internet, use with caution
)
Attached Files
Leave a comment:
-
Hi JC,
don't worry, I don't take it personally!
Well, the only way to know that is trying it. So, just give it a go and see what you get. Just change the code a little. What I think you will get at the end is the ATR calculated every time with different time spams. It may have less trades as well.
To answer the other question, the period in this case is a meassure of volatility as well. Not a number of time periods to create the spam where you do the calculation. It is the cycle period and it meassures volatility a little different that Wilder did in his ATR, which meassures the distance travel by the price if I remember well. In this case, say that you draw a circle. You put a dot in the center of that circle, then you draw lines from the center of the circle to the border of it at the same angle all the time. The number of slices you get would be the period of that cycle or circle. In this case, those slices represent a bar of price movement. If you have only 4 slices, it is a fast cycle, if you have 20, it is slow.
Hope that helps.Last edited by lgarcia3; 05-06-2009, 11:43 AM.
Leave a comment:
-
Originally posted by lgarcia3 View PostHi price, I was wondering what stock/contract is that with those settings?
Thanks!
hi again lg:
I went into the code.
The original supertrend code uses a PRICE +/- multiplier*ATR(period). Where period is fixed and ATR is a measure of volatility (amplitude).
Your code uses a PRICE +/- multiplier*period...where period is the output from the homodyne and where volatility (amplitude) has dissapeared.
Wouldn't it make more sense if your code calculated the lines as:
PRICE +/- multiplier*ATR(period) ????
Not saying your stuff is incorrect, only that it doesn't make sense to me, after reading the book.
It looks as if your coded indicator mixes up price amplitude with period (time). I'm very confused.
Thanks and take care.
JCLast edited by jcook; 05-06-2009, 11:14 AM.
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
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
377 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
110 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
575 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
580 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Leave a comment: