PureBytes Links
Trading Reference Links
|
Here is a second version, corrects the first.:
EnableScript ( "jscript" );
<%
comfirmDays= 3;
boxAtHighConfirm=1;
startState=comfirmDays+ 1; endState=startState+comfirmDays;
Low = VBArray( AFL ( "L" ) ).toArray();
High = VBArray( AFL ( "H") ).toArray();
boxArr1 = new Array(); boxArr2 = new Array();
stateArr = new Array();
state = stateArr[ 0] = 1;
boxStart = 0;
boxTop = High[ 0]; boxBot = 0; swap=0;
function fillBox(start, end) {
if (boxAtHighConfirm)
{
for
(j=end-1;
stateArr[j+1]!=1; j--)
{
boxArr1[j] = swap ? boxTop : boxBot;
boxArr2[j] = swap ? boxBot : boxTop;
}
oldBot = swap ? boxArr1[start- 1] : boxArr2[start-1];
lineLevel = boxBot > oldBot ? boxBot : boxTop;
for (k=start; k<=j;
k++)
boxArr1[k] = boxArr2[k] = lineLevel;
}
else
for (j=start; j<end;
j++) {
boxArr1[j] = swap ? boxTop : boxBot;
boxArr2[j] = swap ? boxBot : boxTop;
}
}
for (i=1; i<Low.length; i++) {
if (state==endState)
{
if (boxBot>Low[i] ||
boxTop<High[i]) {
fillBox(boxStart, i);
state = 1; swap
= !swap;
boxTop = High[i]; boxStart = i;
}
}
else if (boxTop>High[i]) {
if
((state<startState) || (boxBot<Low[i]) ) state++;
else
state=startState;
if (state==startState)
boxBot=Low[i];
}
else {
state= 1;
boxTop=High[i]; }
stateArr[i] = state;
}
fillBox(boxStart, Low.length);
AFL.Var( "boxSide1") = boxArr1;
AFL.Var( "boxSide2") = boxArr2;
AFL.Var( "state")
= stateArr;
AFL.Var( "endState") = endState;
%>
Plot (C, "", 1, 128);
Plot (boxSide1, "Side1", state+1,512);
Plot (boxSide2, "Side2", state+1,512);
boxTop = Max(boxSide1,boxSide2); boxBot = Min(boxSide1,boxSide2);
endBox = Ref(state==endState, -1);
Buy = H> Ref(boxTop,-1)
AND endBox; Sell = L<Ref(boxBot,-1)
AND endBox;
BuyPrice = IIf(Open>Ref(boxTop,-1),
Open, Ref(boxTop,-1)
);
SellPrice = IIf(Open<Ref(boxBot,-1),
Open, Ref(boxBot,-1)
);
Title= "DarvaBox for:"+Name()
+" state("+WriteVal(state,1)+")"
+ " Bottom:"+WriteVal(boxBot,
1.2)
+ " Top:"+WriteVal(boxTop,1.2);
----- Original Message -----
Sent: Monday, March 21, 2005 8:50
PM
Subject: Re: [amibroker] Re: Coding
assistance.
Anthony,
I am glad to but I have not learn how to take a shoot at the graph and I
would like to learn how to attach picture that is display in the email so the
viewers don't have to download.
Alex,
Could you show what this looks like in Metastock chart
Anthony
----- Original Message -----
Sent: Monday, March 21, 2005 7:19
PM
Subject: Re: [amibroker] Re: Coding
assistance.
Anthony,
Yes this code is a conversion from metastock "How I made 2 million on
the stockmarket" by Jason Prestwidge. The
bottom is original of code.
Periods:=Input("periods",1,260,260); Topbox:=If(Ref(H,-3)>=Ref(HHV(H,Periods),-4) AND
Ref(H,-2)<Ref(H,-3) AND Ref(H,-1)<Ref(H,-3) AND H<
Ref(H,-3),Ref(H,-3),PREVIOUS);
Botbox:=If(Ref(H,-3)>=Ref(HHV(H,Periods),-4) AND
Ref(H,-2)<Ref(H,-3) AND Ref(H,-1)<Ref(H,-3) AND H<
Ref(H,-3),LLV(L,4),PREVIOUS);
Topbox; Botbox;
Anthony Faragasso
<ajf1111@xxxxxxxx> wrote:
Alex,
This code you have posted is incomplete , is this a
conversion from metastock ?
Do you have original ?
Can you explain what this code in english ?
Anthony
----- Original Message -----
Sent: Monday, March 21, 2005 6:49
PM
Subject: Re: [amibroker] Re:
Coding assistance.
Anthony,
Periods=Param("periods",260,1,260,1);
Topbox=IIf(Ref(H,-3)>=Ref(HHV(H,Periods),-4) AND Ref(H,-2)<Ref(H,-3)
AND Ref(H,-1)<Ref(H,-3)
AND H< Ref(H,-3),Ref(H,-3),PREVIOUS);
Plot (Topbox,"Topbox",colorRed,1);
Botbox= IIf(Ref(H,-3)>=Ref(HHV(H,Periods),-4) AND
Ref (H,-2)<Ref(H,-3) AND
Ref(H,-1)<Ref(H,-3) AND
H< Ref(H,-3),LLV(L,4),PREVIOUS);
Plot (Botbox,"Botbox",colorGreen,1);
That's the code but I don't know
"PREVIOUS" what they prefer
to!!! Anthony Faragasso
<ajf1111@xxxxxxxx> wrote:
Tom,
Try this:
Cond=L > Ref(L,-1) AND H > Ref(H,-1);
Cond2= BarsSince(Cond < 1);
Filter= 1;
AddColumn (Cond2,"");
----- Original Message -----
Sent: Monday, March 21, 2005
4:35 PM
Subject: RE: [amibroker] Re:
Coding assistance.
Is it possible to have Higher Highs AND Higher
Lows show at the same time.
Thank you
Tom
trendingup= BarsSince(L < Ref(L,-1));
trendingdown= BarsSince(H > Ref(H,-1));
Filter= 1;
AddColumn (trendingup,"up",1);
AddColumn (trendingdown,"down",1);
----- Original Message -----
Sent: Monday, March 21,
2005 2:04 PM
Subject: RE: [amibroker]
Re: Coding assistance.
Anthony,
Again, thank you. What I am trying to determine is
how many days in a row the stock is setting higher highs and
higher lows, as opposed to a moving average. Is this possible to
code?
Tom
-----Original Message----- From: Anthony
Faragasso [mailto:ajf1111@xxxxxxxx] Sent: Saturday,
March 19, 2005 4:17 PM To: amibroker@xxxxxxxxxxxxxxx Subject:
Re: [amibroker] Re: Coding assistance.
Tom,
You have yet to define what you consider as
trending....here is another sample:
periods= Param("periods",10,1,100,1);//N period moving
average
trendingup= BarsSince(L < MA(L,periods));
trendingdown= BarsSince(H > MA(H,periods));
Filter= 1;
AddColumn (trendingup,"up",1);
AddColumn (trendingdown,"down",1);
Anthony
----- Original Message -----
Sent: Friday, March 18,
2005 5:53 PM
Subject: RE: [amibroker]
Re: Coding assistance.
Thank you. I ran your script and realized that I
asked the wrong question. What I am trying to determine is if
the price has been in a "continuous" up or down trend for n
periods.
Tom
Depends on how you want to define trending Higher
or lower..Here is a sample explore...
//Automatic analysis
//Explore
//all symbols
//n last quotations
//n=1
periods= 10;
trending= ROC(C,periods);
trendingUP=trending > 0;
trendingDown=trending < 0;
state= WriteIf(trendingup,"trendingUP for ("+WriteVal(periods,1)+") periods ","trendingdown
for ("+WriteVal(periods,1)+")periods");
Filter= 1;
AddTextColumn (state,"State");
----- Original Message -----
Sent: Friday, March 18,
2005 12:39 PM
Subject: [amibroker]
Re: Coding assistance.
Would someone be able to tell me how to write
a condition to a scan that says 'if prices are trending
either higher or lower for n periods'?
Thank you
Tom
Please note
that this group is for discussion between users
only.
To get support from AmiBroker please send an
e-mail directly to SUPPORT {at} amibroker.com
For
other support material please check also: http://www.amibroker.com/support.html
No virus found in this incoming message. Checked
by AVG Anti-Virus. Version: 7.0.308 / Virus Database:
266.7.3 - Release Date:
3/15/2005
Please note that this
group is for discussion between users only.
To get
support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support
material please check also: http://www.amibroker.com/support.html
Please
note that this group is for discussion between users
only.
To get support from AmiBroker please send an
e-mail directly to SUPPORT {at} amibroker.com
For
other support material please check also: http://www.amibroker.com/support.html
No virus found in this incoming message. Checked by
AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.7.3
- Release Date: 3/15/2005
Please
note that this group is for discussion between users
only.
To get support from AmiBroker please send an e-mail
directly to SUPPORT {at} amibroker.com
For other
support material please check also: http://www.amibroker.com/support.html
Please
note that this group is for discussion between users
only.
To get support from AmiBroker please send an e-mail
directly to SUPPORT {at} amibroker.com
For other
support material please check also: http://www.amibroker.com/support.html
No virus found in this incoming message. Checked by
AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.7.4 -
Release Date: 3/18/2005
Please note
that this group is for discussion between users only.
To
get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support material
please check also: http://www.amibroker.com/support.html
Please
note that this group is for discussion between users
only.
To get support from AmiBroker please send an e-mail
directly to SUPPORT {at} amibroker.com
For other
support material please check also: http://www.amibroker.com/support.html
No virus found in this incoming message. Checked by AVG
Anti-Virus. Version: 7.0.308 / Virus Database: 266.7.4 -
Release Date: 3/18/2005
Please note that
this group is for discussion between users only.
To get
support from AmiBroker please send an e-mail directly to SUPPORT
{at} amibroker.com
For other support material please check
also: http://www.amibroker.com/support.html
No
virus found in this outgoing message. Checked by AVG
Anti-Virus. Version: 7.0.308 / Virus Database: 266.7.4 - Release
Date: 3/18/2005
__________________________________________________ Do You
Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection
around http://mail.yahoo.com
Please note that this
group is for discussion between users only.
To get support from
AmiBroker please send an e-mail directly to SUPPORT {at}
amibroker.com
For other support material please check
also: http://www.amibroker.com/support.html
No virus found in this incoming message. Checked by AVG
Anti-Virus. Version: 7.0.308 / Virus Database: 266.7.4 - Release
Date: 3/18/2005
Please note that this group
is for discussion between users only.
To get support from
AmiBroker please send an e-mail directly to SUPPORT {at}
amibroker.com
For other support material please check also: http://www.amibroker.com/support.html
No
virus found in this outgoing message. Checked by AVG
Anti-Virus. Version: 7.0.308 / Virus Database: 266.7.4 - Release
Date: 3/18/2005
Do you Yahoo!? Yahoo! Small Business - Try
our new resources site!
Please note that this group is for
discussion between users only.
To get support from AmiBroker please
send an e-mail directly to SUPPORT {at} amibroker.com
For other
support material please check also: http://www.amibroker.com/support.html
No virus found in this incoming message. Checked by AVG
Anti-Virus. Version: 7.0.308 / Virus Database: 266.7.4 - Release Date:
3/18/2005
Please note that this group is for
discussion between users only.
To get support from AmiBroker please
send an e-mail directly to SUPPORT {at} amibroker.com
For other
support material please check also: http://www.amibroker.com/support.html
No
virus found in this outgoing message. Checked by AVG
Anti-Virus. Version: 7.0.308 / Virus Database: 266.7.4 - Release Date:
3/18/2005
Do you Yahoo!? Yahoo! Small Business - Try
our new resources site!
Please note that this group is for
discussion between users only.
To get support from AmiBroker please
send an e-mail directly to SUPPORT {at} amibroker.com
For other
support material please check also: http://www.amibroker.com/support.html
No virus found in this incoming message. Checked by AVG
Anti-Virus. Version: 7.0.308 / Virus Database: 266.7.4 - Release Date:
3/18/2005
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Sponsor |
ADVERTISEMENT
| |
|
Yahoo! Groups Links
|
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.4 - Release Date: 3/18/2005
|