PureBytes Links
Trading Reference Links
|
Mike
Thanks for your response
and the shapes-cheat-sheet.
In this case though
there are four 'PlotShapes' statements for:
PivotLow
PivotHigh
Buy_Valid
Sell_Valid
and in all cases they are set to 0 or 1.
This is the code
if you would like to take a look for any flaw ?
//Zig Zag Indicator with Valid Entry and Exit Points
//Author/Uploader: Eric Tangen
//z_ZigZagValid
// ******** CHARTING
PercentChange = 6;
mystartbar = SelectedValue(BarIndex()); // FOR GRAPHING
mystartbardate = LastValue(ValueWhen(mystartbar == BarIndex(), DateNum(),1));
InitialValue = LastValue(ValueWhen(mystartbardate == DateNum(), C , 1 ) ) ;
Temp1 = IIf(BarIndex() >= mystartbar, InitialValue, Null) ;
Plot(Temp1, " ", colorBlack,styleLine);
Plot((1+(LastValue(PercentChange)/100))*(Temp1), " ", colorGreen, styleLine) ;
Plot((1-(LastValue(PercentChange)/100))*(Temp1), " ", colorRed, styleLine) ;
ZZ = Zig(C,LastValue(PercentChange)) ;
PivotLow = Ref(IIf(Ref(ROC(ZZ,1),-1) < 0 AND ROC(ZZ,1) > 0, 1, Null),1);
PivotHigh = Ref(IIf(Ref(ROC(ZZ,1),-1) > 0 AND ROC(ZZ,1) < 0, 1, Null),1);
PlotShapes( shapeCircle*PivotLow, colorGreen,0, L, -20) ;
PlotShapes( shapeCircle*PivotHigh,colorRed,0,H, 20) ;
Buy_Valid = IIf(C>(1+(LastValue(PercentChange)/100))*(ValueWhen(PivotLow, C, 1))
AND ROC(ZZ,1) > 0,1,0);
Sell_Valid = IIf(C<(1-(LastValue(PercentChange)/100))*(ValueWhen(PivotHigh, C, 1))
AND ROC(ZZ,1) < 0,1,0);
Buy_Valid = ExRem(Buy_Valid,Sell_Valid);
Sell_Valid = ExRem(Sell_Valid,Buy_Valid);
PlotShapes( shapeUpArrow*Buy_Valid, colorGreen,0, L, -20);
PlotShapes( shapeDownArrow*Sell_Valid, colorRed,0,H, -20) ;
BarColors =
IIf(BarsSince(Buy_Valid) < BarsSince(Sell_Valid)
AND BarsSince(Buy_Valid)!=0, colorGreen,
IIf(BarsSince(Sell_Valid) < BarsSince(Buy_Valid)
AND BarsSince(Sell_Valid)!=0, colorRed, colorBlue));
Plot(C, " ", BarColors, styleBar ) ;
Plot(ZZ," ", colorLightGrey,styleLine|styleThick);
Plot(ZZ," ", BarColors,styleDots|styleNoLine);
Title = Name() + " " + Date() + WriteIf(PivotLow, " Up Pivot ","")+WriteIf(PivotHigh," Down Pivot ","")+ WriteIf(Buy_Valid, " Buy Point ", "") + WriteIf(Sell_Valid, " Sell Point ", "") ;
--- In amibroker@xxxxxxxxxxxxxxx, "Mike" <sfclimbers@xxx> wrote:
>
> Tom,
>
> Most likely you are passing an array to the PlotShapes statement that has incorrectly calculated the shape value. Double check your calculation for the first argument.
>
> Note that the typical construct is to multiply a true/false (i.e. 1/0) by the desired shape value.
>
> e.g. Buy * shapeUpArrow
>
> However, if the Buy array above holds "true" values that are not "1", then the multiplication will result in a shape value that is not the one you intended.
>
> See the following article for the realm of all possible shape values. The ones that you are describing sound to be in the range 57-62.
>
> http://www.amibroker.org/userkb/2008/03/15/afl-shapes-cheat-sheet/
>
> Mike
>
> --- In amibroker@xxxxxxxxxxxxxxx, "TomB" <directaim@> wrote:
> >
> >
> > Most areas of a chart
> > are showing tiny red and green arrows
> > along the bars.
> >
> > Everything else shows up ok.
> >
> > I can find no mention of these arrows
> > in the manual or in a search.
> >
> > How can these be eliminated?
> >
>
------------------------------------
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
amibroker-digest@xxxxxxxxxxxxxxx
amibroker-fullfeatured@xxxxxxxxxxxxxxx
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|