- in realtime i do'nt know why it generates to many signals(sometime).
- in real time it gives false signals (sometime).
- but when i back test(amibroker) it gives no issue.
- i know nothing about programming.
- i want to buy just at the close of the signal bar, how can i do that.
_SECTION_BEGIN("RSI Crossover Alert");
SetChartOptions(0,0,chartGrid1|chartGrid100);
periods = Param( "Periods", 14, 1, 200, 1 );
RS= RSI( periods);
Plot( RS, _DEFAULT_NAME(), colorred, ParamStyle("Style") );
Plot (30, "Oversold", colorGreen,stylethick);
Plot (70, "Overbought", colorGreen,stylethick);
buy = Cross(30,RS);
sell = Cross(RS,70);
Buy = ExRem( Buy, Sell );
Sell = ExRem( Sell, Buy );
/* Prices when Buy, Sell condition is true */
BuyPrice = ValueWhen(Buy,C);
SellPrice = ValueWhen(Sell,C);
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorGreen, colorGreen ), 0, RS );
AlertIF( Buy, "SOUND C:\\Windows\\Media\\Ding.wav", "Audio alert", 1 );
AlertIF( Sell, "SOUND C:\\Windows\\Media\\Ding.wav", "Audio alert", 2 );
if ( LastValue(Buy) == True )
{
placeOrderUsingParams(AT_EXCHANGE, AT_SYMBOL, "BUY", AT_ORDER_TYPE, AT_QUANTITY, buyPrice, defaultTriggerPrice(), 1);
}
if ( LastValue(Sell) == True )
{
placeOrderUsingParams(AT_EXCHANGE, AT_SYMBOL, "SELL", AT_ORDER_TYPE, AT_QUANTITY, sellPrice, defaultTriggerPrice(), 1);
}
_SECTION_END();