Rank: Advanced Member
Groups: Moderators, Registered, Registered Users, Subscribers Joined: 10/8/2010(UTC) Posts: 1,960
Thanks: 91 times Was thanked: 155 time(s) in 150 post(s)
|
Originally Posted by: Steviet Hi, I have the following formula as an indicator for ATR based trailing stop:
Code:atrperiod:=Input("ATR period :",1,100,5);
atrfactor:=Input("ATR multiplication :",1,10,4);
loss:=atrfactor*ATR(atrperiod);
Trail:=
If(C>PREV AND Ref(C,-1)>PREV,
Max(PREV,C-loss),
If(C<PREV AND Ref(C,-1)<PREV,
Min(PREV,C+loss),
If(C>PREV,C-loss,C+loss)));
Trail
I've attached it to the price chart and it works really well. When I add that same formula into the exploration, it comes out with different prices: Code:
atrperiod:=5;
atrfactor:=4;
loss:=atrfactor*ATR(atrperiod);
Trail:=
If(C>PREV AND Ref(C,-1)>PREV,
Max(PREV,C-loss),
If(C<PREV AND Ref(C,-1)<PREV,
Min(PREV,C+loss),
If(C>PREV,C-loss,C+loss)));
Trail
For example: On the ADH.AX chart it shows the stop as $1.4341 whereas on the explorer it shows $1.4928 What's worse is that on the chart during a Long period, the stop only goes up (which is the way it is supposed to work), but day to day on the explorer results, the trailing stop goes up AND down during a Long period, which it's not meant to do. This is the same for any chart that I run it against. As it's the explorer values that I'm putting into my trading stops, they're different to the charts that I've based my trading method on. Any ideas on what I'm doing wrong? Thanks! Steve.
Hello, The first thing to check when you find differences between the Explorer and a chart is the load records. While some formulas may not change based on the records loaded (i.e. simple moving averages), other formulas can be sensitive to these differences. The Explorer's "default" setting is to Load Minimum Records. A chart's Default records typically will bring in about 1250 Daily records. If you are running a more recent version of MetaStock, when you open the Power Console and go to the Explorer, you should have a Load Options setting where you can change from Load Minimum Records to Load X Records. I would try setting to this Load 1250 and see if this provides more consistent results. Load Minimum Records is beneficial for speed purposes (especially with Online Data) but in some cases it will be best to have the load records match the data loaded into a chart. Load Minimum Records looks at the formula and attempts to determine the minimum amount of data required to get a calculation. With certain formula functions (i.e. exponential calculations, PREV) this can be problematic as their values can change as you load more data.
|
1 user thanked MS Support for this useful post.
|
|