Comment on Pi Bridge for Amibroker

MOMIN AHMAD commented on 19 Apr 2016, 04:06 PM

Dear Sir
How to apply PI Bridge formula into Amibroker. I have copy paste formula from PDF file but it is not saving in Amibroker AFL. Afl is mentioned below. Please correct this Afl.

_SECTION_BEGIN(“PiBridge Test”);
brd=Null;
if(IsNull(brd))
{
brd = CreateStaticObject(“pibridge.Bridge”);
}
if(!brd.GetConnectionStatus()) brd.Reconnect();
brd.PlaceOrder(“NFO”, “NIFTY15OCTFUT”, “NIFTY”,”STRATEGY-S”, 1,1, 1, 8700.25, 0, “L”, “NRML”, “RB0799″,”DAY”);
brd.PauseCode(60); //Pause the code for 60 seconds
_SECTION_END();
================================================================
_SECTION_BEGIN(“test”);
plus=Null;
if(IsNull(plus))
{
plus = CreateStaticObject(“pibridge.Bridge”);
}
Trading_Symbol = ParamStr(“Symbol”, ” NIFTY15OCTFUT”);
Quantity = Param(“Lots/Quantity”,1, 1, 10, 1 ,1);
Strategy = ParamStr(“Strategy Name”, “Zerodha”);
Button_Cover = ParamTrigger( “BUY”, “Click Here To Buy”);
Button_Sell = ParamTrigger( “SELL”, “Click Here To Sell”);
Start_Trading = ParamToggle(“Start Trading”, “No|Yes”,0);
Trigger_Price = Param(“Trigger Price”,7900.00,0.00,10000.00,1.00);
if(Start_Trading)
{
GfxSetBkColor(colorBlack);
Pi Bridge Help Document
GfxSetTextColor( colorWhite );
GfxSelectFont(“Times New Roman”, 25, 900, True );
GfxTextOut(“You Are Trading”, 200 , 20 );
}
if(Button_Cover==1 AND Start_Trading==1)
{plus.PlaceOrder(“NFO”, Trading_Symbol, “NIFTY”,Strategy, 1, Quantity, Quantity, Trigger_Price, 0, “L”, “NRML”,
“DN0005″,”DAY”);
PopupWindow(“Time: ” + Now() + “\n\n\n\n Price: ” + Trigger_Price,”Turtle: Cover ” + Trading_Symbol, 7200,
640*mtRandom(), 480*mtRandom());
PlaySound(“C:\\Windows\\Media\\tada.wav”);}
if(Button_Sell==1 AND Start_Trading==1)
{plus.PlaceOrder(“NFO”, Trading_Symbol, “NIFTY”,Strategy, 2, Quantity, Quantity, Trigger_Price, 0, “L”, “NRML”,
“DN0005″,”DAY”);
PopupWindow(“Time: ” + Now() + “\n\n\n\n Price: ” + Trigger_Price,”Turtle: Sell ” + Trading_Symbol, 7200,
640*mtRandom(), 480*mtRandom());
PlaySound(“C:\\Windows\\Media\\tada.wav”);}
_SECTION_END();

View the full comment thread »