Need help - trying to semi automate

#11
Re: Me in need of help too.....something more

Not sure if i understood ur requirement clearly, but....

have a look at amibroker documentation
http://www.amibroker.com/guide/afl/gfxroundrect.html

the first 4 parameters in GfxRoundRect() set the location and size... just change the value and see.

For GfxTextOut(), the last 2 parameters define the location
Thanks......I will see that and if doesn't work...will get back to the forum again.
 
#12
Re: Me in need of help too

Trying to create buy sell auto analyser to help me.....I tend to forget the parameters I have in my trading system....:D
Following is the basic afl I am looking for.....I can modify it later according to my needs.....I am stuck at this point:confused:
Any help forthcoming .....Thanx in advance.......

X= (O+H+L+C)/4;
Y= EMA(X,13);
Z= EMA(X,34);

UPTREND= (Y>Z);
DOWNTREND= (Y<Z);

BUY= (Y>Z) AND CROSS(Y,Z);
SELL= (Y<Z) AND CROSS(Z,Y);




I ALREADY HAVE ONE GFX WINDOW PLOTTED AS BELOW:
GfxRoundRect( x+45, y+17, x-3, y-2, 0, 0 );
GfxSetBkMode(1);
GfxSelectFont( "Arial", 8, 700, False );
GfxSetTextColor( colorBlack );
GfxTextOut( ""+SecsToGo+" / "+NumToStr( TimeFrame, 1.0 ), x, y );




I NEED TO PLOT ONE MORE GFX SPACE ALONGSIDE THE ABOVE SPACE WITH OUTPUT AS:

BKCOLOR AS BRIGHTGREEN IF UPTREND, PINK IF DOWNTREND
TEXTOUT AS "BUY" IF BUY, "SELL" IF SELL
TEXT COLOR AS GREEN IF BUY, RED IF SELL
need help with the above
 
#13
Re: Me in need of help too.....something more

Not sure if i understood ur requirement clearly, but....

have a look at amibroker documentation
http://www.amibroker.com/guide/afl/gfxroundrect.html

the first 4 parameters in GfxRoundRect() set the location and size... just change the value and see.

For GfxTextOut(), the last 2 parameters define the location
Thanks Augubhai....I finally understood how to plot a gfx space and change its location and size.:):thumb:
one more querry.....I have a gfx space already which displays a countdown timer...as in the lower post. I have been able to plot another space with your help.........how can i give a seperate back color and textout settings for the new one? This is my basic requirement:-

X= (O+H+L+C)/4;
Y= EMA(X,13);
Z= EMA(X,34);

UPTREND= (Y>Z);
DOWNTREND= (Y<Z);

BUY= (Y>Z) AND CROSS(Y,Z);
SELL= (Y<Z) AND CROSS(Z,Y);




I ALREADY HAVE ONE GFX WINDOW PLOTTED AS BELOW:
GfxRoundRect( x+45, y+17, x-3, y-2, 0, 0 );
GfxSetBkMode(1);
GfxSelectFont( "Arial", 8, 700, False );
GfxSetTextColor( colorBlack );
GfxTextOut( ""+SecsToGo+" / "+NumToStr( TimeFrame, 1.0 ), x, y );




I NEED TO PLOT ONE MORE GFX SPACE ALONGSIDE THE ABOVE SPACE WITH OUTPUT AS:

BKCOLOR AS BRIGHTGREEN IF UPTREND, PINK IF DOWNTREND
TEXTOUT AS "BUY" IF BUY, "SELL" IF SELL
TEXT COLOR AS GREEN IF BUY, RED IF SELL
 
Last edited:
#14
help.....Error5:argument 1 has incorrect type

Not sure if i understood ur requirement clearly, but....

have a look at amibroker documentation
http://www.amibroker.com/guide/afl/gfxroundrect.html

the first 4 parameters in GfxRoundRect() set the location and size... just change the value and see.

For GfxTextOut(), the last 2 parameters define the location
Please help in correction of this...
X= (O+H+L+C)/4;


Y= EMA(X,13);
Z= EMA(X,34);
Uptrend= Y>Z;
downtrend= Y<Z;


GfxRectangle( 40, 40, 120, 80 );
GfxSetBkColor(IIf(Uptrend,colorDarkGreen,IIf(downtrend,colorRed,colorLightGrey)));
 
#15
Dear Friends, is there any way to see OLD AUTOMATIC ANALYSIS and New Analysis to show in the chart, and once the signals come, as for me, they don't come in the chart unless I double click on the signals by analysis
 

augubhai

Well-Known Member
#16
Saving an old AFL here for future reference... This code is incomplete and does not work.

Code:
zSystemName="158";
ClientID=ParamStr("ClientID","xxxxx");
intSellSAR=1;
intBuySAR=2;
intSellTSL=3;
intBuyTSL=4;

//////////////////////////////////////////////////////////////////////////////////////////////////////

_SECTION_BEGIN("Bar Range");
zRange = Param("Bar Range", 1, 1, 1000);
zRange=IIf(Name()=="YESBANK13AUGFUT",25,zRange);
zRange=IIf(Name()=="JPASSOCIAT13AUGFUT",4,zRange);
zRange=IIf(Name()=="RANBAXY13AUGFUT",56,zRange);
zRange=IIf(Name()=="DLF13AUGFUT",13,zRange);
zRange=IIf(Name()=="TATASTEEL13AUGFUT",23,zRange);
zTickSize = 0.05;
zBarRange = zRange * zTickSize;
zCap = Param("Cap", 500000, 0, 1000000);
zRiskFactor = 0.01;
zRisk = zCap*zRiskFactor;
zLotSize = 50;
zTrendFactor = 1;
_SECTION_END();

function zRoundUp(zValue) {return ceil(zValue/zTickSize)*zTickSize;}
function zRoundDown(zValue) {return floor(zValue/zTickSize)*zTickSize;}
function zLS(zH,zSL) {return floor((zCap*zRiskFactor*Ref(zTrendFactor,-1)/((zH-zSL+3.5)*zLotSize)))*zLotSize;}

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat(EncodeColor(colorWhite)+"{{NAME}} - {{INTERVAL}}(%g) {{DATE}} Open %g, "+ EncodeColor(colorTeal) +"Hi %g, "+ EncodeColor(colorRed) +"Lo %g, "+ EncodeColor(colorWhite) +"Close %g (%.1f%%) {{VALUES}}", zBarRange, O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
zColor = IIf(C>O,colorGreen,IIf(C<O,colorOrange,colorLightGrey));
zColor = IIf(H-L<zBarRange,colorLightGrey,zColor);
SetBarFillColor(zColor);
Plot( C, "Close", zColor, styleNoTitle | ParamStyle("Style") | GetPriceStyle() | styleNoLabel); 
_SECTION_END();

_SECTION_BEGIN("Time Left");
function GetSecondNum()
{
    Time        = Now( 4 );
    Seconds     = int( Time % 100 );
    Minutes     = int( Time / 100 % 100 );
    Hours   = int( Time / 10000 % 100 );
    SecondNum = int( Hours * 60 * 60 + Minutes * 60 + Seconds );
    return SecondNum;
}
RequestTimedRefresh( 1 );
TimeFrame = 60;
SecNumber = GetSecondNum();
Newperiod = SecNumber % TimeFrame == 0;
SecsLeft = SecNumber - int( SecNumber / TimeFrame ) * TimeFrame;
SecsToGo = TimeFrame - SecsLeft;
_SECTION_END();

grid_DAY = IIf(Day() != Ref(Day(), -1), 1, 0); 
Plot(grid_DAY, "", colorDarkGrey, styleHistogram|styleNoLabel|styleNoRescale|styleOwnScale);

HOD = HHV(H,1+BarsSince(Day()!=Ref(Day(),-1) OR TimeNum()<=091500));
LOD = LLV(L,1+BarsSince(Day()!=Ref(Day(),-1) OR TimeNum()<=091500));
Plot(HOD,"",colorDarkGrey,styleNoRescale);
Plot(LOD,"",colorDarkGrey,styleNoRescale);

_SECTION_BEGIN("SAR");
acc = 0.2;
accm = 0.2;
zSAR=SAR( acc, accm );
zSAR=IIf(zSAR>H,zSAR,IIf(zSAR<L,zSAR,zSAR));
Plot( IIf(zSAR>H OR zSAR<L,zSAR,Null), _DEFAULT_NAME(), colorDarkYellow, styleDots | styleNoLine);
_SECTION_END();

SellSAR=zRoundDown(LastValue(Max(Min(Ref(ValueWhen(zSAR<L,zSAR),-1),LowestSince(Ref(zSAR<L,-1),L)),TimeFrameGetPrice("L",inDaily))));
BuySAR=zRoundUp(LastValue(Min(Max(Ref(ValueWhen(zSAR>H,zSAR),-1),HighestSince(Ref(zSAR>H,-1),H)),TimeFrameGetPrice("H",inDaily))));

SellTSL=zRoundDown(LastValue(Max((H-3*zBarRange),SellSAR)));
BuyTSL=zRoundUp(LastValue(Min((L+3*zBarRange),BuySAR)));

StudySS=Study("SS",GetChartID());
if(LastValue(StudySS)==LastValue(Ref(StudySS,-1)) AND LastValue(Ref(StudySS,-1))==LastValue(Ref(StudySS,-2)) AND LastValue(StudySS)>0) SellSAR=zRoundDown(Max(SellSAR,LastValue(StudySS)));
StudyBS=Study("BS",GetChartID());
if(LastValue(StudyBS)==LastValue(Ref(StudyBS,-1)) AND LastValue(Ref(StudyBS,-1))==LastValue(Ref(StudyBS,-2)) AND LastValue(StudyBS)>0) BuySAR=zRoundUp(Min(BuySAR,LastValue(StudyBS)));
StudyST=Study("ST",GetChartID());
if(LastValue(StudyST)==LastValue(Ref(StudyST,-1)) AND LastValue(Ref(StudyST,-1))==LastValue(Ref(StudyST,-2)) AND LastValue(StudyST)>0) SellTSL=zRoundDown(Max(SellTSL,LastValue(StudyST)));
StudyBT=Study("BT",GetChartID());
if(LastValue(StudyBT)==LastValue(Ref(StudyBT,-1)) AND LastValue(Ref(StudyBT,-1))==LastValue(Ref(StudyBT,-2)) AND LastValue(StudyBT)>0) BuyTSL=zRoundUp(Min(BuyTSL,LastValue(StudyBT)));

/*
zy=0;
zyincr = 16;
GfxSetBkMode(2);
GfxSelectFont("Courier New", 30, 700);
GfxSetBkColor(colorBlack);
GfxSetTextColor(colorYellow);
GfxTextOut("" + WriteIf(SecsToGo<11,"****************"+SecsToGo,""),5,zy=zy+zyincr);
GfxSelectFont("Courier New", 18, 700);
GfxSetBkColor(colorBlack);GfxSetTextColor(colorTurquoise);GfxTextOut("" + zRoundUp(Ref(ValueWhen(zSAR>H,zSAR),-1)),5,zy=zy+zyincr+zyincr);
GfxSetBkColor(colorBlue);GfxTextOut("-" + Ref(ShortTSL,-1) + "-",120,zy=zy);
GfxSetBkColor(colorBlack);GfxSetTextColor(colorPink);GfxTextOut("" + zRoundDown(Ref(ValueWhen(zSAR<L,zSAR),-1)),5,zy=zy+zyincr+zyincr);
GfxSetBkColor(colorRed);GfxTextOut("-" + Ref(LongTSL,-1) + "-",120,zy=zy);
GfxSetBkColor(colorBlack);GfxSetTextColor(colorTurquoise);GfxTextOut("" + zRoundUp(ValueWhen(zSAR>H,zSAR)),5,zy=zy+zyincr+zyincr);
GfxSetBkColor(colorBlue);GfxTextOut("-" + ShortTSL + "-",120,zy=zy);
GfxSetBkColor(colorBlack);GfxSetTextColor(colorPink);GfxTextOut("" + zRoundDown(ValueWhen(zSAR<L,zSAR)),5,zy=zy+zyincr+zyincr);
GfxSetBkColor(colorRed);GfxTextOut("-" + LongTSL + "-",120,zy=zy);
*/
//////////////////////////////////////////////////////////////////////////////////////////////////////////

procedure kStaticVarSet( SName, SValue ) 	{ StaticVarSet(zSystemName+Sname+GetChartID()+Name()+Interval(), Svalue); }
function kStaticVarGet( SName ) { 	return StaticVarGet(zSystemName+Sname+GetChartID()+Name()+Interval());	}
procedure kStaticVarSetText( SName, SValue ) 	{ StaticVarSetText(zSystemName+Sname+GetChartID()+Name()+Interval(), Svalue); }
function kStaticVarGetText( SName ) { 	return StaticVarGetText(zSystemName+Sname+GetChartID()+Name()+Interval());	}

procedure DrawButton( Text, x1, y1, x2, y2, BackColor, TextColor )
{
    GfxSetOverlayMode( 0 );
    GfxSelectFont( "Tahoma", 12, 800 );
    GfxSelectPen( colorBlack );
    GfxSetBkMode( 1 );
    GfxSelectSolidBrush( BackColor );
    GfxSetBkColor( BackColor );
    GfxSetTextColor( TextColor );
    GfxRectangle( x1, y1, x2, y2 );
    GfxDrawText( Text, x1, y1, x2, y2, 32 | 1 | 4 );
}

procedure setClickNumber()
{
	StaticVarSet("zClickCount",(Nz(StaticVarGet("zClickCount"))+1)%100);
	kStaticVarSet("zClickTime",Now(4)*100+StaticVarGet("zClickCount"));
}

procedure initializeTradingParams() 
{
	if(plus=CreateStaticObject("Nest.PlusApi")) { plus.SetObjectName(ClientID); }
	kStaticVarSetText("tpSymbol",Name());
	switch(Name())
	{
		case "YESBANK13AUGFUT":
			kStaticVarSet("tpTriggerBuffer",1);
			kStaticVarSet("tpLots",1);
			break;
		case "JPASSOCIAT13AUGFUT":
			kStaticVarSet("tpTriggerBuffer",0.4);
			kStaticVarSet("tpLots",1);
			break;
	}
}

procedure placeBuy(type) 
{
	tpTiggerPrice= -1;
	intOrdType=0;
	switch(type) 
	{
		case "SAR": tpTiggerPrice=BuySAR; intOrdType=intBuySAR; break;
		case "TSL": tpTiggerPrice=BuyTSL; intOrdType=intBuyTSL; break;
	}
	if(Name()!=kStaticVarGetText("tpSymbol")) initializeTradingParams();
	if(plus=CreateStaticObject("Nest.PlusApi")) {plus.PlaceOrder("BUY",kStaticVarGet("zClickTime")*10+intOrdType,"NFO",kStaticVarGetText("tpSymbol"),"DAY","SL",kStaticVarGet("tpLots"),tpTiggerPrice+kStaticVarGet("tpTriggerBuffer"),tpTiggerPrice,0,"NRML",ClientID);}
	switch(type) 
	{
		case "SAR": kStaticVarSet("currentBuySAR",BuySAR); break;
		case "TSL": kStaticVarSet("currentBuyTSL",BuyTSL); break;		
	}
}

procedure placeSell(type) 
{
	tpTiggerPrice= -1;
	intOrdType=0;
	switch(type) 
	{
		case "SAR": tpTiggerPrice=SellSAR; intOrdType=intSellSAR; break;
		case "TSL": tpTiggerPrice=SellTSL; intOrdType=intSellTSL; break;
	}
	if(Name()!=kStaticVarGetText("tpSymbol")) initializeTradingParams();
	if(plus=CreateStaticObject("Nest.PlusApi")) {plus.PlaceOrder("SELL",kStaticVarGet("zClickTime")*10+intOrdType,"NFO",kStaticVarGetText("tpSymbol"),"DAY","SL",kStaticVarGet("tpLots"),tpTiggerPrice-kStaticVarGet("tpTriggerBuffer"),tpTiggerPrice,0,"NRML",ClientID);}
	switch(type) 
	{
		case "SAR": kStaticVarSet("currentSellSAR",SellSAR); break;
		case "TSL": kStaticVarSet("currentSellTSL",SellTSL); break;		
	}
}

procedure modifyBuy(type) 
{
	tpTiggerPrice= -1;
	intOrdType=0;
	switch(type) 
	{
		case "SAR": tpTiggerPrice=BuySAR; intOrdType=intBuySAR; break;
		case "TSL": tpTiggerPrice=BuyTSL; intOrdType=intBuyTSL; break;
	}
	if(Name()!=kStaticVarGetText("tpSymbol")) initializeTradingParams();
	if(plus=CreateStaticObject("Nest.PlusApi")) {plus.ModifyOrder(kStaticVarGet("zClickTime")*10+intOrdType,"DAY","SL",kStaticVarGet("tpLots"),tpTiggerPrice-kStaticVarGet("tpTriggerBuffer"),tpTiggerPrice,0);}
	switch(type) 
	{
		case "SAR": kStaticVarSet("currentBuySAR",BuySAR); break;
		case "TSL": kStaticVarSet("currentBuyTSL",BuyTSL); break;		
	}
}

procedure modifySell(type) 
{
	tpTiggerPrice= -1;
	intOrdType=0;
	switch(type) 
	{
		case "SAR": tpTiggerPrice=SellSAR; intOrdType=intSellSAR; break;
		case "TSL": tpTiggerPrice=SellTSL; intOrdType=intSellTSL; break;
	}
	if(Name()!=kStaticVarGetText("tpSymbol")) initializeTradingParams();
	if(plus=CreateStaticObject("Nest.PlusApi")) {plus.ModifyOrder(kStaticVarGet("zClickTime")*10+intOrdType,"DAY","SL",kStaticVarGet("tpLots"),tpTiggerPrice+kStaticVarGet("tpTriggerBuffer"),tpTiggerPrice,0);}
	switch(type) 
	{
		case "SAR": kStaticVarSet("currentSellSAR",SellSAR); break;
		case "TSL": kStaticVarSet("currentSellTSL",SellTSL); break;		
	}
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////

//SetOption("RequireDeclarations", True ); 

procedure switchToDisarmed() 
{
	kStaticVarSet("zState",0);
}

procedure switchToFlat() 
{
	kStaticVarSet("zState",1);
	setClickNumber();
	initializeTradingParams();
//------------------------------------------------------------
//------------------------------------------------------------
//------------------------------------------------------------
//------------------------------------------------------------
plus=CreateStaticObject("Nest.PlusApi");
//plus.PlaceOrder("BUY",4,"NFO","NIFTY13SEPFUT","DAY","LIMIT",1,5000,0,0,"NRML",ClientID);
plus.ModifyOrder(4,"Day","LIMIT",1,5000.1,0,0);
	//placeBuy("SAR");
	//placeSell("SAR");
//------------------------------------------------------------
//------------------------------------------------------------
//------------------------------------------------------------
//------------------------------------------------------------
}

procedure switchToLong() 
{
	kStaticVarSet("zState",2);
	setClickNumber();
	//placeSell("TSL");
	//placeSell("SAR");
}

procedure switchToShort() 
{
	kStaticVarSet("zState",3);
	setClickNumber();
	//placeBuy("TSL");
	//placeBuy("SAR");
}

ButtonX0 = 80;//offset from right
ButtonWidth = 80;
ButtonHeight = 40;
ButtonX1=Status("pxwidth")-ButtonX0-ButtonWidth;
ButtonX2=Status("pxwidth")-ButtonX0;

armButtonLabel = "ERROR";
armButtonY1 = 20;
armButtonBackColor = colorWhite;
armButtonTextColor = colorBlack;

longButtonLabel = "LONG";
longButtonY1 = 80;
longButtonBackColor = colorWhite;
longButtonTextColor = colorLightGrey;

flatButtonLabel = "FLAT";
flatButtonY1 = 120;
flatButtonBackColor = colorYellow;
flatButtonTextColor = colorBlack;

shortButtonLabel = "SHORT";
shortButtonY1 = 160;
shortButtonBackColor = colorWhite;
shortButtonTextColor = colorLightGrey;

LButtonTrigger	= GetCursorMouseButtons() == 9;
MousePx  = Nz( GetCursorXPosition( 1 ) );
MousePy  = Nz( GetCursorYPosition( 1 ) );
 
CursorInArmButton = MousePx > ButtonX1 AND MousePx < ButtonX2 AND MousePy > armButtonY1 AND MousePy < (armButtonY1+ButtonHeight);
CursorInLongButton = MousePx > ButtonX1 AND MousePx < ButtonX2 AND MousePy > longButtonY1 AND MousePy < (longButtonY1+ButtonHeight);
CursorInFlatButton = MousePx > ButtonX1 AND MousePx < ButtonX2 AND MousePy > flatButtonY1 AND MousePy < (flatButtonY1+ButtonHeight);
CursorInShortButton = MousePx > ButtonX1 AND MousePx < ButtonX2 AND MousePy > shortButtonY1 AND MousePy < (shortButtonY1+ButtonHeight);

if ( LButtonTrigger )
{	
	switch(Nz(kStaticVarGet("zState")))
	{		
		case 1: // FLAT
			if ( CursorInArmButton ) switchToDisarmed();
			if ( CursorInLongButton ) switchToLong();
			if ( CursorInShortButton ) switchToShort();
		break;
		case 2: // LONG
			if ( CursorInArmButton ) switchToDisarmed();
			if ( CursorInFlatButton ) switchToFlat();
			if ( CursorInShortButton ) switchToShort();
		break;
		case 3: // SHORT
			if ( CursorInArmButton ) switchToDisarmed();
			if ( CursorInLongButton ) switchToLong();
			if ( CursorInFlatButton ) switchToFlat();
		break;
		default: // DISARMED
			if ( CursorInArmButton ) switchToFlat();
	}
	//Say("Apoon maalamaal ray, koi na fikar apni");
}

SetChartBkColor(colorLightGrey);

switch(Nz(kStaticVarGet("zState")))
{
		case 1: // FLAT
			//if(BuySAR<kStaticVarGet("currentBuySAR")) modifyBuy("SAR");
			//if(SellSAR>kStaticVarGet("currentSellSAR")) modifySell("SAR");
			armButtonLabel = "DISARM";
			armButtonBackColor = colorRed;
			longButtonBackColor = colorWhite;
			longButtonTextColor = colorLightGrey;
			flatButtonBackColor = colorYellow;
			flatButtonTextColor = colorBlack;
			shortButtonBackColor = colorWhite;
			shortButtonTextColor = colorLightGrey;
			SetChartBkGradientFill(colorBlack,colorBlack);
			Plot(BuySAR,"",colorBlue);	
			Plot(SellSAR,"",colorRed);			
		break;
		case 2: // LONG
			//if(SellTSL>kStaticVarGet("currentSellTSL")) modifySell("TSL");
			//if(SellSAR>kStaticVarGet("currentSellSAR")) modifySell("SAR");
			armButtonLabel = "DISARM";
			armButtonBackColor = colorRed;
			longButtonBackColor = colorYellow;
			longButtonTextColor = colorBlack;
			flatButtonBackColor = colorWhite;
			flatButtonTextColor = colorLightGrey;
			shortButtonBackColor = colorWhite;
			shortButtonTextColor = colorLightGrey;
			SetChartBkGradientFill(colorDarkBlue,colorBlack);
			Plot(SellTSL,"",colorRed,styleDashed);
			Plot(SellSAR,"",colorRed);
		break;
		case 3: // SHORT
			//if(BuyTSL<kStaticVarGet("currentBuyTSL")) modifyBuy("TSL");
			//if(BuySAR<kStaticVarGet("currentBuySAR")) modifyBuy("SAR");
			armButtonLabel = "DISARM";
			armButtonBackColor = colorRed;
			longButtonBackColor = colorWhite;
			longButtonTextColor = colorLightGrey;
			flatButtonBackColor = colorWhite;
			flatButtonTextColor = colorLightGrey;
			shortButtonBackColor = colorYellow;
			shortButtonTextColor = colorBlack;
			SetChartBkGradientFill(colorBlack,colorDarkRed);
			Plot(BuyTSL,"",colorBlue,styleDashed);
			Plot(BuySAR,"",colorBlue);
		break;
		default: //DISARMED
			armButtonLabel = "ARM";
			armButtonBackColor = colorWhite;
			armButtonTextColor = colorLightGrey;
			SetChartBkGradientFill(colorWhite,colorWhite);
			Plot(BuySAR,"",colorBlue);	
			Plot(SellSAR,"",colorRed);
}

DrawButton( armButtonLabel, ButtonX1, armButtonY1, ButtonX2, armButtonY1+ButtonHeight, armButtonBackColor, armButtonTextColor );

if (Nz(kStaticVarGet("zState"))) {
	DrawButton( longButtonLabel, ButtonX1, longButtonY1, ButtonX2, longButtonY1+ButtonHeight, longButtonBackColor, longButtonTextColor );
	DrawButton( flatButtonLabel, ButtonX1, flatButtonY1, ButtonX2, flatButtonY1+ButtonHeight, flatButtonBackColor, flatButtonTextColor );
	DrawButton( shortButtonLabel, ButtonX1, shortButtonY1, ButtonX2, shortButtonY1+ButtonHeight, shortButtonBackColor, shortButtonTextColor );
}

GfxSetTextColor(colorLightGrey);
GfxTextOut("" + kStaticVarGet("zState"),5,20);
GfxTextOut("" + StaticVarGet("zClickCount"),5,40);
GfxTextOut("" + NumToStr(kStaticVarGet("zClickTime"),1.0,False),5,60);
GfxTextOut("" + kStaticVarGetText("tpSymbol"),5,100);
GfxTextOut("BuySAR: " + BuySAR,5,120);
GfxTextOut("BuyTSL: " + BuyTSL,5,140);
GfxTextOut("SellSAR: " + SellSAR,5,160);
GfxTextOut("SellTSL: " + SellTSL,5,180);