Plotting buy & sell arrows

Hello Amibroker Community,

Tomasz wrote some really great Heiken Ashi Trading system code , which was published in S&C Magazine. I modified the code to plot the 0.5 threshold line but the Buy/Sell arrows won't plot. The code is as follows:

Moderator comment: you just HAVE TO USE code tags. I have added them for you, but next time if you don't use code tags, your post will be rejected.

APrice = ( Open + High + Low + Close )/4;
HaOpen = AMA( APrice , 0.5 );
HaHigh = Max( High, HaOpen );
HaLow = Min( Low, HaOpen );
HaClose = ( APrice + HaOpen + HaHigh + HaLow ) / 4;
typical = ( High + Low + Close ) / 3;
HaCAverage = 8;
TypicalAverage = 5;
AvgTyp = EMA( Typical, TypicalAverage );
AvgHaC = EMA( HaClose, HaCAverage );
CondSet = AvgTyp > AvgHaC AND Close > Open;
CondReset = AvgTyp < AvgHaC AND Close < Open;
SVEHaTypCrossInd = Flip( CondSet, CondReset );
Plot( SVEHaTypCrossInd, "SVEHaTypCrossInd", colorRed );
Buy = Cross( SVEHaTypCrossInd, 0.5 );
Sell = Cross( 0.5, SVEHaTypCrossInd );
Short = Sell;
Cover = Buy;

Plot(0.5,"",colorBlack,styleThick);
SetPositionSize( 100, spsShares ); // 100 shares per position
ApplyStop( stopTypeLoss, stopModePercent, 25, True );

PlotShapes( Buy*shapeUpArrow,colorGreen,0, L, Offset=-50); 
PlotShapes( Sell*shapeDownArrow,colorblack,0, H, Offset=50);

 // 25% stop loss
//—Tomasz Janeczko, AmiBroker.com
//www.amibroker.com

Can anyone shed some light as to why the Buy/Sell arrows won't plot. I use this same plotting code in my other formulas and I'm at a loss as to why this code doesn't work with this trading system.

Please let me know your thoughts.

Thanks
Bernie

Post the screenshot so anyone wanting to help sees how it looks on your end. Otherwise it is guessing game and waste of time. Please follow this advice: How to ask a good question

Without seeing any chart, I can only say try changing the Offset parameter in PlotShapes

This is the screen shot with the expected plot, but the buy sell arrows won't plot., no matter how I adjust the plot offset parameters, per Tomasz guidance.. I'd appreciate anyone's thoughts on this.

@brosario, you are plotting the shapes using for the yposition param the H and L, but your chart does not display the price serie....

PlotShapes( Buy*shapeUpArrow,colorGreen, 0,  SVEHaTypCrossInd);
PlotShapes( Sell*shapeDownArrow,colorblack, 0, SVEHaTypCrossInd);

Hello Beppe,

Thank you! your suggestions worked!

Greatly appreciated!

Bernie

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.