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

Re: [RT] persistence of trend



PureBytes Links

Trading Reference Links

Back in 2003 I looked into something similar to what Jim
has published.
 
Attached is a picture of my application:  C_Lee_CountUp-Dn
applied to the "fast" Gold model we are following.
 
This is modeled after some of Tom DeMark's work in which
he counted number if periods in which the high of today was
higher than the high some number of bars ago.
 
In this application you can select from 1 to 7 and if desired
you can get a printout (shown in attached .txt file) of some
statistics about such intervals.
 
I hope that this can help you determine the likely extent
of whatever length trend you are trading.  Works well on
weekly and monthly charts.
 
For TS8.x users there is an  .eld  file.
For TS2000i users there is an  .els  file but I have not
tested this file, just generated it in TS2K.
 
Clyde
 
= = = = = = = = = = = = = = = = = = = = = = = = = = =
Clyde Lee                                SYTECH Corporation
7910 Westglen                       Phone:  713.783.9540
Suite 105                                    Fax:  713.783.1092
Houston, TX  77063     www.theswingmachine.com
= = = = = = = = = = = = = = = = = = = = = = = = = = =
This e-mail and any attachments may contain confidential and
privileged information. If you are not the intended recipient,
please notify the sender immediately by return e-mail, delete this
e-mail and destroy any copies. Any dissemination or use of this
information by a person other than the intended recipient is
unauthorized and may be illegal.
 
 
----- Original Message -----
From: Jim White
Sent: Tuesday, October 21, 2008 11:28 AM
Subject: [RT] persistence of trend

To those of you interested in Pivot and trend trading, I have an article
appearing in the November issue of Technical Analysis of Stocks and
Commodities that might be of interest.
 
Jim White
Pivot Research & Trading Co.

__._,_.___

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___
 
Data for: @YGZ08   Period 1080729/1081022   Delta=3 @60
 
Up1=  47.00  Up2=  24.00  Up3=  43.00
Dn1=  41.00  Dn2=  28.00  Dn3=  34.00
 
Up4=  26.00  Up5=  11.00  Up6=  10.00  Up7=  10.00
Dn4=  14.00  Dn5=  19.00  Dn6=  11.00  Dn7=  11.00
 
Percent Up5/4=   0.42  Percent Up6/4=   0.38  Percent Up7/4=   0.38
Percent Dn5/4=   1.36  Percent Dn6/4=   0.79  Percent Dn7/4=   0.79
 
Up4barX1Pr=   1.07  Up4barX2Pr=  -0.06  Up4barX3Pr=  -0.69
Up5barX1Pr=  -2.98  Up5barX2Pr=  -5.54  Up5barX3Pr=  -3.43
Up6barX1Pr=  -4.06  Up6barX2Pr=  -3.89  Up6barX3Pr=  -1.55
Up7barX1Pr=  -0.36  Up7barX2Pr=   0.47  Up7barX3Pr=   3.59
 
Dn4barX1Pr=  -2.61  Dn4barX2Pr=  -2.37  Dn4barX3Pr=  -6.91
Dn5barX1Pr=   0.68  Dn5barX2Pr=  -0.85  Dn5barX3Pr=  -0.27
Dn6barX1Pr=  -2.55  Dn6barX2Pr=  -0.53  Dn6barX3Pr=  -3.60
Dn7barX1Pr=   1.39  Dn7barX2Pr=  -2.44  Dn7barX3Pr=  -1.51
 
 



[LegacyColorValue = true]; 

{  Indicator:   C_Lee_CountUp-Down
   Copyright SYTECH Corporation 2003

   Look back a given number of bars and deterine direction of
   close with respect to that prior bar.  Count all up and down
   events and log all the only 1, only 2, only3, ..... counts.

   Also look at price movements after 4,5,6,7 counts.

}


Input:  Price(c),
        BarsBack(2),        {Number bars to look back to determine direction}
        MinCount(2),        {Minimum value before a plot is made            }
        PrntStat(False);    {Set true to print statistics to print log      }

Vars:  UpCount(0),DnCount(0), MP(0);

Vars:  UpCount1(0),UpCount2(0),UpCount3(0);
Vars:  DnCount1(0),DnCount2(0),DnCount3(0);

Vars:  UpCount4(0),UpCount5(0),UpCount6(0),UpCount7(0);
Vars:  DnCount4(0),DnCount5(0),DnCount6(0),DnCount7(0);

Vars:  UpDeltP41(0),UpDeltP42(0),UpDeltP43(0);
Vars:  UpDeltP51(0),UpDeltP52(0),UpDeltP53(0);
Vars:  UpDeltP61(0),UpDeltP62(0),UpDeltP63(0);
Vars:  UpDeltP71(0),UpDeltP72(0),UpDeltP73(0);

Vars:  DnDeltP41(0),DnDeltP42(0),DnDeltP43(0);
Vars:  DnDeltP51(0),DnDeltP52(0),DnDeltP53(0);
Vars:  DnDeltP61(0),DnDeltP62(0),DnDeltP63(0);
Vars:  DnDeltP71(0),DnDeltP72(0),DnDeltP73(0);

Vars:  FirstDate(0),LastDate(0);


LastDate=Date;
If FirstDate=0 then FirstDate=Date;

If Price>Price[BarsBack] then begin
  UpCount=UpCount+1;
  DnCount=0;
  Value1=Text_New(date,time,H,NumToStr(UpCount,0));
  Text_SetStyle(Value1, 2, 1);
  Text_SetColor(Value1,Blue);
  If DnCount[1]=1 then DnCount1=DnCount1+1;
  If DnCount[1]=2 then DnCount2=DnCount2+1;
  If DnCount[1]=3 then DnCount3=DnCount3+1;
  If DnCount[1]=4 then UpCount4=UpCount4+1;
  If DnCount[1]=5 then UpCount5=UpCount5+1;
  If DnCount[1]=6 then UpCount6=UpCount6+1;
  If DnCount[1]=7 then UpCount7=UpCount7+1;
End;

If Price<Price[BarsBack] then begin
  DnCount=DnCount+1;
  UpCount=0;
  Value1=Text_New(date,time,H,NumToStr(DnCount,0));
  Text_SetStyle(Value1, 2, 0);
  Text_SetColor(Value1,Red);
  If UpCount[1]=1 then UpCount1=UpCount1+1;
  If UpCount[1]=2 then UpCount2=UpCount2+1;
  If UpCount[1]=3 then UpCount3=UpCount3+1;
  If UpCount[1]=4 then DnCount4=DnCount4+1;
  If UpCount[1]=5 then DnCount5=DnCount5+1;
  If UpCount[1]=6 then DnCount6=DnCount6+1;
  If UpCount[1]=7 then DnCount7=DnCount7+1;
End;


If CurrentBar>BarsBack then begin
  
  If UpCount>=MinCount then Plot1( UpCount,"U")
                       else Plot1( 0,"U");
  If DnCount>=MinCount then Plot2(-DnCount,"D")
                       else Plot2( 0,"D");
  If UpCount+DnCount<MinCount then begin
    SetPlotColor(1,GetBackgroundColor);
    SetPlotColor(2,GetBackgroundColor);
  End;
  
  {
  MP=MarketPosition;
  If MP<=0 then If UpCount>=MinCount then Buy;
  If MP>=0 then If DnCount>=MinCount then Sell;
  If MP> 0 then If UpCount< MinCount then ExitLong;
  If MP< 0 then If DnCount< MinCount then ExitShort;
  }
End;

If UpCount[1]=4 then UpDeltP41=UpDeltP41+(Price-Price[1]); 
If UpCount[2]=4 then UpDeltP42=UpDeltP42+(Price-Price[2]); 
If UpCount[3]=4 then UpDeltP43=UpDeltP43+(Price-Price[3]); 

If UpCount[1]=5 then UpDeltP51=UpDeltP51+(Price-Price[1]); 
If UpCount[2]=5 then UpDeltP52=UpDeltP52+(Price-Price[2]); 
If UpCount[3]=5 then UpDeltP53=UpDeltP53+(Price-Price[3]); 

If UpCount[1]=6 then UpDeltP61=UpDeltP61+(Price-Price[1]); 
If UpCount[2]=6 then UpDeltP62=UpDeltP62+(Price-Price[2]); 
If UpCount[3]=6 then UpDeltP63=UpDeltP63+(Price-Price[3]); 

If UpCount[1]=7 then UpDeltP71=UpDeltP71+(Price-Price[1]); 
If UpCount[2]=7 then UpDeltP72=UpDeltP72+(Price-Price[2]); 
If UpCount[3]=7 then UpDeltP73=UpDeltP73+(Price-Price[3]); 


If DnCount[1]=4 then DnDeltP41=DnDeltP41+(Price-Price[1]); 
If DnCount[2]=4 then DnDeltP42=DnDeltP42+(Price-Price[2]); 
If DnCount[3]=4 then DnDeltP43=DnDeltP43+(Price-Price[3]); 

If DnCount[1]=5 then DnDeltP51=DnDeltP51+(Price-Price[1]); 
If DnCount[2]=5 then DnDeltP52=DnDeltP52+(Price-Price[2]); 
If DnCount[3]=5 then DnDeltP53=DnDeltP53+(Price-Price[3]); 

If DnCount[1]=6 then DnDeltP61=DnDeltP61+(Price-Price[1]); 
If DnCount[2]=6 then DnDeltP62=DnDeltP62+(Price-Price[2]); 
If DnCount[3]=6 then DnDeltP63=DnDeltP63+(Price-Price[3]); 

If DnCount[1]=7 then DnDeltP71=DnDeltP71+(Price-Price[1]); 
If DnCount[2]=7 then DnDeltP72=DnDeltP72+(Price-Price[2]); 
If DnCount[3]=7 then DnDeltP73=DnDeltP73+(Price-Price[3]); 


If LastBarOnChart and PrntStat then begin
  Print(" ");
  Print(" ");
  Print("Data for: ",GetSymbolName,"   Period ",NumToStr(FirstDate,0),"/",NumToStr(LastDate,0),
        "   Delta=",NumToStr(BarsBack,0)," @",NumToStr(BarMins,0));
  Print(" ");
  Print("Up1=",UpCount1,"  Up2=",UpCount2,"  Up3=",UpCount3);
  Print("Dn1=",DnCount1,"  Dn2=",DnCount2,"  Dn3=",DnCount3);
  Print(" ");
  Print("Up4=",UpCount4,"  Up5=",UpCount5,"  Up6=",UpCount6,"  Up7=",UpCount7);
  Print("Dn4=",DnCount4,"  Dn5=",DnCount5,"  Dn6=",DnCount6,"  Dn7=",DnCount7);
  Print(" ");
  Print("Percent Up5/4=",UpCount5/UpCount4,"  Percent Up6/4=",UpCount6/UpCount4,
    "  Percent Up7/4=",UpCount7/UpCount4);
  Print("Percent Dn5/4=",DnCount5/DnCount4,"  Percent Dn6/4=",DnCount6/DnCount4,
    "  Percent Dn7/4=",DnCount7/DnCount4);
  Print(" ");
  Print("Up4barX1Pr=",UpDeltP41/UpCount4,"  Up4barX2Pr=",UpDeltP42/UpCount4,"  Up4barX3Pr=",UpDeltP43/UpCount4);
  Print("Up5barX1Pr=",UpDeltP51/UpCount5,"  Up5barX2Pr=",UpDeltP52/UpCount5,"  Up5barX3Pr=",UpDeltP53/UpCount5);
  Print("Up6barX1Pr=",UpDeltP61/UpCount6,"  Up6barX2Pr=",UpDeltP62/UpCount6,"  Up6barX3Pr=",UpDeltP63/UpCount6);
  Print("Up7barX1Pr=",UpDeltP71/UpCount7,"  Up7barX2Pr=",UpDeltP72/UpCount7,"  Up7barX3Pr=",UpDeltP73/UpCount7);
  Print(" ");
  Print("Dn4barX1Pr=",DnDeltP41/DnCount4,"  Dn4barX2Pr=",DnDeltP42/DnCount4,"  Dn4barX3Pr=",DnDeltP43/DnCount4);
  Print("Dn5barX1Pr=",DnDeltP51/DnCount5,"  Dn5barX2Pr=",DnDeltP52/DnCount5,"  Dn5barX3Pr=",DnDeltP53/DnCount5);
  Print("Dn6barX1Pr=",DnDeltP61/DnCount6,"  Dn6barX2Pr=",DnDeltP62/DnCount6,"  Dn6barX3Pr=",DnDeltP63/DnCount6);
  Print("Dn7barX1Pr=",DnDeltP71/DnCount7,"  Dn7barX2Pr=",DnDeltP72/DnCount7,"  Dn7barX3Pr=",DnDeltP73/DnCount7);
  Print(" ");
  Print(" ");


End;



[LegacyColorValue = true]; 

{TSPro returns bad value for BarInterval for Daily data}
{Only worry about reported sess1 for daily data        }
	

BarMins=iff(DataCompression>1,Sess1EndTime-Sess1StartTime,BarInterval);



Attachment: Description: Binary data

Attachment: COUNT_UPDN.gif
Description: GIF image

Attachment: Description: Binary data