PiBridge to Amibroker issue. Problem in Firing order Signal to Signal

/* PiBridge to Amibroker issue … problem in Firing order Signal to Signal ​…

Orders are not getting fired to PiBridge from Amibroker… conncetion is not set but the PiBridge status is showing green… It is showing error at the PaceOrder function and not taking the values including ClientId. Please help in firing order in AFL code …

_SECTION_BEGIN(“Heiken Ashi”);

/*
Here I want to place my strategy code OR logic.
I will move Buy & Sell values finally.

I want to fire orders form Amibroker to Pi through PiBridge.

Orders should fire signal to Signal. Buy to Sell, Short to Cover.

*/

_SECTION_END();

Buy = x;
Short = y;

Buy = ExRem(x,y);
Short= ExRem(y,x);

Cover = Buy;
Sell = Short;

Buyshape = Buy * shapeUpArrow;
SellShape = Sell * shapeDownArrow;

PlotShapes( Buyshape, colorGreen, 0, HaLow, offset=-45 );
PlotShapes( SellShape, colorRed, 0, HaHigh, offset=-45 );

Shortshape = Short * shapeDownArrow;
CoverShape = Cover * shapeUpArrow;

PlotShapes( Shortshape, colorCustom10, 0, HaHigh, offset = -60);
PlotShapes( CoverShape, colorTurquoise, 0, HaLow, offset= -60 );

dist = 2 * ATR( 25 );
for ( i=BarCount-1; i > 0; i-- )
{
if ( Buy[i] )
PlotText(NumToStr(HaLow[i-1],1.3),i, HaLow[i-1] - dist[i], bkcolor = ColorWhite, colorGreen);

if ( Sell[i] )
    PlotText(NumToStr(HaHigh[i-1], 1.3),i,HaHigh[i-1]+ dist[i],bkcolor = ColorWhite, colorRed);

// if ( Short[i] )
// PlotText(NumToStr(HaHigh[i-1], 1.3),i,HaHigh[i-1]+ dist[i],bkcolor = ColorWhite, colorCustom10);

// if ( Cover[i] )
// PlotText(NumToStr(HaLow[i-1],1.3),i, HaLow[i-1] - dist[i], bkcolor = ColorWhite, colorTurquoise);
}

// We added PiBridge Code here …

brd=Null;
if(IsNull(brd))
{
brd = CreateStaticObject(“pibridge.Bridge”);
}
if(!brd.GetConnectionStatus()) brd.Reconnect();

//if(OrdCond AND CheckOne != CheckTwo)

if(LastValue(Buy))
{
brd.PlaceOrder (Exch, TrdSymbol ,Symbol,“Heiken Ashi Smoothed”, 1,Qty,0, BuyP, 0, OType, PType, ClientId,“DAY”);
}

if(LastValue(Sell))
{
brd.PlaceOrder (Exch, TrdSymbol,Symbol,“Heiken Ashi Smoothed”, 2,Qty,0, SellP, 0, OType,PType, ClientId,“DAY”);
}

if(LastValue(Cover))
{
brd.PlaceOrder (Exch, TrdSymbol,Symbol,“Heiken Ashi Smoothed”, 1,Qty,0, CoverP, 0, OType, PType, ClientId,“DAY”);
}

if(LastValue(Short))
{
brd.PlaceOrder (Exch, TrdSymbol,Symbol,“Heiken Ashi Smoothed”, 2,Qty,0, ShortP, 0, OType,PType, ClientId,“DAY”);
}
StaticVarSet(“Check”,CheckTwo );

//Alert = Buy OR Short OR Cover OR Sell;
//AlertIf(Alert,“SOUND C:\Windows\Media\Notify.wav”, “Audio alert”, 0 );

_SECTION_END();

/*

The above PoBridge code is not working … not setting connection with the Pi…

*/

hElLO tRaDeR,

For a faster response on Pi bridge queries , you can find like minded programmers on the Kite api development forum:

 https://kite.trade/forum/discussions