Discussions
»
Product and Service Development
»
Formula Assistance
»
Indicator: How to Subtract Time Frames & plot in its own window
Rank: Member
Groups: Registered, Registered Users Joined: 11/27/2007(UTC) Posts: 15
|
Dear Forum,
I kindly enlist your expertise in solving a programming issue with me. Programming is not my forte but I tried to use examples out of the forum, the Metastock formula help file and the internet to come up with the following formula. It unfortunately does not plot correctly and I am at a lost as to where to start to look. What I have been requested to do is the following: * Indicator to plot in its own window * 60 minute chart as basis * Two close/open/high/low positions of different specific times. For example 10h00 and 19h00. * Subtract these two close/open/high/low positions from each other and plot this value as an indicator.
Any suggestions as to my efforts below would be highly appreciated.
{ Time Inputs } StHour:=Input("start Hour",0,23,6); StMin:=Input("start Minute",0,59,0); EnHour:=Input("last Hour",0,23,9); EnMin:=Input("last Minute",0,59,0); x:=Input("use Open=1 High=2 Low=3 Close=4 Volume=5 P=6",1,6,4);
{ Time period } start:=Hour()>StHour OR Hour()=StHour AND Minute()>=StMin; end:=Hour()<EnHour OR Hour()=EnHour AND Minute()<=EnMin; filter:= start AND (end OR (start AND Alert(start=0,2)));
{ Start/End time signals } start:=filter AND Alert(filter=0,2) AND x; end:=filter=0 AND Alert(filter,2) AND x;
{ Plot in own window } start-end
Many thanks in advance, Magda
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
Hi Magda,
I assume you have the PRO version of MS as you are dealing with intraday data?
The other aspect is to use the ValueWhen() function to determine the required price at the start of the period and the end of the period.
Hope this helps.
wabbit [:D]
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Discussions
»
Product and Service Development
»
Formula Assistance
»
Indicator: How to Subtract Time Frames & plot in its own window
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.