PureBytes Links
Trading Reference Links
|
<SPAN
class=135200318-21022003>Ron,
<SPAN
class=135200318-21022003>
<SPAN
class=135200318-21022003>Perhaps we are on a different page. Plotshapes will
plot shapes at points on the chart or indicator where your code triggers a
"True" value.
<SPAN
class=135200318-21022003>
<SPAN
class=135200318-21022003>example of a custom indicator;
<SPAN
class=135200318-21022003> <FONT
color=#0000ff>
Buy=Cross<FONT
size=2>(C,<FONT
size=2>MA(C<FONT
size=2>,50<FONT
color=#0000ff>));
Plot(<FONT color=#000000
size=2>C,<FONT color=#ff00ff
size=2>"",<FONT color=#000000
size=2>colorBlue,<FONT
color=#ff00ff size=2>1);<FONT
color=#0000ff size=2>
PlotShapes(<FONT color=#0000ff
size=2>IIf(<FONT color=#000000
size=2>Buy,<FONT color=#000000
size=2>shapeUpArrow,<FONT
color=#000000 size=2>shapeNone<FONT color=#282828
size=2>),colorBrightGreen<FONT
color=#282828 size=2>);
<SPAN
class=135200318-21022003>
would
trigger a buy at the crossover of the 50 day moving average. This would be
automatic. What you suggest is drawing an arrow like you would draw a trend
line.
<SPAN
class=135200318-21022003>
<SPAN
class=135200318-21022003>placing the first 2 lines of code in the guru
commentary would plot the arrows on the price plot. Copying the buy and
plptshapes lines to the top of the builtin Price indicator window would also
plot the arrows on your price plot.
<SPAN
class=135200318-21022003>
the
syntax from the help file......
<SPAN
class=135200318-21022003>
<SPAN
class=135200318-21022003>SYNTAX PlotShapes( shape, color, layer = 0,
yposition = graph0, offset = -12 );
<SPAN
class=135200318-21022003>
would
translate to
<SPAN
class=135200318-21022003> <FONT
color=#0000ff>
PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorBrightGreen<SPAN
class=135200318-21022003>,0,0,-12);<SPAN
class=135200318-21022003> I have never gotton this to work for me. The arrows
always drop to the bottom of the chart. On a price chart I have found this to
work.....
<FONT
color=#0000ff>
Buy=Cross(C,MA(C,50<FONT
color=#0000ff>));<FONT
size=2>
Plot(<FONT
color=#000000>C<FONT
color=#282828>,""<FONT
color=#282828>,<FONT
color=#000000>colorBlue<FONT
face=Arial>,<FONT
color=#000000>styleCandle<FONT
face=Arial size=2>);<FONT
color=#0000ff>
PlotShapes(<FONT
color=#0000ff>IIf(<FONT
color=#000000>Buy,<FONT
color=#000000>shapeUpArrow<FONT
face=Arial>,<FONT
color=#000000>shapeNone<FONT
face=Arial>),<FONT
color=#000000>colorBrightGre<FONT
color=#000000>en<FONT
color=#282828>,0<FONT
color=#282828>,L<FONT
size=2>-ATR(1));<SPAN
class=135200318-21022003>
<SPAN
class=135200318-21022003>
which off sets
the plot 1 atr below the low on the price chart. Not sure why perhaps some one
else can chip in here
Jayson
<FONT face=Tahoma
size=2>-----Original Message-----From: rmortonmd
<ronmd@xxxxxxxxxx> [mailto:ronmd@xxxxxxxxxx]Sent: Friday,
February 21, 2003 12:53 PMTo:
amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] Re: buy/sell
arrows--- In amibroker@xxxxxxxxxxxxxxx, "Jayson"
<jcasavant@xxxx> wrote:Jayson,Thanks for getting back to me so
quickly. I am a new user and I've been having some trouble getting
accustomed to the syntax of this program. I tried to set up a new
indicator with the code for plotshapes, I got a syntax error after the
"buy,". I entered a buy value above the line of code you gave me and
then got a syntax error on "plotshapes". HELP!! Assuming that I
eventually get this working, wouldn't it be easier to have arrows placed on
the drawing menu so that this could be clicked on the chart just like the
text box, rectangle/ellipse etc?ron> Ron,> yes you can
use plotshapes from help.....>
> SYNTAX PlotShapes( shape,
color, layer = 0, yposition = graph0,> offset = -12
);> RETURNS
NOTHING> FUNCTION Plots arrows
and other shapes on any chart pane.>
Parameters:> > a..
shape defines type of the symbol. when shape is zero nothing is>
plotted values other than zero cause plotting various pre-defined
shapes.> Odd values plot shape BELOW indicator, even values plot
shape ABOVE>
indicator.> b.. color
defines color of shape>
c.. layer defines layer number on which shapes are
plotted> d.. yposition
defines Y-position where shapes are plotted (by> default they are
plotted 'around' graph0 (first indicator)
line)> e.. offset - (or
distance) parameter (by default -12 ), Offset is> expressed in SCREEN
pixels. Negative offsets shift symbols down, positive> offsets shift
symbol up. To place the shape exactly at ypostion, specify 0> as
offset> Constants for
shapes:> shapeNone, shapeUpArrow,
shapeDownArrow, shapeHollowUpArrow,> shapeHollowDownArrow,
shapeSmallUpTriangle, shapeSmallDownTriangle,>
shapeHollowSmallUpTriangle, shapeHollowSmallDownTriangle,
shapeUpTriangle,> shapeDownTriangle, shapeHollowUpTriangle,
shapeHollowDownTriangle,> shapeSmallSquare, shapeHollowSmallSquare,
shapeSquare, shapeHollowSquare,> shapeSmallCircle,
shapeHollowSmallCircle, shapeCircle, shapeHollowCircle,> shapeStar,
shapeHollowStar, shapeDigit0, shapeDigit1, shapeDigit2,> shapeDigit3,
shapeDigit4, shapeDigit5, shapeDigit6, shapeDigit7,> shapeDigit8,
shapeDigit9, shapePositionAbove>
> EXAMPLE PlotShapes( IIF( buy,
shapeDigit9 + shapePositonAbove,> shapeNone ), colorGreen );>
> > Jayson> -----Original Message-----> From:
rmortonmd <ronmd@xxxx> [mailto:ronmd@xxxx]> Sent: Friday, February
21, 2003 11:35 AM> To: amibroker@xxxxxxxxxxxxxxx> Subject:
[amibroker] buy/sell arrows> > > I was wondering if there
was a way that you could manually put the> green (buy) and red(sell)
arrows on a price chart as done in the> backtesting show trades. I
would like a visual way of seeing the> days that I make trades.>
ron> > > Yahoo! Groups
Sponsor>
ADVERTISEMENT> > > > > 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 Yahoo! Terms of
Service.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
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.
|