Comment on Pi Bridge for Amibroker

Udit commented on 23 Jan 2015, 05:08 PM

Its working fine now. It will be a really convenient feature for my wife :). Now if you can just add support for cover orders it will be really great. We can calculate the SL in AFL and pass it on to Pi through the bridge.

Sharing the afl snippet that I am using to help others..

_SECTION_BEGIN(“Pie Bridge”);

enablePiBridge = ParamToggle(“Enable PI Bridge?”,”NO|YES”,1);

Contract = ParamStr(“Contract”,”NIFTY15JANFUT”);
Sym = ParamStr(“Symbol”,”NIFTY”);
nLots = Param(“Lots”,4,1,20,1);

if(enablePiBridge) {

brd=Null;
if(IsNull(brd)) {
brd = CreateStaticObject(“pibridge.Bridge”);
}// AFL Buy/Sell Logic

if(!brd.GetConnectionStatus()) brd.Reconnect();

if(EndValue(Buy) == 1) {
brd.PlaceOrder (“NFO”, Contract,Sym,”PIVOTBREAKLong”, 1,nLots,0, EndValue(C), 0, “LIMIT”, “MIS”, “DU0126″,”DAY”);

}

if(EndValue(Sell) == 1) {
brd.PlaceOrder (“NFO”, Contract,Sym,”PIVOTBREAKLong”, 2,nLots,0, EndValue(C), 0, “LIMIT”, “MIS”, “DU0126″,”DAY”);

}

if(EndValue(Cover) == 1) {
brd.PlaceOrder (“NFO”, Contract,Sym,”PIVOTBREAKLong”, 1,nLots,0, EndValue(C), 0, “LIMIT”, “MIS”, “DU0126″,”DAY”);

}

if(EndValue(Short) == 1) {
brd.PlaceOrder (“NFO”, Contract,Sym,”PIVOTBREAKLong”, 2,nLots,0, EndValue(C), 0, “LIMIT”, “MIS”, “DU0126″,”DAY”);

}

}

_SECTION_END();

View the full comment thread »