[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EquisMetaStock Group] Re: Hi_ low Yesterday on all charts



PureBytes Links

Trading Reference Links

Adapted from
http://www.metastocktools.com/MACDH/Forex.htm :

========================
OHLC - previous period's
========================
---8<---------------------------------------

{ Previous period's OHLC v1.0
  Warning: chart's first data bar is ignored.
  Adapted from:
  http://www.metastocktools.com/MACDH/Forex.htm

©Copyright 2004~2006 Jose Silva.
 The grant of this license is for personal use
  only - no resale or repackaging allowed.
 All code remains the property of Jose Silva.
 http://metastocktools.com }

{ User input }
type:=Input("OHLC values: [1]Day, [2]Week, [3]Month, [4]Year",1,4,1);

{ Day's start }
DayStart:=DayOfMonth()<>Ref(DayOfMonth(),-1);

{ Week's start - reference "Calendar Week
 counter" indicator for accurate weekly signals}
WkStart:=DayOfWeek()<Ref(DayOfWeek(),-1);

{ Month's start }
MthStart:=Month()<>Ref(Month(),-1);

{ Year's start }
YrStart:=Year()<>Ref(Year(),-1);

{ Selected Daily/Weekly/Monthly/Yearly }
start1:=If(type=1,DayStart,
 If(type=2,WkStart,
 If(type=3,MthStart,YrStart)));
start:=start1 OR Cum(1)=2;

{ Previous period's Open }
Op:=ValueWhen(2,start,O);
Op:=ValueWhen(1,Op<>0,Op);

{ Previous period's High }
Hi:=HighestSince(1,start,H);
Hi:=ValueWhen(1,start,ValueWhen(2,1,Hi));
Hi:=ValueWhen(1,Hi<>0,Hi);

{ Previous period's Low }
Lo:=LowestSince(1,start,L);
Lo:=ValueWhen(1,start,ValueWhen(2,1,Lo));
Lo:=ValueWhen(1,Lo<>0,Lo);

{ Previous period's Close }
Cl:=ValueWhen(1,start1,ValueWhen(2,1,C));
Cl:=ValueWhen(1,Cl<>0,Cl);

{ Plot on price chart }
Op;  { <- Green }
Hi;  { <- Blue }
Lo;  { <- Red }
Cl;  { <- Dk Green }

---8<---------------------------------------


You may also be interested in the following indicator available from 
MetaStockTools.com:

"Auto chart detector - detects Daily/Weekly/Monthly/Quarterly/Yearly 
charts automatically - with application example."


jose '-)
http://www.metastocktools.com




--- In equismetastock@xxxxxxxxxxxxxxx, "geraldnovak" <gbg@xxx> wrote:
>
> I want to modify a Pivot Indciator so that it shows only the pivots 
> for today. 
> 
> I want to have a Daily Pivot Indicator, Weekly Pivot Indicator and 
> Monthly Pivot indicator.  I use real time data and typically follow 
> the daily, 4 hour, 1 hour and 15 minute charts. 
> 
> I would like the ability to have just the three indicators and be 
> able to pull them onto any chart. 
> 
> Lets say the forumula is :
> 
> (H + L + C)/3
> 
> How do I create a formula that just pertains to Yesterday's H, L, C 
> or Last Week's, or Last Months and yet place this on the various 
> charts?
> 
> I realize I can "hard code" the number of periods. And only place a 
> PIVOTS_DAILY_1HOUR on a 1 hour chart, but I was wondering if there 
> was a function that was built in like "previous_day_high" 
> or "previous_day_low" or, if that wasn't the case, if someone had 
> already come up with something. 
> 
> or, it would even be somewhat helpful if I could get the day,
> month, year value of TODAY and have a function that returns what
> time frame I'm on.  That way I could go to TODAY -1 and know the
> number of periods I'm dealing with on any chart.






 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/equismetastock/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:equismetastock-digest@xxxxxxxxxxxxxxx 
    mailto:equismetastock-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/