Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

scaling2 for Amibroker (AFL)

Copy & Paste Friendly
SetOption("UseCustomBacktestProc",True);
if(Status("action")==actionPortfolio)
{
	bo=GetBacktesterObject();
	bo.PreProcess();
	
	for(bar=0;bar<BarCount;bar++)
	{	
		bo.ProcessTradeSignals(bar);
		
		for (trade=bo.GetFirstOpenPos();trade;trade=bo.GetNextOpenPos())
		{
			symbol=trade.symbol;
			BuyScale1=StaticVarGet(symbol+"BuyScale1");
			BuyScale2=StaticVarGet(symbol+"BuyScale2");
			BuyPriceScale1=StaticVarGet(symbol+"BuyPriceScale1");
			BuyPriceScale2=StaticVarGet(symbol+"BuyPriceScale2");
			ShortScale1=StaticVarGet(symbol+"ShortScale1");
			ShortScale2=StaticVarGet(symbol+"ShortScale2");
			ShortPriceScale1=StaticVarGet(symbol+"ShortPriceScale1");
			ShortPriceScale2=StaticVarGet(symbol+"ShortPriceScale2");	

			//if(BuyScale1[bar]) bo.ScaleTrade(bar,symbol,False,BuyPriceScale1[bar],PositionSize);
			//if(BuyScale2[bar]) bo.ScaleTrade(bar,symbol,False,BuyPriceScale2[bar],PositionSize);
			//if(ShortScale1[bar]) bo.ScaleTrade(bar,symbol,False,ShortPriceScale1[bar],PositionSize);
			//if(ShortScale2[bar]) bo.ScaleTrade(bar,symbol,False,ShortPriceScale2[bar],PositionSize);
			scaleSize=trade.GetEntryValue()/3;
			//_TRACE("scaleSize: " + scaleSize);
			if(BuyScale1[bar]) _TRACE("scale1");
			if(BuyScale2[bar]) _TRACE("scale2");
			if(BuyScale1[bar]) bo.ScaleTrade(bar,symbol,False,BuyPriceScale1[bar],scaleSize,MarginDeposit);
			if(BuyScale2[bar]) bo.ScaleTrade(bar,symbol,False,BuyPriceScale2[bar],scaleSize,MarginDeposit);
			if(ShortScale1[bar]) bo.ScaleTrade(bar,symbol,False,ShortPriceScale1[bar],scaleSize,MarginDeposit);
			if(ShortScale2[bar]) bo.ScaleTrade(bar,symbol,False,ShortPriceScale2[bar],scaleSize,MarginDeposit);	
		}
	}
	bo.PostProcess();
}

// AFL code E.M.Pottasch, Aug 2013
x=BarIndex();Lx=LastValue(x);
fvb=Status("firstvisiblebarindex");lvb=Min(Lx,Status("lastvisiblebarindex"));
DisplayLineAnnotation=ParamToggle("Display Line Annotation","Off|On",1);
DisplaySignalAnnotation=ParamToggle("Display Signal Annotation","Off|On",1);

SetTradeDelays(0,0,0,0);
SetOption("CommissionMode",3);
SetOption("CommissionAmount",2.01);
SetOption("FuturesMode",True);
SetOption("AllowSameBarExit",True);
SetOption("InitialEquity",150000); 

NumContracts=1;
//PositionSize=NumContracts*MarginDeposit;

beginCalcTime=ParamTime("Begin Calc Time","09:30:00");
endCalcTime=ParamTime("End Calc Time","16:00:00");
beginTradeTime=ParamTime("Begin Trade Time","09:30:00");
endTradeTime=ParamTime("End Trade Time","15:55:00");

timeWindowTrade=TimeNum()>=beginTradeTime AND TimeNum()<=endTradeTime;
timeWindowCalc=TimeNum()>=beginCalcTime AND TimeNum()<=endCalcTime;

firstBarOfDay=TimeNum()>=beginCalcTime ;firstBarOfDay=(firstBarOfDay-Ref(firstBarOfDay,-1))==1;
lastBarOfDay=TimeNum()>=endCalcTime;lastBarOfDay=(lastBarOfDay-Ref(lastBarOfDay,-1))==1;
firstTradeBarOfDay=TimeNum()>=beginTradeTime;firstTradeBarOfDay=(firstTradeBarOfDay-Ref(firstTradeBarOfDay,-1))==1;
lastTradeBarOfDay=TimeNum()>=endTradeTime;lastTradeBarOfDay=(lastTradeBarOfDay-Ref(lastTradeBarOfDay,-1))==1;
ttt=firstBarOfDay OR lastBarOfDay;
inTrade=Flip(firstBarOfDay,LastBarOfDay);

procedure entryExit_proc(Buy1,Short1,stopLong,stopShort,BY,BT1,BT2,BT3,SH,ST1,ST2,ST3,timearr,endTradeTime,TickSize) 
{
global BuyAdjusted;
global BuyPriceAdjusted;
global BuyAdjustedScale1;
global BuyAdjustedScale2;
global BuyPriceAdjustedScale1;
global BuyPriceAdjustedScale2;
global ShortAdjusted;
global ShortPriceAdjusted;
global ShortAdjustedScale1;
global ShortAdjustedScale2;
global ShortPriceAdjustedScale1;
global ShortPriceAdjustedScale2;
global SellAdjusted;
global SellPriceAdjusted;
global CoverAdjusted;
global CoverPriceAdjusted;
global NContractArray;

BuyAdjusted=0;
BuyPriceAdjusted=0;
BuyAdjustedScale1=0;
BuyAdjustedScale2=0;
BuyAdjustedScale3=0;
BuyPriceAdjustedScale1=0;
BuyPriceAdjustedScale2=0;
BuyPriceAdjustedScale3=0;
ShortAdjusted=0;
ShortPriceAdjusted=0;
ShortAdjustedScale1=0;
ShortAdjustedScale2=0;
ShortAdjustedScale3=0;
ShortPriceAdjustedScale1=0;
ShortPriceAdjustedScale2=0;
ShortPriceAdjustedScale3=0;
SellAdjusted=0;
SellPriceAdjusted=0;
CoverAdjusted =0;
CoverPriceAdjusted=0;
NContractArray=0;

delay=0;
slip=TickSize*0;

for(i=1;i<BarCount;i++) 
{
	exitType=0;
	if(Buy1[i]) 
	{
		BuyAdjusted[i]=1;
		BuyPriceAdjusted[i]=O[i];
		NContractArray[i]=3;
		
		for(j=i+delay;j<BarCount;j++) 
		{	
			if(j>i) NContractArray[j]=NContractArray[j-1];
			
			if (timearr[j-1]>=endTradeTime)
			{
				SellAdjusted[j]=1;
				SellPriceAdjusted[j]=O[j]-slip;
				NContractArray[j]=0;
				i=j;
				break;	
			}
			else if(C[j-1]<stopLong[j-1])
			{
				SellAdjusted[j]=1;
				SellPriceAdjusted[j]=O[j]-slip;
				NContractArray[j]=0;
				i=j;
				break;
			}	
			else if(H[j]>BT3[j] AND exitType==0)//1
			{
				exitType=2;
				BuyAdjustedScale1[j]=sigScaleOut;
				BuyPriceAdjustedScale1[j]=Max(O[j],BT1[j])-slip;
				NContractArray[j]=NContractArray[j-1]-1;
				BuyAdjustedScale2[j]=sigScaleOut;
				BuyPriceAdjustedScale2[j]=Max(O[j],BT2[j])-slip;
				NContractArray[j]=NContractArray[j-1]-1;
				SellAdjusted[j]=1;
				SellPriceAdjusted[j]=Max(O[j],BT3[j])-slip;
				NContractArray[j]=0;
				i=j;
				break;
			}		
			else if(H[j]>BT3[j] AND exitType==1)//2
			{
				exitType=2;
				BuyAdjustedScale2[j]=sigScaleOut;
				BuyPriceAdjustedScale2[j]=Max(O[j],BT2[j])-slip;	
				NContractArray[j]=NContractArray[j-1]-1;
				SellAdjusted[j]=1;
				SellPriceAdjusted[j]=Max(O[j],BT3[j])-slip;	
				NContractArray[j]=0;
				i=j;
				break;
			}				
			else if(H[j]>BT2[j] AND H[j]<=BT3[j] AND exitType==0)//3
			{
				exitType=2;
				BuyAdjustedScale1[j]=sigScaleOut;
				BuyPriceAdjustedScale1[j]=Max(O[j],BT1[j])-slip;
				NContractArray[j]=NContractArray[j-1]-1;
				BuyAdjustedScale2[j]=sigScaleOut;
				BuyPriceAdjustedScale2[j]=Max(O[j],BT2[j])-slip;
				NContractArray[j]=NContractArray[j-1]-1;
			}		
			else if(H[j]>BT1[j] AND H[j]<=BT2[j] AND exitType==0)//4
			{
				exitType=1;
				BuyAdjustedScale1[j]=sigScaleOut;
				BuyPriceAdjustedScale1[j]=Max(O[j],BT1[j])-slip;
				NContractArray[j]=NContractArray[j-1]-1;
			}
			else if(H[j]>BT2[j] AND H[j]<=BT3[j] AND exitType==1)//5
			{
				exitType=2;
				BuyAdjustedScale2[j]=sigScaleOut;
				BuyPriceAdjustedScale2[j]=Max(O[j],BT2[j])-slip;
				NContractArray[j]=NContractArray[j-1]-1;
			}			
			else if(H[j]>BT3[j] AND exitType==2)//6
			{
				SellAdjusted[j]=1;
				SellPriceAdjusted[j]=Max(O[j],BT3[j])-slip;
				NContractArray[j]=0;
				i=j;
				break;
			}				
			else if(j==BarCount-1) 
			{
				i=BarCount;
				break;				
			}
		}
	} 
	else if(Short1[i]) 
	{
		ShortAdjusted[i]=1;
		ShortPriceAdjusted[i]=O[i];	
		NContractArray[i]=-3;
		
		for(j=i+delay;j<BarCount;j++) 
		{	
			if(j>i) NContractArray[j]=NContractArray[j-1];
			
			if(timearr[j-1]>=endTradeTime)
			{
				CoverAdjusted[j]=1;
				CoverPriceAdjusted[j]=O[j]+slip;
				NContractArray[j]=0;
				i=j;
				break;	
			}
			else if(C[j-1]>stopShort[j-1])
			{
				CoverAdjusted[j]=1;
				CoverPriceAdjusted[j]=O[j]+slip;
				NContractArray[j]=0;
				i=j;
				break;
			}	
			else if(L[j]<ST3[j] AND exitType==0)//1
			{
				ShortAdjustedScale1[j]=sigScaleOut;
				ShortPriceAdjustedScale1[j]=Min(O[j],ST1[j])+slip;
				NContractArray[j]=NContractArray[j-1]+1;
				ShortAdjustedScale2[j]=sigScaleOut;
				ShortPriceAdjustedScale2[j]=Min(O[j],ST2[j])+slip;	
				NContractArray[j]=NContractArray[j-1]+1;
				CoverAdjusted[j]=1;
				CoverPriceAdjusted[j]=Min(O[j],ST3[j])+slip;
				NContractArray[j]=0;
				i=j;
				break;
			}		
			else if(L[j]<ST3[j] AND exitType==1)//2
			{
				ShortAdjustedScale2[j]=sigScaleOut;
				ShortPriceAdjustedScale2[j]=Min(O[j],ST2[j])+slip;	
				NContractArray[j]=NContractArray[j-1]+1;
				CoverAdjusted[j]=1;
				CoverPriceAdjusted[j]=Min(O[j],ST3[j])+slip;
				NContractArray[j]=0;
				i=j;
				break;
			}					
			else if(L[j]<ST2[j] AND L[j]>=ST3[j] AND exitType==0)//3
			{
				exitType=2;
				ShortAdjustedScale1[j]=sigScaleOut;
				ShortPriceAdjustedScale1[j]=Min(O[j],ST1[j])+slip;
				NContractArray[j]=NContractArray[j-1]+1;
				ShortAdjustedScale2[j]=sigScaleOut;
				ShortPriceAdjustedScale2[j]=Min(O[j],ST2[j])+slip;					
				NContractArray[j]=NContractArray[j-1]+1;
			}			
			else if(L[j]<ST1[j] AND L[j]>=ST2[j] AND exitType==0)//4
			{
				exitType=1;
				ShortAdjustedScale1[j]=sigScaleOut;
				ShortPriceAdjustedScale1[j]=Min(O[j],ST1[j])+slip;	
				NContractArray[j]=NContractArray[j-1]+1;
			}
			else if(L[j]<ST2[j] AND L[j]>=ST3[j] AND exitType==1)//5
			{
				exitType=2;
				ShortAdjustedScale2[j]=sigScaleOut;
				ShortPriceAdjustedScale2[j]=Min(O[j],ST2[j])+slip;	
				NContractArray[j]=NContractArray[j-1]+1;
			}			
			else if(L[j]<ST3[j] AND exitType==2)//6
			{
				CoverAdjusted[j]=1;
				CoverPriceAdjusted[j]=Min(O[j],ST3[j])+slip;
				NContractArray[j]=0;
				i=j;
				break;
			}					
			else if(j==BarCount-1) 
			{	
				i=BarCount;
				break;
			}
		}
	} 
} 
}

myHigh=ValueWhen(timeWindowCalc,HighestSince(firstBarOfDay,High)); 
myLow=ValueWhen(timeWindowCalc,LowestSince(firstBarOfDay,Low)); 
myClose=ValueWhen(lastBarOfDay,C);

DH=TimeFrameCompress(myHigh,inDaily,compressLast); 
DL=TimeFrameCompress(myLow,inDaily,compressLast); 
DC=TimeFrameCompress(myClose,inDaily,compressLast);
DH=Ref(DH,-1);DL=Ref(DL,-1);DC=Ref(DC,-1);
YHigh=TimeFrameExpand(DH,inDaily,expandFirst); 
YLow=TimeFrameExpand(DL,inDaily,expandFirst); 
YClose=TimeFrameExpand(DC,inDaily,expandFirst); 

fact=1.1;
R3=YClose+((YHigh-Ylow)*fact)/4;
R4=YClose+((YHigh-Ylow)*fact)/2;
R5=((YHigh-Ylow)*0.82)+YClose;
R6=((YHigh-Ylow)*1.09)+YClose; 
R7=((YHigh-Ylow)*1.35)+YClose;
R8=((YHigh-Ylow)*1.62)+YClose;	 
S3=YClose-((YHigh-Ylow)*fact)/4;
S4=YClose-((YHigh-Ylow)*fact)/2;
S5=YClose-((YHigh-Ylow)*0.82);
S6=YClose-((YHigh-Ylow)*1.09);
S7=YClose-((YHigh-Ylow)*1.35);
S8=YClose-((YHigh-Ylow)*1.62);
       
BY=R4;BT1=R6;BT2=R7;BT3=R8;               
SH=S4;ST1=S6;ST2=S7;ST3=S8;   

Buy1=Cross(C,BY) AND C<BT1;Buy1=Ref(Buy1,-1) AND timeWindowTrade;
Short1=Cross(SH,C) AND C>ST1;Short1=Ref(Short1,-1) AND timeWindowTrade;

stopLong=(R3+R4)/2;stopShort=(S3+S4)/2;

entryExit_proc(Buy1,Short1,stopLong,stopShort,BY,BT1,BT2,BT3,SH,ST1,ST2,ST3,TimeNum(),endTradeTime,TickSize); 

Buy=BuyAdjusted;BuyPrice=BuyPriceAdjusted;
Sell=SellAdjusted;SellPrice=SellPriceAdjusted;
Short=ShortAdjusted;ShortPrice=ShortPriceAdjusted;
Cover=CoverAdjusted;CoverPrice=CoverPriceAdjusted;
dNContractArray=NContractArray-Ref(NContractArray,-1);
SetPositionSize(3*NumContracts,spsShares); 
SetPositionSize(1*NumContracts*abs(dNContractArray),spsShares*(BuyAdjustedScale1==sigScaleOut OR BuyAdjustedScale2==sigScaleOut OR ShortAdjustedScale1==sigScaleOut OR ShortAdjustedScale2==sigScaleOut));
"dNContractArray: " + WriteVal(dNContractArray);

symbol=Name();
StaticVarSet(symbol+"BuyScale1",BuyAdjustedScale1);
StaticVarSet(symbol+"BuyScale2",BuyAdjustedScale2);
StaticVarSet(symbol+"BuyPriceScale1",BuyPriceAdjustedScale1);
StaticVarSet(symbol+"BuyPriceScale2",BuyPriceAdjustedScale2);
StaticVarSet(symbol+"ShortScale1",BuyAdjustedScale1);
StaticVarSet(symbol+"ShortScale2",BuyAdjustedScale2);
StaticVarSet(symbol+"ShortPriceScale1",BuyPriceAdjustedScale1);
StaticVarSet(symbol+"ShortPriceScale2",BuyPriceAdjustedScale2);

SetChartOptions(0,chartShowArrows|chartShowDates);
SetChartBkColor(ColorRGB(0,0,0));
SetBarFillColor(IIf(C>O,ColorRGB(0,75,0),IIf(C<=O,ColorRGB(75,0,0),colorLightGrey)));
Plot(C,"\nPrice",IIf(C>O,ColorRGB(0,255,0),IIf(C<=O,ColorRGB(255,0,0),colorLightGrey)),64,0,0,0,0);

if(Interval()<inDaily)
{
	PlotShapes(IIf(BuyAdjusted,shapeUpArrow,shapeNone),colorGreen,0,L,-15);
	PlotShapes(IIf(BuyAdjusted,shapeSmallCircle,shapeNone),ColorRGB(255,20,147),0,BuyPriceAdjusted,0);
	PlotShapes(IIf(BuyAdjusted,shapeHollowSmallCircle,shapeNone),ColorRGB(255,255,255),0,BuyPriceAdjusted,0);
	PlotShapes(IIf(SellAdjusted,shapeDownArrow,shapeNone),colorRed,0,H,-15);
	PlotShapes(IIf(SellAdjusted,shapeSmallCircle,shapeNone),ColorRGB(255,20,147),0,SellPriceAdjusted,0);
	PlotShapes(IIf(SellAdjusted,shapeHollowSmallCircle,shapeNone),ColorRGB(255,255,255),0,SellPriceAdjusted,0);
	PlotShapes(IIf(ShortAdjusted,shapeSmallDownTriangle,shapeNone),colorRed,0,H,IIf(ShortAdjusted AND SellAdjusted,-30,-15));
	PlotShapes(IIf(ShortAdjusted,shapeSmallCircle,shapeNone),ColorRGB(255,20,147),0,ShortPriceAdjusted,0);
	PlotShapes(IIf(ShortAdjusted,shapeHollowSmallCircle,shapeNone),ColorRGB(255,255,255),0,ShortPriceAdjusted,0);
	PlotShapes(IIf(CoverAdjusted,shapeSmallUpTriangle,shapeNone),colorGreen,0,L,IIf(CoverAdjusted AND BuyAdjusted,-30,-15));
	PlotShapes(IIf(CoverAdjusted,shapeSmallCircle,shapeNone),ColorRGB(255,20,147),0,CoverPriceAdjusted,0);
	PlotShapes(IIf(CoverAdjusted,shapeHollowSmallCircle,shapeNone),ColorRGB(255,255,255),0,CoverPriceAdjusted,0);
	
	PlotShapes(IIf(BuyAdjustedScale1,shapeSmallDownTriangle,shapeNone),colorOrange,0,H,-15);
	PlotShapes(IIf(BuyAdjustedScale1,shapeSmallCircle,shapeNone),ColorRGB(255,20,147),0,BuyPriceAdjustedScale1,0);
	PlotShapes(IIf(BuyAdjustedScale1,shapeHollowSmallCircle,shapeNone),ColorRGB(255,255,255),0,BuyPriceAdjustedScale1,0);
	PlotShapes(IIf(BuyAdjustedScale2,shapeSmallDownTriangle,shapeNone),colorOrange,0,H,-15);
	PlotShapes(IIf(BuyAdjustedScale2,shapeSmallCircle,shapeNone),ColorRGB(255,20,147),0,BuyPriceAdjustedScale2,0);
	PlotShapes(IIf(BuyAdjustedScale2,shapeHollowSmallCircle,shapeNone),ColorRGB(255,255,255),0,BuyPriceAdjustedScale2,0);	
	
	PlotShapes(IIf(ShortAdjustedScale1,shapeSmallUpTriangle,shapeNone),colorBlue,0,L,-15);
	PlotShapes(IIf(ShortAdjustedScale1,shapeSmallCircle,shapeNone),ColorRGB(255,20,147),0,ShortPriceAdjustedScale1,0);
	PlotShapes(IIf(ShortAdjustedScale1,shapeHollowSmallCircle,shapeNone),ColorRGB(255,255,255),0,ShortPriceAdjustedScale1,0);
	PlotShapes(IIf(ShortAdjustedScale2,shapeSmallUpTriangle,shapeNone),colorBlue,0,L,-15);
	PlotShapes(IIf(ShortAdjustedScale2,shapeSmallCircle,shapeNone),ColorRGB(255,20,147),0,ShortPriceAdjustedScale2,0);
	PlotShapes(IIf(ShortAdjustedScale2,shapeHollowSmallCircle,shapeNone),ColorRGB(255,255,255),0,ShortPriceAdjustedScale2,0);

	Plot(IIf(timeWindowTrade,BY,Null),"BY",colorLime,styleLine|styleNoRescale|styleNoTitle);
	Plot(IIf(timeWindowTrade,BT1,Null),"BT1",colorGreen,styleLine|styleNoRescale|styleNoTitle);
	Plot(IIf(timeWindowTrade,BT2,Null),"BT2",colorGreen,styleLine|styleNoRescale|styleNoTitle);
	Plot(IIf(timeWindowTrade,BT3,Null),"BT3",colorGreen,styleLine|styleNoRescale|styleNoTitle);
	Plot(IIf(timeWindowTrade,SH,Null),"SH",colorRed,styleLine|styleNoRescale|styleNoTitle);
	Plot(IIf(timeWindowTrade,ST1,Null),"ST1",colorBrown,styleLine|styleNoRescale|styleNoTitle);
	Plot(IIf(timeWindowTrade,ST2,Null),"ST2",colorBrown,styleLine|styleNoRescale|styleNoTitle);
	Plot(IIf(timeWindowTrade,ST3,Null),"ST3",colorBrown,styleLine|styleNoRescale|styleNoTitle);
	Plot(IIf(timeWindowTrade,stopLong,Null),"",colorYellow,styleDashed);
	Plot(IIf(timeWindowTrade,stopShort,Null),"",colorYellow,styleDashed);
	Plot(firstTradeBarOfDay,"",ColorRGB(0,0,255),styleHistogram|styleThick|styleOwnScale|styleNoLabel,0,1,0,0);
	Plot(lastTradeBarOfDay,"",ColorRGB(200,200,200),styleHistogram|styleThick|styleOwnScale|styleNoLabel,0,1,0,0);

for(i=fvb;i<=lvb;i++) 
{
	if(displaySignalAnnotation)
	{
		if(BuyAdjusted[i]==1) PlotText("Buy",i+2,BuyPriceAdjusted[i],colorWhite,colorGreen);
		//if(BuyAdjusted[i]==1) PlotText(""+NContractArray[i],i+10,BuyPriceAdjusted[i],colorBlack,colorWhite);
		if(BuyAdjustedScale1[i]==sigScaleOut) PlotText("Scale Out",i+2,BuyPriceAdjustedScale1[i],colorBlack,colorYellow);
		if(BuyAdjustedScale2[i]==sigScaleOut) PlotText("Scale Out",i+2,BuyPriceAdjustedScale2[i],colorBlack,colorYellow);
		if(SellAdjusted[i]==1) PlotText("Sell",i+2,SellPriceAdjusted[i],colorWhite,colorRed);
		if(ShortAdjusted[i]==1) PlotText("Short",i+2,ShortPriceAdjusted[i],colorWhite,colorRed);
		if(ShortAdjustedScale1[i]==sigScaleOut) PlotText("Scale Out",i+2,ShortPriceAdjustedScale1[i],colorBlack,colorYellow);
		if(ShortAdjustedScale2[i]==sigScaleOut) PlotText("Scale Out",i+2,ShortPriceAdjustedScale2[i],colorBlack,colorYellow);
		if(CoverAdjusted[i]==1) PlotText("Cover",i+2,CoverPriceAdjusted[i],colorWhite,colorGreen);		
	}	
	if(displayLineAnnotation)
	{
		if(lastTradeBarOfDay[i])
		{
			PlotText("ENTRY LONG",i+3,BY[i],colorWhite);
			PlotText("TARGET 1",i+3,BT1[i],colorWhite);
			PlotText("TARGET 2",i+3,BT2[i],colorWhite);
			PlotText("TARGET 3",i+3,BT3[i],colorWhite);
			PlotText("ENTRY SHORT",i+3,SH[i],colorWhite);
			PlotText("TARGET 1",i+3,ST1[i],colorWhite);
			PlotText("TARGET 2",i+3,ST2[i],colorWhite);
			PlotText("TARGET 3",i+3,ST3[i],colorWhite);
			PlotText("LONG STOP",i+3,stoplong[i],colorRed);
			PlotText("SHORT STOP",i+3,stopshort[i],colorRed);
		}
	}
}
}
Back