Been doing some stuff with supertrend so I was going to take a look at this. Where did you find the Supertrend_Regular indicator?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Super Trend For Ninja Trader Needed
Collapse
X
-
Ah right, think I know the one then.
The SuperTrend line is actualy made from two different plots, one Red one Green. You need to do something like -
double STUp = SuperTrend(14, 1.4, false).UpTrend[0];
and
double STDown = SuperTrend(14, 1.4, false).DownTrend[0];
to get both. The .Uptrend and .Downtrend give you access to the public plots that you can find in the 'Properties' section, near the bottom of the code.
Parameters are length, multiplier, show arrows?
If you want to use this as a trailing stop there is an easier way.
Comment
-
You would have to find some way of knowing which plot was active and always use that one. You could make another ( dummy ) plot within SuperTrend and access that.
But are you using this in a strategy, do you want it for a trailing stop? If so. there is an easier way.
Comment
-
hi, i been trying to call a supetrend from inside an other indicator, i created a new plot called "MarketAnalizer" that goes 1 if its up or -1 if its down (see image) looks like its working fine, tho wen i try to call it from the other indicator this one just goes empty, it dissapears, can someone gave me hand with this? ill appreciate it.
this is my "marketanalizer" code (looks like its working fine):
this is how i call the supertrend:
protected override void Initialize()
{
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "EM"));
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "LT"));
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Black"));
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "SPTrend"));
Overlay = false;
}
protected override void OnBarUpdate()
{
if (CurrentBar < 50)return;
double T3O = T3(Open,4,3,0.7)[0];
double T3C = T3(Close,4,3,0.7)[0];
double ST = SuperTrend_Regular (Close,50, 7).MarketAnalyzerTrend[0];
SPTrend.Set(0);
EM.Set(center);
LT.Set(center);
Black.Set(center);
if (T3O >= T3C)
PlotColors[1][0]=cDown;
else
PlotColors[1][0]=cUp;
if (T3O >= T3C && Close[0] < Open[0])
PlotColors[0][0]=cDown;
else if (T3O >= T3C && Close[0] > Open[0])
PlotColors[0][0]=colorDis;
else if (T3O <= T3C && Close[0] > Open[0])
PlotColors[0][0]=cUp;
else if (T3O <= T3C && Close[0] < Open[0])
PlotColors[0][0]=colorDis;
if ( ST > 0)
PlotColors[2][0]=cUp;
else if ( ST < 0)
PlotColors[2][0]=cDown;
}
if i remove the Supetrend calling part the rest of the plots re-appear and seems to work fine again. heelppppp!
Comment
-
-
Originally posted by psycho View PostDeart 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
if (Position.MarketPosition == MarketPosition.Long
&& BooleanSuperTrend(DefaultInput, iPeriod, dMultiplier, false)[0] == 0
&& BooleanSuperTrend(DefaultInput, iPeriod, dMultiplier, false)[1] == 1
)
{
ExitLong("ExitLong");
}
Comment
-
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.59Attached FilesLast edited by mrdude; 07-16-2012, 06:35 PM.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by carnitron, Today, 08:42 PM
|
0 responses
5 views
0 likes
|
Last Post
by carnitron
Today, 08:42 PM
|
||
Started by strategist007, Today, 07:51 PM
|
0 responses
6 views
0 likes
|
Last Post Today, 07:51 PM | ||
Started by StockTrader88, 03-06-2021, 08:58 AM
|
44 responses
3,974 views
3 likes
|
Last Post
by jhudas88
Today, 06:59 PM
|
||
Started by rbeckmann05, Today, 06:48 PM
|
0 responses
8 views
0 likes
|
Last Post
by rbeckmann05
Today, 06:48 PM
|
||
Started by rhyminkevin, Today, 04:58 PM
|
4 responses
58 views
0 likes
|
Last Post
by dp8282
Today, 06:13 PM
|
Comment