logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Steviet  
#1 Posted : Wednesday, August 16, 2023 9:36:09 PM(UTC)
Steviet

Rank: Newbie

Groups: Registered Users, Subscribers, Unverified Users
Joined: 1/23/2015(UTC)
Posts: 5

Was thanked: 4 time(s) in 4 post(s)

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.

Edited by user Wednesday, August 16, 2023 9:46:20 PM(UTC)  | Reason: Tidy up

MS Support  
#2 Posted : Thursday, August 17, 2023 2:57:12 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,934

Thanks: 85 times
Was thanked: 154 time(s) in 150 post(s)
Originally Posted by: Steviet Go to Quoted Post

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.

thanks 1 user thanked MS Support for this useful post.
mattmct5619 on 11/24/2023(UTC)
Steviet  
#3 Posted : Monday, August 21, 2023 10:09:18 PM(UTC)
Steviet

Rank: Newbie

Groups: Registered Users, Subscribers, Unverified Users
Joined: 1/23/2015(UTC)
Posts: 5

Was thanked: 4 time(s) in 4 post(s)
Thanks, that makes sense. I'll check and let you know.
thanks 1 user thanked Steviet for this useful post.
mattmct5619 on 11/24/2023(UTC)
Steviet  
#4 Posted : Thursday, December 14, 2023 2:08:54 AM(UTC)
Steviet

Rank: Newbie

Groups: Registered Users, Subscribers, Unverified Users
Joined: 1/23/2015(UTC)
Posts: 5

Was thanked: 4 time(s) in 4 post(s)
Yes, that did the trick! thanks for the help (sorry for the late reply)
thanks 1 user thanked Steviet for this useful post.
MS Support on 12/14/2023(UTC)
Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.