Hear is a code which I have in AFL, I find NeoBrdge much simpler than PiBridge for budirectional messages but the generated signals are not coming into Neo Bridge or into PiBridge, can someone help me in this regard.
https://drive.google.com/file/d/0B-Wi5gNZXBOEeW12OFdLVzl2dUU/view?usp=sharing
Below is the NeoBridge code which should populate the signal onto NeoBridge and Pi "Generated Alerts" but the signals generating in Ami are not populating into NeoBridge.
_SECTION_BEGIN("NeoBridge");
//Parameter to set the trading month of the symbols to place orders on Pi
//Current Month
firstmon = ParamStr("firstmon","15DECFUT");
//Mid Month
secmon = ParamStr("secmon","16JANFUT");
//Far Month
thirdmon = ParamStr("thirdmon","16FEBFUT");
//Create Object of Neobridge
Neo=Null;
if(IsNull(Neo))
{
Neo=CreateStaticObject("Bridgedll.BridgeImp");
}
symbol = Name();
//Replace Symbol names with format supported by Pi bridge
if(StrFind(Name(),"-1M"))
{
symbol = StrReplace(symbol,"-1M", firstmon);
}
else if(StrFind( Name(),"-2M"))
{
symbol = StrReplace(symbol,"-2M", secmon);
}
else if(StrFind( Name(),"-3M"))
{
symbol = StrReplace(symbol,"-3M",thirdmon);
}
if(LastValue(Buy))
{
price = LastValue(C,1);
Neo.PlaceOrder(symbol,"Buy",1,price,"NRML","L",0);
}
else if(LastValue(Sell))
{
price = LastValue(C,1);
Neo.PlaceOrder(symbol,"Sell",1,price,"NRML","L",0);
}
_SECTION_END();