@fxshrat
You sent me this in Inbox
Look at your CHARt
http://forum.amibroker.com/uploads/default/original/2X/e/ecfc4bafb44df85229bc9cfb9bd9cca9d92a6981.jpg
My code does plot from highest since previous Sell till previous bar of "current" Buy.
As well as lowest since previous Sell till previous bar of "current" Buy.
Your chart is showing the same thing!
And here is your Text!!
Highest High Value since the PREVIOUS Sell Signal
and Lowest Low Value Since the Previous SELL signal
Stop wasting time of other people if you can't articulate properly!
_SECTION_BEGIN("Triple EMA Crossover Rules");
P1 = ParamField("Price field",-1);
Periods1 = Param("Periods1", 3, 2, 300, 1, 10 );
Plot( EMA( P1, Periods1 ), _DEFAULT_NAME(), ParamColor( "Color1", colorCycle ), ParamStyle("Style1") );
P2 = ParamField("Price field",-1);
Periods2 = Param("Periods2", 13, 2, 300, 1, 10 );
Plot( EMA( P2, Periods2 ), _DEFAULT_NAME(), ParamColor( "Color2", colorCycle ), ParamStyle("Style2") );
P3 = ParamField("Price field",-1);
Periods3 = Param("Periods3", 34, 2, 300, 1, 10 );
Plot( EMA( P3, Periods3 ), _DEFAULT_NAME(), ParamColor( "Color3", colorCycle ), ParamStyle("Style3") );
Buy = EMA(P1, Periods1) > EMA(P2, Periods2) AND EMA(P2, Periods2) > EMA(P3, Periods3);
Sell = EMA(P1, Periods1) < EMA(P2, Periods2) AND EMA(P2, Periods2) < EMA(P3, Periods3);
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Filter=Buy OR Sell;
SetOption("NoDefaultColumns", True );
AddColumn( DateTime(), "Date", formatDateTime );
AddColumn( IIf( Buy, 66, 83 ), "Signal", formatChar );
addcolumn( Close, "Close price", 1.4 );
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
_SECTION_END();
/// dummy system
period = 20;
m = MA( Close, period );
Buy = Cross( Close, m );
Sell = Cross( m, Close );
/// http://forum.amibroker.com/t/plot-lines-on-chart/5581/17
/// Plots the highest since previous Sell and lowest since previous Sell
/// code snippet by fxshrat@gmail.com
bi = BarIndex();
NotInTrade = Flip(Sell, Buy);
futlow = ValueWhen( Buy OR bi == LastValue(bi), Ref(LowestSince(Sell, L), -1), 0 );// looks into "future", don't use for BT!
ll = IIf( NotInTrade OR Ref(NotInTrade, -1), Valuewhen( Sell, futlow), Null );// looks into "future", don't use for BT!
futhigh = ValueWhen( NotInTrade, ValueWhen(Buy, Ref(HighestSince(Sell, H),-1), 0) );// looks into "future", don't use for BT!
hh = IIf( NotInTrade OR Ref(NotInTrade, -1), futhigh, Null );// looks into "future", don't use for BT!
_N( Title = StrFormat( "{{NAME}} - {{INTERVAL}} - {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%), Vol %g {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ), V ) );
Plot( HH, "\nHighest Since Previous Sell", colorRed, styleStaircase );
Plot( ll, "Lowest Since Previous Sell", colorGreen, styleStaircase );
Plot( C, "Price", colorGrey50, styleBar );
PlotShapes( Buy * shapeUpArrow, colorGreen, 0, L );
PlotShapes( Sell * shapeDownArrow, colorRed, 0, H );
Here is my code with your Code
@fxshrat do you see where is the previous high of the present signal is?