View Full Version : ATR -Trailing Stops
PrTester
10-16-2007, 07:32 PM
Attach is a ATR Trailing Stop Indicator Based in the Wilder’s Volatility System.
RK_trader
10-16-2007, 11:33 PM
Thanks PrTester for the indicator. Can you please tell how you use it to trade.
I read about Wilder's volatility but do not understand it totally. Can you point me to any link/resource where I can get some good information on it.
How do you use the other bottom indicators marked on your chart, in combination with the Wilders ?
Thanks
RK
PS: Sorry if I am asking any obvious/basic questions.
zoltran
10-17-2007, 01:40 AM
Nice work !
Attach is a ATR Trailing Stop Indicator Based in the Wilder’s Volatility System.
PrTester
10-17-2007, 09:49 AM
Thanks PrTester for the indicator. Can you please tell how you use it to trade.
I read about Wilder's volatility but do not understand it totally. Can you point me to any link/resource where I can get some good information on it.
How do you use the other bottom indicators marked on your chart, in combination with the Wilders ?
Thanks
RK
PS: Sorry if I am asking any obvious/basic questions.
RK_trader,
This indicator would help you to "let your profit run" if your trade is correct you can place your stop order in the ATR Trailing value, it use the(ATR) indicator based in the Wilder's volatility. you can change, the parameters - ATR period (Default = 14) and Times to multiply the ATR (Wilders's)(Default = 3 Times),
Regards
"
Interpretation
Wilder’s Volatility System determines market volatility by calculating a smoothed average of the market price’s true range. True Range, developed by Welles Wilder to deliver a more realistic method to calculate price activity, is an indicator that measures price activity and directional movement and is defined as the distance a price moves per increment of time, e.g. from the lowest price to the highest price in a day. This system measures the trend in volatility in the base instrument, according to the True Range concept. A rising trend line shows a volatility increase in the security. A falling trend line shows a reduction in the instrument’s volatility. The ordinate values are not relevant.
Wilder’s Volatility System alone cannot trigger any trade signals, which means it must be used in conjunction with other indicator systems. A popular use is, for example, the Volatility Breakout System. Average True Range (ATR) represents the foundation for this. The aim of this system is to open a long position, as soon as the base instrument rises above its usual fluctuation margin and a short position as soon as it falls below its usual fluctuation margin.
The Volatility assists the trader in determining the market’s risk potential, as well as buy and sell opportunities. More volatile markets offer a greater risk/reward potential. There are traders who readily take on the risk for the potential of a greater profit, while, at the same time, there are traders who do not want to take such a risk.
"
RK_trader
10-17-2007, 10:30 AM
Thanks PRTester for the information. I appreciate it.
Once you are in a trade, in Ninja can one make this as a "trailing stop strategy", so that in the superdom it automatically trails the stop based on this trailing stop strategy. How can I do this?
Thanks
RK
luitom
10-17-2007, 02:56 PM
I have the same question: How do you create an automated strategy that uses a trailing stop base on the ATR? It could be 1ATR or 0.5ATR, whatever it is, what is the procedure to use it?
I have tried to insert it in the code as user variable but it did not work. Please help
Another question: if you want to use an automated strategy only in real time how do you write the code so that only one open order is sent on the last bart (the active bar of the day in the daily chart) and not in all the other bars?
Thanks
PrTester
10-17-2007, 04:07 PM
I have the same question: How do you create an automated strategy that uses a trailing stop base on the ATR? It could be 1ATR or 0.5ATR, whatever it is, what is the procedure to use it?
I have tried to insert it in the code as user variable but it did not work. Please help
Another question: if you want to use an automated strategy only in real time how do you write the code so that only one open order is sent on the last bart (the active bar of the day in the daily chart) and not in all the other bars?
Thanks
This would help you http://www.ninjatrader-support.com/vb/showthread.php?t=3222
Hope it help,
Regards
NinjaTrader_Josh
10-17-2007, 05:16 PM
Once you find your entry condition and enter the trade in a NinjaScript Strategy the use of SetTrailStop() will do handle the rest.
In addition to the reference sample please also take note of the documentation on the use of SetTrailStop() here: http://www.ninjatrader-support.com/HelpGuideV6/SetTrailStop.html
To make your order real-time only please use this code snippet at the beginning of the OnBarUpdate() method:
if (Historical)
return;http://www.ninjatrader-support.com/HelpGuideV6/Historical.html
luitom
10-17-2007, 05:47 PM
Thanks for your inputs. As I have said I tried to use a variable for the trailing stop but it does not seem to work. I cannot figure out what is wrong below
protected override void Initialize()
{
Variable1 = ((ATR(14)[1] * 0.25) * 100);
SetTrailStop("", CalculationMode.Ticks, Variable1, false);
CalculateOnBarClose = true;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Condition set 1
if (Open[0] < Close[1])
{
EnterLongStopLimit(DefaultQuantity, Close[1]+ (ATR(14)[1]* 0.125), Close[1], "");
NinjaTrader_Josh
10-17-2007, 06:03 PM
When you want to set dynamic trail stops like what you are doing you cannot do it in the Initialize() method. That method is only executed once at the very beginning when you load the indicator and it does not know bar indexing so you cannot refer to indicators from there.
You will need to move your logic into the OnBarUpdate() method. If you don't want it constantly reupdating your SetTrailStop() use a bool variable to only allow it to set itself once and never again.
if (definedTrailStop == false)
{
Variable1 = ((ATR(14)[1] * 0.25) * 100);
SetTrailStop("", CalculationMode.Ticks, Variable1, false);
definedTrailStop = true;
}
Gumphrie
10-24-2007, 11:35 AM
Thanks PrTester, its appreciated. Very useful indicator.
RK_trader
10-24-2007, 10:29 PM
Hi PrTester or Luitom,
Did you have success using it in a superdom atm strategy, so that the stop automatically trails using this strategy in realtime.
Anyone else tried using this in atm strategy?I appreciate your comments.
Thanks
RK
PrTester
10-25-2007, 03:37 AM
RK_trader,
I don't try it in an ATM strategy, but I have sucess in an automatic ninjascript strategy, This would help you http://www.ninjatrader-support.com/v...ead.php?t=3222
Best Regards
RK_trader
10-25-2007, 08:18 AM
Thanks PrTester.
The link you provided is going out of Ninja. Were you trying to point to this link:
http://www.ninjatrader-support.com/vb/showthread.php?t=3222
Thanks
RK
PrTester
10-25-2007, 05:06 PM
Thanks PrTester.
The link you provided is going out of Ninja. Were you trying to point to this link:
http://www.ninjatrader-support.com/vb/showthread.php?t=3222
Thanks
RK
Yes, Sorry
RK_trader
10-25-2007, 08:48 PM
Thanks PrTester. I appreciate your contribution.
Thanks
RK
evnpar72
10-27-2007, 11:58 PM
Did anyone get this ATR trailing stop programmed as a strategy? This is exactly what I am trying to accomplish. I am attempting to use a simple entry technique and then create a trailing ATR stop that adjusts based on volatility. But I am new to scripting and have been unsuccessful so far. Any further suggetions would be greatly appreciated.
PrTester
10-28-2007, 04:09 AM
evnpar72,
This would help you http://www.ninjatrader-support.com/vb/showthread.php?t=3222
Hope it help,
Regards
richa61416
10-28-2007, 07:18 AM
IS it not easier to just pay 99.00 one time and own the VStop by PowerZone? (http://www.powerzonetrading.com/ninjatrader.htm ) That is what I have considered doing. It does the same Volatility stops, and it seems to have a trend indicator as well. I figure it is not a bad price. Saves me about 1 or 2 days programming but hey I have it after.
PrTester
10-28-2007, 07:43 AM
IS it not easier to just pay 99.00 one time and own the VStop by PowerZone? (http://www.powerzonetrading.com/ninjatrader.htm ) That is what I have considered doing. It does the same Volatility stops, and it seems to have a trend indicator as well. I figure it is not a bad price. Saves me about 1 or 2 days programming but hey I have it after.
richa61416,
Most of these indicator are protected and you don't have access to the values thru a standard Ninja Script Strategy, I don't know if this is the case but if I were you, I'll ask first.
Regards
richa61416
10-28-2007, 08:49 AM
Thanks. I think I will ask, before I buy, just to make sure I can reference the values.
richa61416
10-29-2007, 12:08 PM
Thanks PRTester. You were correct. I sent the guys an email about referencing the indicators and got back the response below. I guess I do have to code my own Vstop.
Thanks for your interest in the PowerZone Trading VSTOPS indicator package for NinjaTrader. The value for the current stop level is displayed in the “show data box.” At this point, this value cannot be referenced from an outside indicator or strategy.
PrTester
10-29-2007, 05:47 PM
richa61416,
I hope this ATR Trailing help you start.
Regards
fragalles
11-05-2007, 07:02 PM
hello can someone upload the ATR trailing stop as an atm strategy
or if not possible
as simple strategy that basically buys at the market open and stays in the trade als long as the ATR trailstop is holding?
:)
PrTester
12-07-2007, 08:23 PM
I fix some lines and add anothers to the code in order to run with a Ratched Percent - http://forum.equis.com/forums/thread/22879.aspx . If you have any strategy referring this indicator BEWARE you need to update the strategy because this indicator now has another parameter.
Regards
Betty
03-19-2008, 07:41 PM
For anyone who is interested, PowerZone Trading now has a free strategy upgrade (once you purchase the indicator) that allows you to reference the VSTOPS values in a strategy. They did not offer this when the indicator was first released for NinjaTrader, but it is available now.
lentrader1
03-31-2008, 08:44 AM
For anyone who is interested, PowerZone Trading now has a free strategy upgrade (once you purchase the indicator) that allows you to reference the VSTOPS values in a strategy. They did not offer this when the indicator was first released for NinjaTrader, but it is available now.
Hi Betty
thanks for your information in the Forum. I have the VSTOPS and it's running well.
I'm new with NT, no experience yet with Strategy building.
Question: Can you publish here the Strategy, where you implemented the VSTOPS in your Strategy?
Thx Heinz
I got this message from LEE powerzonetrading:
It sounds like you installed the strategy upgrade correctly. Step #7 is just a check to confirm VSTOPS is available from within the strategy. At this point you can call the VSTOPS level from within a strategy.
Please note that this is NOT a strategy, it simply allows you to use the VSTOPS values in a strategy that you write yourself. I would recommend consulting the NinjaTrader documentation for instructions on writing a complete trading strategy.
Good trading,
Lee Leibfarth
PowerZone Trading
www.PowerZoneTrading.com (http://www.PowerZoneTrading.com)
honvl
11-08-2008, 12:30 PM
Hello.
I am trying to use ATRTrailing in my strategy but it is not trailing at all. What is wrong with my code? Much thanks.
protected override void OnBarUpdate()
{
// ATR Trailing Stop
if (Position.MarketPosition == MarketPosition.Flat)
{
SetStopLoss(CalculationMode.Ticks, 30);
}
// If a long position is open, allow for stop loss modification to ATR
else if (Position.MarketPosition == MarketPosition.Long)
{
SetStopLoss(CalculationMode.Price, ATRTrailing(2, 10, 0.005).Lower[0]);
}
else if (Position.MarketPosition == MarketPosition.Short)
{
SetStopLoss(CalculationMode.Price, ATRTrailing(2, 10, 0.005).Upper[0]);
}
}
PrTester
11-08-2008, 04:09 PM
Hello.
I am trying to use ATRTrailing in my strategy but it is not trailing at all. What is wrong with my code? Much thanks.
protected override void OnBarUpdate()
{
// ATR Trailing Stop
if (Position.MarketPosition == MarketPosition.Flat)
{
SetStopLoss(CalculationMode.Ticks, 30);
}
// If a long position is open, allow for stop loss modification to ATR
else if (Position.MarketPosition == MarketPosition.Long)
{
SetStopLoss(CalculationMode.Price, ATRTrailing(2, 10, 0.005).Lower[0]);
}
else if (Position.MarketPosition == MarketPosition.Short)
{
SetStopLoss(CalculationMode.Price, ATRTrailing(2, 10, 0.005).Upper[0]);
}
}
Try Using ATRTrailing(2, 10, 0.005).Upper[0] for Long and ATRTrailing(2, 10, 0.005).Lower[0] for short.
rtj4201
07-03-2009, 05:16 PM
Does the VStop PowerZoneTrading indicator also funciton as a full trading stop for buys or sells?
Savatage
01-02-2010, 01:19 PM
I'm still not able to program the ATR trailing stop into a simple strategy. I cannot select the ATR-indicator in the last screen of the strategy wizard ('Stop loss and profit targets'). I've also tried to enter the ATR-Trailing stop in the 'Conditions and Actions' section, but then the stop is not calculated from the last entry signal ...
I've already spent several hours on this issue :(
NinjaTrader_Bertrand
01-02-2010, 01:40 PM
Unfortunately this is not suitable for being added in the stop and targets section, you would need to setup a condition to detect a close above / below the stop and then exit via your desired order.
JamTheTrader
04-10-2010, 05:36 AM
Is it possible to enter with a stop order or market order manually, then have the ATR kick in and trail with an automated exit when the bar CLOSES above/below the ATR
Thanks,
JAM
NinjaTrader_Ben
04-11-2010, 11:34 PM
Hello,
I am sorry this is not supported.