Hi,
I'm connecting to IB through Broker Manager, but get the following error message each time a buy or sell signal is triggered. Please help!
line 413: Error: Function 'sell': connection is not ready.
//Sell
if (((vMA1_1 > vMA2_1) && (vMA1 < vMA2)) && (triggeredshort == false))
{
debugPrintln("SELL nSignal " + nsignal + " islong " + islong);
if (bShowL)
{
drawShape( Shape.DOWNTRIANGLE, AboveBar4, Color.red);
}
Alert.addToList("EUR A0-FX", "Short_30", Color.black, Color.red);
Alert.playSound("swoosh.wav");
// NEWTRADE
nNewTrade = 1; // New Trade Trigger
nsignalOrg = nsignal; // capture original nsignal
nsignal = -1; // Sell Signal - Trade Type
debugPrintln("Signal for Sell done")
if (vMAdiffShort >= 0.00005)
{
Alert.email("SignalShortSteep_30");
if (inTrade == true)
{
if ((nsignal == -1) && (islong == true))
{
drawShape( Shape.DOWNARROW, AboveBar3, Color.red);
Alert.email("ReverseLongSteep_30 ");
Alert.addToList("EUR A0-FX", "ReverseLong_30", Color.black, Color.red);
// sellMarket( "EUR A0-FX" ,2);
sell( "EUR A0-FX" );
sell( "EUR A0-FX" );
islong = false;
isshort = true;
triggeredshort = true;
triggeredlong = false;
alertshort = false;
alertlong = false;
}
}
else
{
if (nsignal == -1)
{
drawShape( Shape.DOWNARROW, AboveBar3, Color.red);
Alert.email("GoShortSteep_30 ");
Alert.addToList("EUR A0-FX", "GoShort_30", Color.black, Color.red);
sell( "EUR A0-FX" );
isshort = true;
islong = false;
inTrade = true;
triggeredshort = true;
triggeredlong = false;
alertshort = false;
alertlong = false;
}
}
}
I'm connecting to IB through Broker Manager, but get the following error message each time a buy or sell signal is triggered. Please help!
line 413: Error: Function 'sell': connection is not ready.
//Sell
if (((vMA1_1 > vMA2_1) && (vMA1 < vMA2)) && (triggeredshort == false))
{
debugPrintln("SELL nSignal " + nsignal + " islong " + islong);
if (bShowL)
{
drawShape( Shape.DOWNTRIANGLE, AboveBar4, Color.red);
}
Alert.addToList("EUR A0-FX", "Short_30", Color.black, Color.red);
Alert.playSound("swoosh.wav");
// NEWTRADE
nNewTrade = 1; // New Trade Trigger
nsignalOrg = nsignal; // capture original nsignal
nsignal = -1; // Sell Signal - Trade Type
debugPrintln("Signal for Sell done")
if (vMAdiffShort >= 0.00005)
{
Alert.email("SignalShortSteep_30");
if (inTrade == true)
{
if ((nsignal == -1) && (islong == true))
{
drawShape( Shape.DOWNARROW, AboveBar3, Color.red);
Alert.email("ReverseLongSteep_30 ");
Alert.addToList("EUR A0-FX", "ReverseLong_30", Color.black, Color.red);
// sellMarket( "EUR A0-FX" ,2);
sell( "EUR A0-FX" );
sell( "EUR A0-FX" );
islong = false;
isshort = true;
triggeredshort = true;
triggeredlong = false;
alertshort = false;
alertlong = false;
}
}
else
{
if (nsignal == -1)
{
drawShape( Shape.DOWNARROW, AboveBar3, Color.red);
Alert.email("GoShortSteep_30 ");
Alert.addToList("EUR A0-FX", "GoShort_30", Color.black, Color.red);
sell( "EUR A0-FX" );
isshort = true;
islong = false;
inTrade = true;
triggeredshort = true;
triggeredlong = false;
alertshort = false;
alertlong = false;
}
}
}
Comment