_SECTION_BEGIN("visual arrow ema cross over");
SetChartOptions(0,chartShowArrows|chartShowDates);
Plot( Close, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
for(i=1; i < BarCount; i++)
{
Buy = IIf(H > 800 , 1 , 0);
PlotShapes(IIf(Buy==1, shapeUpArrow , shapeNone), colorGreen, 0,Low, Offset=-15);
Sell = IIf(L <720 , 1 , 0);
PlotShapes(IIf(Sell==1, shapeDownArrow, shapeNone), colorRed, 0,High, Offset=-15);
}
_SECTION_END();
Please correct my syntax
"Buy = ......"
"Sell = ......"
I want to buy a stock when it goes above 800 and sell when goes below 720
in the same form using loop
Thanx in advance
SetChartOptions(0,chartShowArrows|chartShowDates);
Plot( Close, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
for(i=1; i < BarCount; i++)
{
Buy = IIf(H > 800 , 1 , 0);
PlotShapes(IIf(Buy==1, shapeUpArrow , shapeNone), colorGreen, 0,Low, Offset=-15);
Sell = IIf(L <720 , 1 , 0);
PlotShapes(IIf(Sell==1, shapeDownArrow, shapeNone), colorRed, 0,High, Offset=-15);
}
_SECTION_END();
Please correct my syntax
"Buy = ......"
"Sell = ......"
I want to buy a stock when it goes above 800 and sell when goes below 720
in the same form using loop
Thanx in advance
Use this
Code:
_SECTION_BEGIN("visual arrow ema cross over");
SetChartOptions(0,chartShowArrows|chartShowDates);
Plot( Close, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
Buy = Cross(C,800);
Sell = Cross(720,C);
PlotShapes(IIf(Buy==1, shapeUpArrow , shapeNone), colorGreen, 0,Low, Offset=-15);
PlotShapes(IIf(Sell==1, shapeDownArrow, shapeNone), colorRed, 0,High, Offset=-15);
_SECTION_END();
Happy