/// **i intend to use following formula
but the issue is the buy price changes to new buy signal if not squred off before new buy signal
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
SetTradeDelays(0,0,0,0);
Buy2=Cross (RSI(30),40) OR Cross (RSI(30),55);
//TimeNum()>092000 AND TimeNum()<152000 AND (C>100 AND C<200);
Buy= Cross(TimeNum(),092500)
//OR Cross(TimeNum(),093000)
//OR
type or paste code here
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
SetTradeDelays(0,0,0,0);
Buy2=Cross (RSI(30),40) OR Cross (RSI(30),55);
//TimeNum()>092000 AND TimeNum()<152000 AND (C>100 AND C<200);
Buy= Cross(TimeNum(),092500)
//OR Cross(TimeNum(),093000)// i get buy here buy value is say 120
//OR Cross(TimeNum(),094500)// did not squred off(sell)
//OR Cross(TimeNum(),100000)// i get buy signal now buy value is 90
//OR Cross(TimeNum(),101500)// how to fix this
//OR Cross(TimeNum(),103000)
//OR Cross(TimeNum(),110000)
//OR Cross(TimeNum(),113000)
//OR Cross(TimeNum(),120000)
OR Cross(TimeNum(),123000)
OR Cross(TimeNum(),130000)
OR Cross(TimeNum(),133000)
OR Cross(TimeNum(),140000)
OR Cross(TimeNum(),143000)
OR Cross(TimeNum(),144900)
OR Cross(TimeNum(),145700)
OR Cross(TimeNum(),150300)
OR Cross(TimeNum(),150000);
//
bv=ValueWhen(Buy,O);
bv1=bv;
tgt1= Cross((bv+50),C)OR Cross((bv+75),C)OR Cross((bv+100),C )OR Cross((bv+50),C)OR Cross((bv+60),C) OR H>(bv+70);// OR TimeNum()>152500;//Cross((bv*1.1),C)OR Cross((bv*1.3),C)OR Cross((bv*1.5),C)OR
Sell= TimeNum()>152500 OR L<bv-25 OR tgt1;
Plot( BV1, "bv", colorWhite);
Plot( bv1-25, "sl", colorRed);
Plot( bv1+50, "tgt", colorGreen);
Plot( bv1+120, "tgt1", colorYellow);
Plot( bv1+0, "tgt2", colorGold);
//Plot( bv1+10, "tgt", colorGreen);
//Buy=ExRem(Buy ,Sell);
Sell =ExRem(Sell,Buy);
PlotShapes( IIf( Buy, shapeUpArrow, shapeNone ), colorWhite, 0, L, Offset =-45 );
PlotShapes( IIf( Sell, shapeDownArrow, shapeNone ), colorCustom10, 0, H, Offset =-45);
_SECTION_END();
_SECTION_BEGIN("MA1");
P = ParamField("Price field",-1);Code button (use to enter/paste AFL formula)
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();