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

RE: Re: [EquisMetaStock Group] pivots



PureBytes Links

Trading Reference Links

Thanks, for example I have this code that works very well on tradestation. How to translate it in
formula language to plot weekly pivots on daily charts & monthly pivots on weekly charts?
I would to plot only "last pivots calculated" (not bands). Excuse me for my english, I hope you
understand. Thanks very much

Vars:Hi1(0),Lo1(0),Cl1(0);
Vars: Pivot(0), Res1(0), Res2(0),Res3(0), Sup1(0), Sup2(0),Sup3(0),x(0);
Arrays:TLId[5](-1),TLVal[5](0); 
If DataCompression= 1 then begin	{intraday ->>>>  S/R daily}
	Hi1=HighD(1);
	Lo1=LowD(1);
	Cl1=CloseD(1);
	Condition1=d<>d[1];
end;
If DataCompression=2 then begin		{daily ->>>>> S/R weekly}
	Hi1=HighW(1);
	Lo1=LowW(1);
	Cl1=CloseW(1);
	Condition1=dayofweek(d)<dayofweek(d[1]);
end;
If DataCompression=3 then begin		{weekly ->>>>>> S/R MOnthly}
	Hi1=HighM(1);
	Lo1=LowM(1);
	Cl1=CloseM(1);
	Condition1=Month(d)<>Month(d[1]);
end;
If DataCompression=4 then begin		{monthly ->>>>>> S/R Yearly}
	Hi1=HighY(1);
	Lo1=LowY(1);
	Cl1=CloseY(1);
	Condition1=Year(d)<>Year(d[1]);
end;

Pivot = (Hi1+Lo1+Cl1)/3; 
Res1=2*Pivot-Lo1;	 	TLVal[0]=Res1;
Sup1=2*Pivot-Hi1; 		TLVal[3]=Sup1;
Res2=Pivot-Sup1+Res1;	TLVal[1]=Res2; 
Sup2=Pivot-Res1+Sup1;	TLVal[4]=Sup2;
Res3=Pivot-Sup2+Res2;	TLVal[2]=Res3;
Sup3=Pivot-Res2+Sup2;	TLVal[5]=Sup3;
If Condition1=True then begin				
	If TLId[0]=-1 then begin							
		TLId[0]=TL_New(d[1], t[1], TLVal[0], d, t, TLVal[0]);
		TLId[1]=TL_New(d[1], t[1], TLVal[1], d, t, TLVal[1]);
		TLId[2]=TL_New(d[1], t[1], TLVal[2], d, t, TLVal[2]);
		TLId[3]=TL_New(d[1], t[1], TLVal[3], d, t, TLVal[3]);
		TLId[4]=TL_New(d[1], t[1], TLVal[4], d, t, TLVal[4]);
		TLId[5]=TL_New(d[1], t[1], TLVal[5], d, t, TLVal[5]);
		For x=0 to 5 begin								
			TL_SetExtLeft(TLId[x], True);
			TL_SetExtRight(TLId[x], True);
			TL_SetStyle(TLId[x], Tool_Dashed);			
		end;
		For x=0 to 2 begin								
			TL_SetColor(TLId[x], Tool_Red);
		end;
		For x=3 to 5 begin
			TL_SetColor(TLId[x], Tool_Green);
		end;
	end else begin
		For x=0 to 5 begin
			TL_SetEnd(TLId[x], d, t, TLVal[x]);
			TL_SetBegin(TLId[x], d[1], t[1], TLVal[x]);
		 end;
	end;
end;	



--- Lionel Issen <lissen@xxxxxxxxxxxxx> ha scritto:

> Roy:
> 
>  
> 
> A thought struck me, couldn't   we use a synthetic month of 4 weeks instead
> of the actual month? In this way the end of the week would correspond to the
> last trading day of the synthetic month.      
> 
>  
> 
> Regards
> 
>  
> 
> Lionel
> 
>  
> 
> From: equismetastock@xxxxxxxxxxxxxxx [mailto:equismetastock@xxxxxxxxxxxxxxx]
> On Behalf Of Roy Larsen
> Sent: Thursday, May 10, 2007 7:02 PM
> To: equismetastock@xxxxxxxxxxxxxxx
> Subject: Re: Re: [EquisMetaStock Group] pivots
> 
>  
> 
> Hi Fulvio
> 
> Yes, most of your suggestions are possible. Plotting monthly pivots on
> weekly data is not though, and that's because weekly dates don't usually
> coincide with the last trading day of a month. Monthly data on daily pivots
> is not a problem. What is your definition "last periods pivots"?
> 
> Regards
> 
> Roy
> www.metastocktips.co.nz
> 
> ----- Original Message ----- 
> From: Fulvio 
> To: equismetastock@xxxxxxxxxxxxxxx <mailto:equismetastock%40yahoogroups.com>
> 
> Sent: Friday, May 11, 2007 11:42 AM
> Subject: Re: [EquisMetaStock Group] pivots
> 
> is it impossible with formula language? Thanks
> 
> --- Fulvio <fulvio1977@xxxxxxxx <mailto:fulvio1977%40yahoo.it> > ha scritto:
> 
> > excuse me for my english. Please, from this formula, we can to build a
> formula that plots only
> > last period's pivots and plots pivots with major timeframe? For example:
> If my chart is daily
> > then metastocks plots last weekly pivots; else if my chart is weekly then
> metastocks plots last
> > monthly pivots; and if my chart is monthly then metastocks plots last
> quaterly or last yearly
> > pivots. Thanks, Fulvio
> > 
> > Dw:=If(DayOfWeek()<=Ref(DayOfWeek(),-1),1,0);
> > {Weekly Typical Price}
> > PP1:=If(Dw=1,
> > {then}(Ref(HighestSince(1,Dw=1,H),-1)+
> > Ref(LowestSince(1,Dw=1,L),-1) +
> > Ref(C,-1))/3,
> > {else}0);
> > {Weekly High}
> > Wh1:=If(Dw=1,
> > {then}Ref(HighestSince(1,Dw=1,H),-1),
> > {else}0);
> > {Weekly Low}
> > Wl1:=If(Dw=1,
> > {then}Ref(LowestSince(1,Dw=1,L),-1),
> > {else}0);
> > Wh:=ValueWhen(1,Wh1>0,Wh1);
> > Wl:=ValueWhen(1,Wl1>0,Wl1);
> > PP:=ValueWhen(1,PP1>0,PP1);
> > {Resistance 1}
> > R1:=(2*PP)-Wl;
> > {Support 1}
> > S1:=(2*PP)-Wh;
> > {Resistance 2}
> > R2:=(PP-S1)+R1;
> > {Support 2}
> > S2:=PP-(R1-S1);
> > {Resistance 3}
> > R3:=PP+2*(R1-S1);
> > {Support 3}
> > S3:=PP-2*(R1-S1);
> > R3;
> > R2;
> > R1;
> > S1;
> > S2;
> > S3;
> > 
> > 
> > 
> > 
> > ___________________________________ 
> > L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail:
> > http://it.docs.yahoo.com/nowyoucan.html
> > 
> > [Non-text portions of this message have been removed]
> > 
> > 
> 
> ___________________________________ 
> L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail: 
> http://it.docs.yahoo.com/nowyoucan.html
> 
> [Non-text portions of this message have been removed]
> 
>  
> 
> 
> 
> [Non-text portions of this message have been removed]
> 
> 



      ___________________________________ 
L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail: http://it.docs.yahoo.com/nowyoucan.html


 
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/