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

RE: [amibroker] values of previous stoch crosses.



PureBytes Links

Trading Reference Links




Ron, 

this 
may get you started. First adjust the Over sold level to your pref. Not knowing 
what y is I assumed it to be the previous close of your stochk crossover. This 
may or may not be what you want but perhaps you can use it as a framework to get 
what you want. Paste the code to the explorer to see the 
results....
<SPAN 
class=875100318-14082003> 
Regards, 
Jayson 
<FONT 
face=Tahoma><FONT color=#0000ff 
face=Arial> 
<FONT 
face=Tahoma><FONT color=#282828 
size=2> 
OS=30; <FONT color=#008000 
size=2>//oversold 
level
<FONT color=#282828 
face=Arial size=2> <FONT 
color=#0000ff>
test=Cross(<FONT 
size=2>StochK(14<FONT 
size=2>),StochD(<FONT 
size=2>14))<FONT color=#282828 
size=2>;<FONT 
face=Arial>
test1= Ref(<FONT 
size=2>StochK(14<FONT 
size=2>),-1)<Os <FONT 
size=2>AND test; 
//finds a cross 
below the threshold and accepts a cross that drives the stchd above the thresh 
hold today
<FONT color=#282828 
face=Arial size=2> <FONT 
color=#0000ff>
Cond1=test1 AND<FONT 
face=Arial> <FONT 
size=2>ValueWhen(test1,<FONT 
size=2>StochK(14<FONT 
size=2>),1)>=<FONT 
size=2>ValueWhen(test1,<FONT 
size=2>StochK(14<FONT 
size=2>),2<FONT color=#282828 
size=2>);
<FONT color=#000000 
size=2> 
Filter=C<FONT 
size=2>>0<FONT color=#282828 
size=2>;<FONT 
color=#0000ff size=2>
AddColumn(test1,<FONT 
color=#ff00ff size=2>"test1"<FONT 
face=Arial>);
AddColumn(Cond1,<FONT 
color=#ff00ff size=2>"higher cross"<FONT color=#282828 
size=2>); 

AddColumn(<FONT color=#0000ff 
size=2>ValueWhen(test1,<FONT 
color=#0000ff size=2>StochK(<FONT 
color=#ff00ff size=2>14),<FONT 
color=#ff00ff size=2>1)<FONT 
color=#282828 size=2>,"This cross"<FONT 
color=#282828 size=2>);<FONT color=#0000ff 
size=2>
AddColumn(<FONT color=#0000ff 
size=2>ValueWhen(test1,<FONT 
color=#0000ff size=2>StochK(<FONT 
color=#ff00ff size=2>14),<FONT 
color=#ff00ff size=2>2)<FONT 
color=#282828 size=2>,"Prev Cross"<FONT 
color=#282828 size=2>);
<DIV align=left class=OutlookMessageHeader 
dir=ltr> 
<FONT 
face=Tahoma> 
<FONT 
face=Tahoma> 
<FONT 
face=Tahoma> -----Original 
Message-----From: mrdavis9 
[mailto:mrdavis9@xxxxxxxxxx]Sent: Thursday, August 14, 2003 4:01 
AMTo: amibrokeryahoogroupsCc: jeff 
davisSubject: [amibroker] values of previous stoch 
crosses.
 
 
 
 
 
 
 
 
 
 
 
 
This post is another attempt to get some help in creating 
the additional coding that I need . I thank Jayson for responding to my first 
post which detailed why I want to add additional coding to 
my scans which include stoch crossings.    Based on my 
chart observations, this additional coding would  greatly improve the 
accuracy of any scan which includes the oversold condition 
of        
cross(stochk(14),stochd(14))      This AFL language and 
technical terms are  a real challenge to me.  However, I think 
 that IIF will probably do what I want to do, but I can't quite grasp 
 the technical terms  that are being discussed in the below 
pasted TJ comments.  I have never used this IIF feature prior to now.  

 
Once AFL finds an oversold stoch crossing at 
value X,  I want it to compare this X value to the last oversold 
value of Y.   If this previous value Y is higher than the X value, 
than I want AFL to forget about it.  However, if this previous value of Y 
is lower than the present value of X, then I want AFL to approve of the present 
stoch crossing that it found, and report it to me as OK.  I am going 
to paste below my first post below so that  you will  have a 
complete understanding of what it is that  I want to 
do.)     TIA for any help with this.   
Ron   
D

 
 
<FONT face=Arial 
size=2>=======================================================================================
THIS IS THE ORIGIONAL POST,
These comments are based on what I 
see by looking at charts, I think that all scans which include 
cross( stochk(14), stochd(14));  can be improved, but I am not 
experienced enough to code this possible improvement.  IMHO there are 
two code modules that would improve stoch crossing scans. .  The first 
of these modules would function as follows:  It would tell a scan that 
when it finds  a stoch crossing, it must look back to all of the 
previous  buy and sell stoch crossings that occurred consecutively 
while still under the stochastic value  of 35.  This condition is what 
I refer to as stochastic kissing.  The purpose of this code 
module is to prevent a buy signal when it discovers that kissing is 
happening.  The other code module  would look back to at 
least to the most previous  buy type crossing, and 
it would prevent a  buy arrow based on the value at which the 
last buy type stoch crossing occurred.  It will prevent a buy arrow if the 
last buy crossing occurred at a stochastic value greater than the current 
stochastic value under consideration.  This module would  allow a 
buy arrow only if the present stochastic value is greater that the stochastic 
value of the previous cross.   I have other things in my buy scans, 
but these code modules would improve any buy type scans that include the stoch 
cross AFL function.  The inverse logic of this would also improve those 
scans that are looking for shorts.  TIA for any ideas or comments. Ron 
D
  
 
<FONT face=Arial 
size=2>=======================================================================================
 Send 
BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
suggest@xxxxxxxxxxxxx-----------------------------------------Post 
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
group FAQ at: <A 
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Your use of Yahoo! Groups is subject to the <A 
href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor


  ADVERTISEMENT 









Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.