Help needed for coding Intraday script for Amibroker

chilgu

Active Member
#1
I tried to make a intraday traing system which plots buy and sell signal and contains exploration too. But I could not generate proper signal in exploration window within a time frame of 5 minute, 15 minute and 60 minute. Experts are requested to suggest proper coding.

Keep proper stoploss while using this strategy.


_SECTION_BEGIN("Price");
SetChartBkGradientFill(colorWhite,colorLightGrey,colorWhite);
SetBarFillColor(IIf(O>C,24,19));
Plot(C,"Price",IIf(O>C,32,34),64);
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
if( ParamToggle("Tooltip shows", "All Values|Only Prices" ) )
{
ToolTip=StrFormat("Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 )));
}


_SECTION_END();

TimeFrameSet(inDaily);
tDayHigh = LastValue(H);
tDayLow = LastValue(L);
TimeFrameRestore();

TimeFrameSet(inDaily);
yDayHigh=TimeFrameGetPrice( "H", inDaily, -1 ) ;
yDayLow=TimeFrameGetPrice( "L", inDaily, -1 ) ;
TimeFrameRestore();

yDayHigh=TimeFrameGetPrice( "H", inDaily, -1 ) ;
yDayLow=TimeFrameGetPrice( "L", inDaily, -1 ) ;


Plot(yDayHigh, "price", colorBlue);
Plot(yDayLow, "price", colorRed);



Buy = Cross(C, yDayHigh ) ;
Sell = Cross(yDayLow, C);

shape=Buy*shapeUpTriangle + Sell*shapeDownTriangle;
PlotShapes(shape,IIf(Buy,colorDarkGreen, colorDarkRed),0,IIf(Buy,Low,High));
if (SelectedValue(Buy)==1) Say("fly with airoplane");
if (SelectedValue(Sell)==1) Say("drive with submarrine");
dist = 1.5*ATR(10);
for( i = 0; i < BarCount; i++ )
{
if( Buy ) PlotText( "Buy\n@" + C[ i ] , i, C[ i ]-dist, colorBlack);
if( Sell ) PlotText( "Sell\n@" + C[ i ], i, C[ i ]+dist, colorBlack);
}

SetTradeDelays( 1, 1, 1, 1 );
BuyPrice=ValueWhen(Buy, C);
SellPrice=ValueWhen(Sell, C);
p1=C-BuyPrice;
p2=SellPrice-C;



Filter=Buy OR Sell ;

Filter=1;



SetOption("NoDefaultColumns", True);
AddTextColumn(Name(), "Symbol", 77, colorDefault, colorDefault, 120);
AddColumn(DateTime(), "Trigger Date", formatDateTime);
AddColumn(TimeNum(), "Time", 1);
AddColumn(IIf(Buy, 66, 83), "Signal", formatChar, colorYellow, IIf(Buy, colorGreen, colorRed));
AddColumn(IIf(Buy, BuyPrice, SellPrice), "Entry", 6.2);
AddColumn(C, "CMP", 6.2);
AddColumn(IIf(Buy, p1, p2), "PP", 1.2);
 

Similar threads