Registered User Joined: 1/5/2007 Posts: 21 
	 | 
	
		I am intrigued by Ron Black's article and would like to know if the code is possible in whatever form in Tc 2000.  The code is follows from the magazine in EasyLanguage: 
 
hH = H; 
lL = L; 
lH = H; 
hL = L; 
upsw = 0; 
swLine = 0; 
 
if upsw = 1 then  
     if H > hH then hH = H 
     if L > hL then hL = L 
     if H < hL then  { swing changes to down} 
          upsw = 0; 
          IL = L; 
          IH = H; 
     end 
end 
 
if upsw = 0 then 
     if L < IL then IL = L; 
     if H < IH then IH = H; 
     if L > IH then  {swing changes to the up} 
          upsw = 1; 
          hH = H; 
          hL = L; 
     end 
end 
 
if upsw = 1 then plot1 (hL, "SwLine", cyan); 
if upsw = 0 then plot1 (IH, "SwLine", magenta); 
 
This is out of my league for PCF writing I have found, so I ask if any trainers or other bright PCF writers out there can help.  I'm thinking of it as a possible %true indicator as I know TC can't paint individual bars from user PCFs.  This looks like an alwals in indicator which switches from long to short and back, fwiw.  Thanks in advance for your thoughts and support. 
 
dnhoward
	 | 
	 | 
	
	
	
		Registered User Joined: 4/10/2006 Posts: 954 
	 | 
	
		 stockfinder 5  
 
_Indicator_ 
 
'|****************************************************************** 
'|*** StockFinder RealCode Indicator - Version 5.0 www.worden.com  
'|*** Copy and paste this header and code into StockFinder ********* 
'|*** Indicator:Clear Method 
'|*** Example: plot = price.close - price.close(1) 
'|****************************************************************** 
 
Dim hH As Double 
Dim IL As Double 
Dim IH As Double 
Dim hL As Double 
Dim upsw As Integer 
Dim swLine As Integer 
   
  
hH = price.High 
IL = price.low 
IH = price.high 
hL = price.Low 
upsw = 0 
swLine = 0 
If ( upsw = 1 ) Then  
 If price.high > hH Then hH = price.High 
 If price.low > hL Then hL = price.Low 
 If price.High Then 
  upsw = 0 
  IL = price.Low 
  IH = price.High 
 End If 
End If 
If upsw = 0 Then 
 If price.low < IL Then  
  IL = price.low 
 End If 
 If price.high < IH Then  
  IH = price.high 
 End If 
 If price.low > IH Then 
  upsw = 1 
  hH = price.high 
  hL = price.low 
 End If 
End If 
If upsw = 1 Then plot = hL 
If upsw = 0 Then plot = IH 
------------- tc 2000 ---------------   
not sure yet. 
	 | 
	 | 
	
	
	
		Registered User Joined: 4/10/2006 Posts: 954 
	 | 
	
		 
Think these are better:   Mine has errors. 
 
   http://forums.worden.com/default.aspx?g=posts&t=48747&find=unread 
   http://forums.worden.com/default.aspx?g=posts&t=48749&find=unread 
 
Of coarse none answer the TC200x question.  Still pondering that one.
	 | 
	 | 
	
	
	
		 
   Worden Trainer
  Joined: 10/7/2004 Posts: 65,138 
	 | 
	
		I cannot think of a way to create a Personal Criteria Formula for this that would be short enough to be practical in TeleChart.
  -Bruce Personal Criteria Formulas TC2000 Support Articles
	 | 
	 | 
	
	
	
		Registered User Joined: 1/5/2007 Posts: 21 
	 | 
	
		 I've moved on to use stockfinder, to new to it.  How can I get My Paint Scheme which holds The Clear Method, that has realcode in it, to be a condition for my watchlist??   Thanks! 
	 | 
	 | 
	
	
	
		 
   Worden Trainer
  Joined: 10/7/2004 Posts: 65,138 
	 | 
	
		A RealCode Condition that should Pass when the Color Scheme changes from Red to Green could be written as: 
 
'|*****************************************************************| 
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com  
'|*** Copy and paste this header and code into StockFinder ********* 
'|*** Condition:Clear Red to Green 
'|****************************************************************** 
Static Swing As Integer 
Static HighestLow As Single 
Static LowestHigh As Single 
If isFirstBar Then 
    Swing = 0 
    HighestLow = Price.Low 
    LowestHigh = Price.High 
End If 
HighestLow = System.Math.Max(HighestLow, Price.Low) 
LowestHigh = System.Math.Min(LowestHigh, Price.High) 
If Price.Low > LowestHigh Then 
    If Swing = -1 Then 
        Pass 
    End If 
    Swing = 1 
    HighestLow = Price.Low 
    LowestHigh = Price.High 
Else If Price.High < HighestLow Then 
    Swing = -1 
    HighestLow = Price.Low 
    LowestHigh = Price.High 
End If 
 
A RealCode Condition that should Pass when the Color Scheme changes from Green to Red could be written as: 
 
'|*****************************************************************| 
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com  
'|*** Copy and paste this header and code into StockFinder ********* 
'|*** Condition:Clear Green to Red 
'|****************************************************************** 
Static Swing As Integer 
Static HighestLow As Single 
Static LowestHigh As Single 
If isFirstBar Then 
    Swing = 0 
    HighestLow = Price.Low 
    LowestHigh = Price.High 
End If 
HighestLow = System.Math.Max(HighestLow, Price.Low) 
LowestHigh = System.Math.Min(LowestHigh, Price.High) 
If Price.Low > LowestHigh Then 
    Swing = 1 
    HighestLow = Price.Low 
    LowestHigh = Price.High 
Else If Price.High < HighestLow Then 
    If Swing = 1 Then 
        Pass 
    End If 
    Swing = -1 
    HighestLow = Price.Low 
    LowestHigh = Price.High 
End If
  -Bruce Personal Criteria Formulas TC2000 Support Articles
	 | 
	 | 
	
	
	
		Registered User Joined: 1/5/2007 Posts: 21 
	 | 
	
		Thanks a lot Bruce!
	 | 
	 | 
	
	
	
		Registered User Joined: 10/27/2004 Posts: 821 Location: Philly area 
	 | 
	
		Where did I goof?  Using a copy from here on the Green to Red transition, I get a RealCode Condition error that says PASS in not declared.
	 | 
	 | 
	
	
	
		Registered User Joined: 10/27/2004 Posts: 821 Location: Philly area 
	 | 
	
		OOPS again.  Scratch another question from me.  Took a restart from scratch and I now have both the Clear Noice plot from TASC but Also the transition arrows. 
 
Thanks to all who beat me to it. 
 
And Thanks Bruce for all the postings and instructions.
	 | 
	 | 
	
	
	
		 
   Worden Trainer
  Joined: 10/7/2004 Posts: 65,138 
	 | 
	
		jschott, 
You're welcome. I'm happy to read you were able to find the posts answering your questions.
  -Bruce Personal Criteria Formulas TC2000 Support Articles
	 | 
	 | 
	
	
	
		Registered User Joined: 4/29/2006 Posts: 75 
	 | 
	
		QUOTE (dnhoward)    I am intrigued by Ron Black's article and would like to know if the code is possible in whatever form in Tc 2000.  The code is follows from the magazine in EasyLanguage:   
Try this PCF in a percent true custom indicator and plot it in the middle of the window. Set the draw color to green; the draw style to normal; check the visible box; set the smoothing average to 1; and select the exponential setting (really doesn't matter as the smoothing average is 1). 
 
Copy and paste this PCF into the Boolean Formula box and click close. Then save your chart window. This formula used on a daily chart will closely approximate the idea from Ron Black's Short Term Swings. It takes several of the popular indicators and combines them into one easy to read indicator. 
 
(MS1 > XAVG(MS1,4) and  TSV28 >= XAVG(TSV28,4)) or  ((( - 136) *AVG(XAVGC12,4) + 24 * AVG(XAVGC26,4) + 112 * AVG(XAVGC9,4)) / 51 > ((( -136) * AVG(XAVGC12.1,4) + 24 * AVG(XAVGC26.1,4) + 112 * AVG(XAVGC9.1,4)) /51) AND  AVG(OBV,4) > AVG(OBV1.1,4)) 
 
Regards, Richard
	 | 
	 | 
	
	
	
		Registered User Joined: 4/29/2006 Posts: 75 
	 | 
	
		 Here are a couple of oscillators to add to the percent true indicator above. These give interesting clues when they are both near the bottom and start ascending in sync inside the green indicator when condition is true. Or when they are both near the top and start descending in sync outside the green indicator when condition is false. Another interesting outcome is observed when the two oscillators have a visual difference of more than 50% and are starting to change direction. 
 
The short term oscillator custom indicator settings: Put this also in the middle window and set the draw color to yellow, the draw style to normal, check the visible box, uncheck the zero line and the plot using price scale boxes, smoothing average set to one, and simple. 
 
PCF:     (STOC5.4 + RSI5.4) / 2 
=========================== 
 
The long term oscillator custom indicator settings: Put this also in the middle window and set the draw color to magenta, the draw style to normal, check the visible box, uncheck the zero line and the plot using price scale boxes, smoothing average set to one, and simple. 
 
PCF:     (STOC21.4 + STOC55.4 + RSI13.4 + RSI21.4) / 4 
Thanks to all who contribute to these forums and a special thanks to the trainers who brilliantly show us how to use these formulas! 
 
Regards, Richard 
	 | 
	 | 
	
	
	
		Registered User Joined: 4/29/2006 Posts: 75 
	 | 
	
		 I thought I would pass on some additional tools to use if you find the above PCFs and indicators of value. 
The PCF above and shown here for reference: 
((MS1 >= XAVG(MS1,4) AND TSV28 >= XAVG(TSV28,4)) OR ((( - 136) * AVG(XAVGC12,4) + 24 * AVG(XAVGC26,4) + 112 * AVG(XAVGC9,4)) / 51 >= ((( - 136) * AVG(XAVGC12.1,4) + 24 * AVG(XAVGC26.1,4) + 112 * AVG(XAVGC9.1,4)) / 51) AND XAVG(OBV1,4) >= XAVG(OBV1.1,4))) 
can be included in a PCF and sorted to find those stocks in an uptrend. This PCF uses the popular indicators including Money Stream, TSV, MACD, and On Balance Volume. It compares the current value to the short-term average of four bars and looks for the majority to be indicating an uptrend. 
Taking this one step further by adding the Boolean operator for the condition NOT being true yesterday, we can expand the PCF and sort for stocks where and uptrend may be starting today. The PCF then becomes: 
((MS1 >= XAVG(MS1,4) AND TSV28 >= XAVG(TSV28,4)) OR ((( - 136) * AVG(XAVGC12,4) + 24 * AVG(XAVGC26,4) + 112 * AVG(XAVGC9,4)) / 51 >= ((( - 136) * AVG(XAVGC12.1,4) + 24 * AVG(XAVGC26.1,4) + 112 * AVG(XAVGC9.1,4)) / 51) AND XAVG(OBV1,4) >= XAVG(OBV1.1,4))) AND NOT((MS1.1 >= XAVG(MS1.1,4) AND TSV28.1 >= XAVG(TSV28.1,4)) OR ((( - 136) * AVG(XAVGC12.1,4) + 24 * AVG(XAVGC26.1,4) + 112 * AVG(XAVGC9.1,4)) / 51 >= ((( - 136) * AVG(XAVGC12.2,4) + 24 * AVG(XAVGC26.2,4) + 112 * AVG(XAVGC9.2,4)) / 51) AND XAVG(OBV1.1,4) >= XAVG(OBV1.2,4))) 
I use the top PCF in one watch list tab and the second PCF in the next tab to the right. When the condition is true the word "TRUE" shows up in the column. That way you can see the stocks where the uptrend is starting today in the left column and the stocks where the uptrend is continuing in the column to the right. 
If you have other ideas to enhance the value of these tools, please let me know. 
Best regards, Richard 
  
	 | 
	 | 
	
	
	
		Registered User Joined: 4/29/2006 Posts: 75 
	 | 
	
		 CORRECTION: The two PCFs above are install in adjacent columns under one watchlist tab so they can be seen side-by-side. I incorrectly stated that they should be installed in adjacent watchlist tabs, which would make them impossible to see side-by-side. 
  
My bad, Richard 
	 | 
	 | 
	
	
	
		Registered User Joined: 1/28/2005 Posts: 6,049 
	 | 
	
		 Those are some interesting indicators InvestAlert. 
 
I usually like to see %true indicators on the price chart. 
 
If you put a true false inside the ABS() function it will equal 1 when true and zero when false. 
This allows you to multiply by price so that it equals price or zero. 
(this allows you to plot true/false in the price window but not go above price) 
 
Using your first PCF I have a few examples: 
The first goes to the low of the bar. 
Then one for 1% below the low. 
Then one with an averge of the low. (just to show there are many options how to set it up) 
 
 
Remember, it goes in the top window. 
Its an indicator not a % true. (because now it has values) 
Select: "Plot using price scale".  
 
 
 
 
To the Low: 
 
ABS((MS1 > XAVG(MS1,4) and  TSV28 >= XAVG(TSV28,4)) or  ((( - 136) *AVG(XAVGC12,4) + 24 * AVG(XAVGC26,4) + 112 * AVG(XAVGC9,4)) / 51 > ((( -136) * AVG(XAVGC12.1,4) + 24 * AVG(XAVGC26.1,4) + 112 * AVG(XAVGC9.1,4)) /51) AND  AVG(OBV,4) > AVG(OBV1.1,4)))*L 
 
1% below the Low 
 
ABS((MS1 > XAVG(MS1,4) and  TSV28 >= XAVG(TSV28,4)) or  ((( - 136) *AVG(XAVGC12,4) + 24 * AVG(XAVGC26,4) + 112 * AVG(XAVGC9,4)) / 51 > ((( -136) * AVG(XAVGC12.1,4) + 24 * AVG(XAVGC26.1,4) + 112 * AVG(XAVGC9.1,4)) /51) AND  AVG(OBV,4) > AVG(OBV1.1,4)))*L*.99 
 
3 period exp. avg of the low: 
 
ABS((MS1 > XAVG(MS1,4) and  TSV28 >= XAVG(TSV28,4)) or  ((( - 136) *AVG(XAVGC12,4) + 24 * AVG(XAVGC26,4) + 112 * AVG(XAVGC9,4)) / 51 > ((( -136) * AVG(XAVGC12.1,4) + 24 * AVG(XAVGC26.1,4) + 112 * AVG(XAVGC9.1,4)) /51) AND  AVG(OBV,4) > AVG(OBV1.1,4)))*XAVGL3 
 
 
Just thought Id throw that out there if you are interested. 
 
ABS(true/false PCF)*some price function 
 
 
 
 
Thanks 
diceman 
  
  
  
	 | 
	 | 
	
	
	
		Registered User Joined: 3/8/2011 Posts: 3 
	 | 
	
		 Stock finder has paint scheme function. How TC2000 v11. Can we get paint scheme in TC2000 v11?. I could not find that. 
Thanks. 
Natahnk 
	 | 
	 | 
	
	
	
		 
   Worden Trainer
  Joined: 10/7/2004 Posts: 65,138 
	 | 
	
		kailayanathank, 
The TC2000.com version 11 beta does not currently have the paint feature that is part of StockFinder. 
 
The best way to influence what will be in TC2000.com is to actively   participate in the TC2000.com version 11 beta. All questions, comments   and suggestions related to the TC2000.com version 11 beta should be   addressed to: 
 
feedback@tc2000.com
  -Bruce Personal Criteria Formulas TC2000 Support Articles
	 | 
	 | 
| 
Guest-1 |