Why it DOESNT show Buy Sell arrows??

shanki99

Well-Known Member
#1
What is the problem with this simple code and why it DOESNT show Buy Sell arrows??

Title = "Bernstein MOM Close - Ref(Close,-7)";
GraphXSpace = 5;
Graph0 = MA(Close - Ref(Close,-7),1);
Graph0Style = 8;
Graph0Color = 1;
Graph1 = MA(Graph0,5);
Graph1Style = 1;
Graph1Color = 4;
_SECTION_END();

_SECTION_BEGIN("");
Buy=Cross(Graph0,Graph1);
Sell=Cross(Graph1,Graph0);
shape=Buy*shapeUpArrow+Sell*shapeDownArrow;
PlotShapes(shape,IIf(Buy,colorGreen,colorRed),0,IIf(Buy,L,H),-10);
_SECTION_END();
 
#4
Haha...its already there in the code, but, i missed it when copy pasting it here.

But again, the indicator is working fine except for the Buy Sell arrows :confused:
Put // in the beginning of middle two lines as follows

Graph1Color = 4;
//_SECTION_END();

//_SECTION_BEGIN("");
Buy=Cross(Graph0,Graph1);

With this it may work.

Thanks
 
#5
shanki99

try this

Title = "Bernstein MOM Close - Ref(Close,-7)";
GraphXSpace = 5;
x=MA(C-Ref(C,-7),1);
y=MA(x,5);
Plot(x,"",colorBlack,styleLine|styleDots);
Plot(y,"",colorRed,styleLine);
Buy=Cover=Cross(x,y);
Sell=Short=Cross(y,x);
PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorGreen,0,Graph1,-15);
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0,Graph1,-15);

vidyasagar
 

Similar threads