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

Notification

Icon
Error

Options
Go to last post Go to first unread
LISEA  
#1 Posted : Wednesday, November 10, 2021 9:11:21 AM(UTC)
LISEA

Rank: Newbie

Groups: Registered, Registered Users
Joined: 4/1/2010(UTC)
Posts: 5

Team,

Can any one help me, my requirement is In a Intraday 15 minutes chart interval any candle/bar with in a day crosses above the very first 15 minute high or close. 

Appreciate your help

MS Support  
#2 Posted : Wednesday, November 10, 2021 10:16:06 PM(UTC)
MS Support

Rank: Advanced Member

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

Thanks: 92 times
Was thanked: 155 time(s) in 150 post(s)
Originally Posted by: LISEA Go to Quoted Post

Team,

Can any one help me, my requirement is In a Intraday 15 minutes chart interval any candle/bar with in a day crosses above the very first 15 minute high or close. 

Appreciate your help

This formula can generally help, although it might need to be refined to meet more specific criteria. The formula would need to be used with a 15-minute interval in order to give you 15-minute relevant values.

Code:
newday:=ROC(DayOfWeek(),1,$)<>0;
1stbarhigh:=ValueWhen(1,newday,H);
1stbarclose:=ValueWhen(1,newday,C);
Cross(C,1stbarhigh) OR Cross(C,1stbarclose)

LISEA  
#3 Posted : Thursday, November 11, 2021 6:40:56 AM(UTC)
LISEA

Rank: Newbie

Groups: Registered, Registered Users
Joined: 4/1/2010(UTC)
Posts: 5

Thanks for the formula, but it is validating the High and Close of Previous bar not the very first 15minutes bar of the current day.
LISEA  
#4 Posted : Thursday, November 11, 2021 6:52:05 AM(UTC)
LISEA

Rank: Newbie

Groups: Registered, Registered Users
Joined: 4/1/2010(UTC)
Posts: 5

I am sorry, 1stbarhigh:=ValueWhen(1,newday,H); 1stbarclose:=ValueWhen(1,newday,C); Values of these two are correct, but the cross is not validating it properly. However thanks for the Instant reply.
LISEA  
#5 Posted : Thursday, November 11, 2021 7:09:08 AM(UTC)
LISEA

Rank: Newbie

Groups: Registered, Registered Users
Joined: 4/1/2010(UTC)
Posts: 5

Also I pasted the script in the Explorer, it gives me the error as stated below "Reason for Rejection Error in filter: Period value out of valid range in ROC() function. " Any help please
MS Support  
#6 Posted : Thursday, November 11, 2021 8:16:34 PM(UTC)
MS Support

Rank: Advanced Member

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

Thanks: 92 times
Was thanked: 155 time(s) in 150 post(s)

Originally Posted by: LISEA Go to Quoted Post
Also I pasted the script in the Explorer, it gives me the error as stated below "Reason for Rejection Error in filter: Period value out of valid range in ROC() function. " Any help please

With regards to the Explorer, this is likely an issue when using Load Minimum Records instead loading a fixed amount of records. You could try changing the Load Records in the Explorer to 250 or so to see if this eliminates the ROC() error.

You are right regarding the Cross function, there is a bit of an issue where in order for a Cross to occur, the price must actually go -below- the 1st bar before going -above- the 1st bar. Because of this it may be better to simply use some sort of a Greater Than / Less than instead the Cross function specifically. For example:

Code:
newday:=ROC(DayOfWeek(),1,$)<>0;
1stbarhigh:=ValueWhen(1,newday,H);
1stbarclose:=ValueWhen(1,newday,C);
C > 1stbarclose AND Ref(C,-1) <= 1stbarclose

You could write a similar criteria using the 1stbarhigh if you wanted.

Edited by user Thursday, November 11, 2021 8:17:20 PM(UTC)  | Reason: Not specified

LISEA  
#7 Posted : Thursday, November 25, 2021 9:45:09 AM(UTC)
LISEA

Rank: Newbie

Groups: Registered, Registered Users
Joined: 4/1/2010(UTC)
Posts: 5

I have set the day in the explorer to use current day, but inspite of that exploer is returning the below error, can you please fix this.

Security Name    Reason for Rejection    Location     APL Error in filter: Period value out of valid range in ROC() function.    

MS Support  
#8 Posted : Tuesday, November 30, 2021 3:12:37 PM(UTC)
MS Support

Rank: Advanced Member

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

Thanks: 92 times
Was thanked: 155 time(s) in 150 post(s)
Originally Posted by: LISEA Go to Quoted Post

I have set the day in the explorer to use current day, but inspite of that exploer is returning the below error, can you please fix this.

Security Name    Reason for Rejection    Location     APL Error in filter: Period value out of valid range in ROC() function.    

Hello again,

Which version of MetaStock are you running? You will want to make sure that your Load Options are not set to Load Minimum records otherwise the Explorer will not load enough data to properly calculate. In addition you will want to ensure you are choosing an Intraday interval in the Explorer (such as the 15-Minute Periodicity that you mentioned).

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.