This is read-only version of AFL library entry. Ability to add user formulas
and comment is only available from members-only area.
Details:
Formula name:
ATR Study
Author/Uploader:
steve wiser - slwiserr [at] erols.com
Date/Time added:
2001-11-23 18:09:31
Origin:
Keywords:
ATR
Level:
medium
Flags:
system,exploration,indicator
DISCLAIMER: Most formulas present in AFL on-line library are submitted
by the users and are provided here on an "as is" and "as available" basis.
AmiBroker.com
makes no representations or warranties of any kind to the contents or the operation
of material presented here. We do not maintain nor provide technical support
for 3rd party formulas. Description:
This was simply a study at seeing how I could use the ATR function in a trading system.
System settings:
25 $ per trade
Buy and sell on signal one day delay for both
Start equity of $10000
Long trades only on daily selection
Stops controlled by code
Marek Chlopek mchlopek [at] post.pl 2001-11-26 14:22:40
Steve,
The system is simply too good that it could be true ;-)
I have some problems to understand buy/sell prices.
Could you please explain in few (or more then few ;-) words this part bellow:
Buy = Cross(C,Graph8) AND C>Graph9 AND LinRegSlope(EMA(C,17),2)>0;
Sell = Cross(Graph8,C) AND LinRegSlope(C,2)<0;
How I can invest at the price Low or High when there is the gap between Sell/BuyPrice and H/L?
What does also mean two lines of code:
Exclude = MA(V,50)<200 ;
Filter= (Buy OR Sell) ;
Thanks,
Marek
Marek Chlopek mchlopek [at] post.pl 2001-11-26 14:23:48
Steve,
The system is simply too good that it could be true ;-)
I have some problems to understand buy/sell prices.
Could you please explain in few (or more then few ;-) words this part bellow:
Buy = Cross(C,Graph8) AND C>Graph9 AND LinRegSlope(EMA(C,17),2)>0;
Sell = Cross(Graph8,C) AND LinRegSlope(C,2)<0;
I'm studying your system, but I also need an help on how to use this very interesting system.
Thanks, Luca
K Quamme kquamme [at] hotmail.com 2002-05-10 12:20:56
I believe this system is suffering from a crystel ball effect. (Using future data to make a buy decision)
The Buy/Sell decisions use the Close data, but
===>Buy = Cross(C,Graph8) AND C>Graph9 AND LinRegSlope(EMA(C,17),2)>0;
the BuyPrice and SellPrice:
===>BuyStop = Ref(Graph8,-1)+ ticker;
===>BuyPrice = Max(BuyStop,Low);
If I am reading this correctly if BuyStop is less than the low for the day the BuyPrice is set to the low, but we can't buy at the low for the day because the Buy is determined by the closing price.
I don't think this system could be traded effectively.
Or am I missing something?
-KQ
Robert Gervais WinWallStreet [at] AOL>\ 2002-08-18 04:00:55
Steve
I've been working on the same system as you and getting similar results my buys and sells are not as complicated as yours. but I'am using an adaptive approach and letting market conditions determine the ATRMultiplier, HHV(period), and ATR(period). In this you not only have buy/sells but short/cover and when to stay out, as this is very good in indicating trend/trade zones.
Will upload my system when finished.
Robert Gervais WinWallStreet [at] AOL>\ 2002-08-18 04:00:55
Steve
I've been working on the same system as you and getting similar results my buys and sells are not as complicated as yours. but I'am using an adaptive approach and letting market conditions determine the ATRMultiplier, HHV(period), and ATR(period). In this you not only have buy/sells but short/cover and when to stay out, as this is very good in indicating trend/trade zones.
Will upload my system when finished.
Robert Gervais WinWallStreet [at] AOL>\ 2002-08-18 04:00:55
Steve
I've been working on the same system as you and getting similar results my buys and sells are not as complicated as yours. but I'am using an adaptive approach and letting market conditions determine the ATRMultiplier, HHV(period), and ATR(period). In this you not only have buy/sells but short/cover and when to stay out, as this is very good in indicating trend/trade zones.
Will upload my system when finished.
Mark Bremer Formula with dynaorder 2003-01-09 02:49:22
Is anybody out there who is able to program a dll - working together with "dynaorder" (order execution system) and this ATR-Study?
help could be find under:
http://www.dynaorder.com/efs-examples.asp
You need to program the system using AMIBroker Formula language with calling DO functions.
Who can help?
Hans Baier mediabroadcast [at] yahoo.de 2003-01-10 08:00:02
Hello Steve!
I´m actually working with the ATR-Study and its really impressing!
In the "Automatic Analysis" Modus - i´m using a 12 Minutes time frame in the backtest settings. The Backtest is up to 5% te last 7 days! But i have still a problem. The system produce too much signals by itself. Is it possible to modify the formula that it produce signals by a 12 minutes time frame only? Then i could use the Alert-Function for buy and sell signals.
Who can help me?
Greetings
Hans Baier mediabroadcast [at] yahoo.de 2003-01-10 08:00:23
Hello Steve!
I´m actually working with the ATR-Study and its really impressing!
In the "Automatic Analysis" Modus - i´m using a 12 Minutes time frame in the backtest settings. The Backtest is up to 5% te last 7 days! But i have still a problem. The system produce too much signals by itself. Is it possible to modify the formula that it produce signals by a 12 minutes time frame only? Then i could use the Alert-Function for buy and sell signals.
Who can help me?
Dear Steve
I have downloaded your above formula and uploaded in Amibroker, but I didn't see anything but graph only. In interpretation window i get following
Long/Sell
Close
17 Ma Vol
% 17/50
17 C ma
50 C ma
BuyPrice
Sellprice
but not any signal or value. How to get the value ?
Mayoor
Ron ronecooper [at] adelphia.net 2003-11-13 13:06:43
Steve,
This is intriguing. However, the buyprice and sellprice seem to require realtime pricing rather than eod pricing in order to achieve the buys and sells at the prices indicated. If you were to use eod pricing and have the buy or sell occur in the next day of trading, how could you set up backtesting to show an average price for the next day? Any help with this would be appreciated.
Ron ronecooper [at] adelphia.net 2003-11-13 14:11:11
Steve,
Your description says that you are using a one day delay for both buy and sell signals. I have set up an alertif function to give the indicated buy and sell signals. It appears rare if not impossible to buy or sell at the buyprice or sellprice given on the next day of trading. Am I missing something or am I looking at the system a day late?
Brian brianrichard99 [at] hotmail.com 2004-06-18 16:34:59
I tested this system against my own (which does not use ATR whatsoever), and used the same specifications. This system performed less than half as well as mine did, using hourly data over a 5-month period. I like to test systems using the more realistic code:
Signal is generated basing on Close (which we don't know yet) crossing Graph8 (which has H of today which we don't know) and using yesterday price ;-)(which we can't buy)
The comments above makes sense. Loophole in the system is you are buying at lowest price of day when the signal is generated based on closing price. Hence in practice its not possible.
Adding the following 2 lines will make the results realistic but still impressive!
// buy at open next day after signal
SetTradeDelays(1, 1, 1, 1);
BuyPrice = Open; SellPrice = Open;
Your method is based on buy at breaking short-term resistance, sell on breaking short-term resistance-turned-support. It yields good results, however a catch is the high number of trades, which after including commissions and slippages it is harder to implement in practice.
Perhaps experimenting with a longer term timeframe can yield interesting results?
// buying next day after signal at open
SetTradeDelays(1, 1, 1, 1);
BuyPrice = Open; SellPrice = Open;
Your method is based buy on breaking short-term resistance, sell on breaking the short-term resistance-turned-support. It yield good results, however a catch is the high number of trades, which after including commissions and slippages it is harder to implement in practice.
Perhaps experimenting with a longer term timeframe can yield interesting results?
The comments above makes sense. Loophole in the system is you are buying at lowest price of day when the signal is generated based on closing price. Hence in practice its not possible.
Adding the following 2 lines will make the results realistic but still impressive!
// buy at open next day after signal
SetTradeDelays(1, 1, 1, 1);
BuyPrice = Open; SellPrice = Open;
Your method is based on buy at breaking short-term resistance, sell on breaking short-term resistance-turned-support. It yields good results, however a catch is the high number of trades, which after including commissions and slippages it is harder to implement in practice.
Perhaps experimenting with a longer term timeframe can yield interesting results?
// buying next day after signal at open
SetTradeDelays(1, 1, 1, 1);
BuyPrice = Open; SellPrice = Open;
Your method is based buy on breaking short-term resistance, sell on breaking the short-term resistance-turned-support. It yield good results, however a catch is the high number of trades, which after including commissions and slippages it is harder to implement in practice.
Perhaps experimenting with a longer term timeframe can yield interesting results?
Amibroker backtester is often arbitrary for uninitiated. E.g. it assigns the best available price between h/l if a limit order is out of range. This practice is extremely misleading. Other factors can make a huge difference in test results, such as choice among average, open, close, high, or low price in entry/exit. This kind makes backtester not only useless, but often waste user a lot of time. This script result falls into as an example. What a shame!
Tomasz Janeczko tj [at] amibroker.com 2009-10-19 10:22:22
You have completely WRONG conception about how backtester works. The backtester WILL NOT assign \\\'aribitrary\\\' values to anything but only
values that YOU HAVE SET in the settings.
Also if the TRADE PRICE that YOU HAVE coded is outside of H-L range than it won\\\'t allow you to trade on such outside of range prices (and will use either H if your price is too high and L if it is too low).
No program is able to think instead of the user and it is user responsibility to fix HIS/HER errors.
Each formula that uses buyprice/sellprice MUST CHECK for high/low if you are trying to implement \\\"limit order\\\".