PureBytes Links
Trading Reference Links
|
you must figure your purpose with applystop, but
again !!! something is not obvious for me with it and I prefer the
rem.dll
perhaps because I know it better ( it is not
advertising for this dll )
//Pivot Point PT with applystop
PP= Avg;
R1=(PP * 2) -
Low;
//R2= PP + High - Low;
S1= (PP * 2) -
High;
//S2 = PP - High + Low;
Buy = Low < S1;
target= ValueWhen<FONT
size=1>(Buy,R1);
Plot(s1,""<FONT
size=1>,colorBlack,1<FONT
size=1>);
Plot(target,<FONT color=#ff00ff
size=1>"",colorPink,<FONT color=#ff00ff
size=1>1);
Sell=0;
BuyPrice= Min<FONT
size=1>(Open,S1);
ApplyStop (stopTypeProfit, stopModePoint,
Target -BuyPrice<FONT
size=1>,True<FONT
size=1>,False)
;
Plot(Close,<FONT color=#ff00ff
size=1>"close",colorBlack,<FONT color=#ff00ff
size=1>64);
Equity(1<FONT
size=1>);
PlotShapes(<FONT color=#0000ff
size=1>IIf(Buy,
shapeUpArrow,shapeNone),colorGreen,<FONT
color=#ff00ff size=1>0,C,-<FONT color=#ff00ff
size=1>10);
PlotShapes(<FONT color=#0000ff
size=1>IIf(Sell,
shapeDownArrow,shapeNone),colorRed,<FONT
color=#ff00ff size=1>0,H,-<FONT color=#ff00ff
size=1>20);
/////////with
Rem//////////////////
//Pivot Point PT
PP= Avg;
R1=(PP * 2) -
Low;
//R2= PP + High - Low;
S1= (PP * 2) -
High;
//S2 = PP - High + Low;
Buy = Low < S1;
entryPrice = Min<FONT
size=1>(Open,S1);
stopprice=L;
stoploss=-1;
trailstop=-1;
target= ValueWhen<FONT
size=1>(Buy,R1);
exit=0;<FONT
color=#0000ff size=1>
Plot(s1,""<FONT
size=1>,colorBlack,1<FONT
size=1>);
Plot(target,<FONT color=#ff00ff
size=1>"",colorPink,<FONT color=#ff00ff
size=1>1);
/********* KEEP the ORDER***********/
scRemBuyTrail(Buy,Entryprice,StopPrice,
StopLoss,TrailStop,Target,Exit);
Buy=enterlong;
Sell=exitlong;
BuyPrice=Entryprice;<FONT color=#008000
size=1>/*array*/
SellPrice=SellPr;<FONT color=#008000
size=1>/*array*/
Plot(<FONT color=#0000ff
size=1>ValueWhen(Sell,SellPr),<FONT
color=#ff00ff size=1>"SellPr"<FONT
size=1>,colorYellow,1<FONT
size=1>);
Plot(Close,<FONT color=#ff00ff
size=1>"Close",<FONT color=#0000ff
size=1>IIf( Buy, colorGreen, <FONT
color=#0000ff size=1>IIf(Sell , colorRed
,1 )),<FONT
color=#ff00ff size=1>64);<FONT color=#0000ff
size=1>
Plot(<FONT color=#0000ff
size=1>ValueWhen(Buy,Entryprice),<FONT
color=#ff00ff size=1>"BuyPr",colorWhite,<FONT
color=#ff00ff size=1>1);<FONT color=#008000
size=1>
//Plot(StoplossPr,"StoplossPr",colorRed,1);//ValueWhen(Buy,StopLoss);<FONT
color=#0000ff size=1>
Plot(TargetPr,<FONT color=#ff00ff
size=1>"TargetPr",colorBlue,<FONT
color=#ff00ff size=1>1);<FONT color=#008000
size=1>//ValueWhen(Buy,Target) ;
//Plot(TrailPr,"TrailPr",colorGreen,1);//HighestSince(Buy,Trailstop);<FONT
size=1>
PlotShapes(<FONT color=#0000ff
size=1>IIf(Buy,
shapeUpArrow,shapeNone),colorGreen,<FONT
color=#ff00ff size=1>0,L,-<FONT color=#ff00ff
size=1>20);
PlotShapes(<FONT color=#0000ff
size=1>IIf(Sell,
shapeDownArrow,shapeNone),colorRed,<FONT
color=#ff00ff size=1>0,H,-<FONT color=#ff00ff
size=1>20);
<BLOCKQUOTE
>
----- Original Message -----
<DIV
>From:
Ernie
Newman
To: <A title=amibroker@xxxxxxxxxxxxxxx
href="">amibroker@xxxxxxxxxxxxxxx
Sent: Wednesday, February 25, 2004 4:59
AM
Subject: [amibroker] Help
Hi I am trying to get the below script to buy and sell
pivot point or at least test this method. I would like to buy if the
support price is reached and sell a few days later at the resistance level
from the buy day.The buy works great but I can't make the sell ref R1 on
the Buy day as a sell level. It sells at a high price on a sell day
which I don't understand.This is my script//Pivot Point PTPP=
(High+Low+Close)/3;R1=(PP * 2) - Low;R2= PP + High - Low;S1= (PP *
2) - High;S2 = PP - High + Low;Cond1 = Low <= S1;Cond2 = High
>= R1;Buy = Cond1;BuyPrice = S1;Sell = Cond2;SellPrice =
ValueWhen(Buy,R1);//This should Sell at the R1 value//on the Buy
Day?? But it doesn't??WHAT DO I NEED TO
DO.THANKSErnieSend 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
__________
NOD32 1.631 (20040224) Information __________This message was checked
by NOD32 antivirus system.<A
href="">http://www.nod32.com
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
Yahoo! Groups Sponsor
ADVERTISEMENT
Click Here
Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/amibroker/
To unsubscribe from this group, send an email to:amibroker-unsubscribe@xxxxxxxxxxxxxxx
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
|