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 ZeroKuhl, Today, 04:31 PM
|
0 responses
13 views
0 likes
|
Last Post
by ZeroKuhl
Today, 04:31 PM
|
||
Started by Vulgoth_t_Destroyer, 05-09-2022, 04:45 PM
|
54 responses
5,337 views
0 likes
|
Last Post
by Gaterz
Today, 04:29 PM
|
||
Started by ETFVoyageur, 05-07-2024, 07:05 PM
|
11 responses
76 views
0 likes
|
Last Post
by -=Edge=-
Today, 04:27 PM
|
||
Started by _Zero_, 04-10-2020, 03:21 PM
|
145 responses
7,900 views
6 likes
|
Last Post
by johng2
Today, 04:19 PM
|
||
Started by TheTradingMantis, 01-19-2023, 02:05 AM
|
43 responses
923 views
0 likes
|
Last Post
by jmagaia
Today, 04:13 PM
|
Comment