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

RE: [amibroker] Finding short candles



PureBytes Links

Trading Reference Links




Or 
better yet........ as a percentage of the "Normal" ATR. For instance I monitor 
during the day the percentage of the ATR(1) as compared to the ATR(14) by using 
the code. This also compares today's Vol to its own 50 day 
Vol......
<SPAN 
class=658152413-25062003> 
<FONT 
color=#282828 size=2> 
ATRparm=Param(<FONT 
size=2>"ATR Look Back",14<FONT 
size=2>,10,<FONT 
size=2>50<FONT 
color=#0000ff>);
x=ATR<FONT 
color=#0000ff>(atrparm);
y=(x/C)*<FONT 
size=2>100<FONT 
color=#0000ff>;
z=(ATR(<FONT 
size=2>1)/C<FONT 
size=2>)*100<FONT 
color=#0000ff>;
Vparm=Param(<FONT 
size=2>"Vol MA",50<FONT 
size=2>,10,<FONT 
size=2>200<FONT 
color=#0000ff>);
 
Plot(<FONT color=#000000 
size=2>V,<FONT color=#ff00ff 
size=2>"Volume",<FONT color=#0000ff 
size=2>IIf(<FONT color=#000000 
size=2>C><FONT color=#0000ff 
size=2>Ref(<FONT color=#000000 
size=2>C,-<FONT color=#ff00ff 
size=2>1),<FONT color=#000000 
size=2>colorBrightGreen,<FONT 
color=#000000 size=2>colorRed<FONT color=#282828 
size=2>),2<FONT color=#282828 
size=2>|styleThick<FONT 
color=#282828 size=2>);
Plot(<FONT color=#0000ff 
size=2>MA(<FONT color=#000000 
size=2>V,vparm),<FONT color=#ff00ff 
size=2>"Vol Average " ,<FONT 
color=#000000 size=2>colorYellow<FONT color=#282828 
size=2>,4); 

Value1=ATR(<FONT 
size=2>1)/y*10<FONT color=#282828 
size=2>;<FONT color=#0000ff 
size=2>
Plot(value1/<FONT color=#0000ff 
size=2>ATR(atrparm ),<FONT 
color=#ff00ff size=2>"ATR",<FONT 
color=#ff00ff size=2>4,<FONT 
color=#ff00ff size=2>1) ; <FONT 
color=#0000ff size=2>
Plot(y,<FONT color=#ff00ff 
size=2>"% of Vol Average "+<FONT 
color=#0000ff size=2>WriteVal(<FONT 
color=#000000 size=2>V/<FONT 
color=#0000ff size=2>MA(<FONT 
color=#000000 size=2>V,vparm)*<FONT 
color=#ff00ff size=2>100,<FONT 
color=#ff00ff size=2>1.0) +<FONT 
color=#ff00ff size=2>"%"+<FONT 
color=#ff00ff size=2>" ATR %" ,<FONT 
color=#000000 size=2>colorWhite<FONT color=#282828 
size=2>,styleOwnScale<FONT 
color=#282828 size=2> |1<FONT 
color=#282828 size=2>);
 
GraphXSpace=3<FONT 
color=#282828 size=2>;
 
Title="% of Vol 
Average = "+WriteVal<FONT 
size=2>(V/<FONT 
size=2>MA(V<FONT 
size=2>,vparm)*100,<FONT 
size=2>1.0) +"%"<FONT 
color=#282828 size=2>+<FONT color=#ff00ff 
size=2>
"\nToday's Percent of ATR"+<FONT 
size=2>WriteVal(z/y)+ "%"<FONT 
size=2>+ "\n ATR % = "+<FONT 
size=2>WriteVal(y)+WriteIf<FONT 
size=2>(V<<FONT 
size=2>MA(V<FONT 
size=2>,50)/<FONT 
size=2>2," Very Little 
Volume",""); 
WriteVal(Value1)+ " 
Percent of the normal ATR"<FONT 
color=#0000ff>; 
 
 
Regards, 
Jayson 
<FONT face=Tahoma 
size=2>-----Original Message-----From: Jayson 
[mailto:jcasavant@xxxxxxxxxxx]Sent: Wednesday, June 25, 2003 9:02 
AMTo: amibroker@xxxxxxxxxxxxxxxSubject: RE: [amibroker] 
Finding short candles
<SPAN 
class=850485512-25062003>Ron,
A 
short candle could also be easily measured as a small value of ATR(1). You may 
try to find candidates by simply running an AA then sorting by ATR(1), or 
ATR(10) for your 10- day average. You could also plot the ATR to see the 
direction of range that the stock is currently trading in.
 
Regards, 
Jayson 
<FONT face=Tahoma 
size=2>-----Original Message-----From: mrdavis9 
[mailto:mrdavis9@xxxxxxxxxx]Sent: Wednesday, June 25, 2003 3:58 
AMTo: amibrokeryahoogroupsCc: jeff 
davisSubject: [amibroker] Finding short candles

I searched the Library for flat bases, and consolidations, 
and came up with nothing.   I am barely starting to 
comprehend a few aspects of  AFL coding.   I found an 
indicator that I used as a model in my attempt to try to make an indicator 
that would visually show when the distance between the open and close 
is diminishing or expanding  The first code below is 
my MODIFICATION  of the Indicator that I used as a model. 
The second code below is the ACTUAL INDICATOR  that I used as the 
model. My attempt failed to work.    My real  goal 
is  to have  scans  that will be able to identify flat 
bases, as well as  other consolidation patterns.   Buy 
and sell arrows are not necessary for what  I am wanting. 
  I will then need to be able run this scan on  stocks whose 
prices move up and down rapidly. I could then place an OCO order (one 
cancels other) and catch it whichever way that  it breaks out of the 
consolidation pattern.  Suggestions for improvements, as well as 
 original codes for consolidation patterns will be appreciated.  Ron 
D  
 
<FONT face=Arial 
size=2>===========================================================================
 
This is my effort
"Todays Open = "+<FONT color=#0000ff 
size=1>WriteVal(O,<FONT color=#ff00ff 
size=1>1.2);
"Todays Close = "+<FONT color=#0000ff 
size=1>WriteVal(C,<FONT color=#ff00ff 
size=1>1.2);
"Distance Open to Close = "+<FONT color=#0000ff 
size=1>WriteVal(<FONT color=#0000ff 
size=1>abs(O-C),<FONT color=#ff00ff 
size=1>1.3);
 
"Largest Distance = "+<FONT color=#0000ff 
size=1>WriteVal(<FONT color=#0000ff 
size=1>Max(abs<FONT 
size=1>(O-C)),1.3<FONT 
size=1> );
 
"Smallest Distance = "+<FONT color=#0000ff 
size=1>WriteVal(<FONT color=#0000ff 
size=1>Min(abs<FONT 
size=1>(O-C)) ,1.3<FONT 
size=1> );
 
Plot( <FONT color=#0000ff 
size=1>Max( <FONT color=#0000ff 
size=1>abs(O-C) )<FONT 
size=1>," Highest"<FONT 
size=1>,colorGreen,styleLine);
 
Plot( Min<FONT 
size=1>( abs<FONT 
size=1>(O-C) ), <FONT color=#ff00ff 
size=1>" Smallest"<FONT 
size=1>,colorRed,styleLine);
<FONT 
size=1>====================================================================
This is the code used as a model
 

/*this is an attempt to determine 
the market range AND expansion AND market opens. The idea is to give an 


idea of the potential risks AND rewards for any trade taken during 
the Day, by knowing what A typical trading Day looks like. 
I would need to do catalog the following: 
Open
Low
High
Close
the distance from the Open to the Low
the distance from the Open to the High
the distance from the Open to the Close
the smallest distance from the Open for that Day
the largest distance from the Open for that Day
Then I would like to Plot the following:
the 10 Day average of the smallest distance 
the 10 Day average of the largest distance*/<FONT 
size=1>
"Todays Open = "+<FONT color=#0000ff 
size=1>WriteVal(O,<FONT color=#ff00ff 
size=1>1.2);
"Todays Low = "+<FONT color=#0000ff 
size=1>WriteVal(L,<FONT color=#ff00ff 
size=1>1.2);
"Todays High = "+<FONT color=#0000ff 
size=1>WriteVal(H,<FONT color=#ff00ff 
size=1>1.2);
"Todays Close = "+<FONT color=#0000ff 
size=1>WriteVal(C,<FONT color=#ff00ff 
size=1>1.2);
"Distance Open to Low = "+<FONT color=#0000ff 
size=1>WriteVal(<FONT color=#0000ff 
size=1>abs(O-L),<FONT color=#ff00ff 
size=1>1.3);
"Distance Open to High = "+<FONT color=#0000ff 
size=1>WriteVal(<FONT color=#0000ff 
size=1>abs(O-H),<FONT color=#ff00ff 
size=1>1.3);
"Distance Open to Close = "+<FONT color=#0000ff 
size=1>WriteVal(<FONT color=#0000ff 
size=1>abs(O-C),<FONT color=#ff00ff 
size=1>1.3);
"Largest Distance = "+<FONT color=#0000ff 
size=1>WriteVal(<FONT color=#0000ff 
size=1>Max( <FONT color=#0000ff 
size=1>Max(abs<FONT 
size=1>(O-L),abs<FONT 
size=1>(O-H) ) ,abs<FONT 
size=1>(O-C) ),1.3<FONT 
size=1> );
"Smallest Distance = "+<FONT color=#0000ff 
size=1>WriteVal(<FONT color=#0000ff 
size=1>Min(Min<FONT 
size=1>(abs<FONT 
size=1>(O-L),abs<FONT 
size=1>(O-H) ),abs<FONT 
size=1>(O-C) ),1.3<FONT 
size=1> );
Largest10Avg = MA( 
Max( <FONT 
color=#0000ff size=1>Max(<FONT color=#0000ff 
size=1>abs(O-L),<FONT color=#0000ff 
size=1>abs(O-H)) ,<FONT color=#0000ff 
size=1>abs(O-C) ),<FONT color=#ff00ff 
size=1>10) ;
Smallest10Avg = MA( 
Min( <FONT 
color=#0000ff size=1>Min(<FONT color=#0000ff 
size=1>abs(O-L),<FONT color=#0000ff 
size=1>abs(O-H) ) ,<FONT color=#0000ff 
size=1>abs(O-C) ) ,<FONT color=#ff00ff 
size=1>10) ;
Plot(MA<FONT 
size=1>( Max( <FONT 
color=#0000ff size=1>Max(<FONT color=#0000ff 
size=1>abs(O-L),<FONT color=#0000ff 
size=1>abs(O-H)) ,<FONT color=#0000ff 
size=1>abs(O-C) ),<FONT color=#ff00ff 
size=1>10) ,"10MA 
Highest"<FONT 
size=1>,colorGreen,styleLine);<FONT color=#0000ff 
size=1>
Plot(MA<FONT 
size=1>( Min( <FONT 
color=#0000ff size=1>Min(<FONT color=#0000ff 
size=1>abs(O-L),<FONT color=#0000ff 
size=1>abs(O-H) ) ,<FONT color=#0000ff 
size=1>abs(O-C) ) ,<FONT color=#ff00ff 
size=1>10), "10MA 
Smallest",colorRed,styleLine); 

 

 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. 
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












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.