Hello
I have finished a trading system for trading with IB.
I know receive ERRORS:
No default broker found for sell short market.
This is how I made the trading parameters:
function onAction1() {
if (vLastAlert != 1) drawTextRelative(0, low(-2), "Kauf", Color.RGB(0,128,0), Color.RGB(255,255,255), Text.LEFT, "Arial", 9);
if (vLastAlert != 1) drawShapeRelative(0, low(), Shape.UPARROW, "", Color.RGB(0,128,0), Shape.LEFT);
if (vLastAlert != 1 && !bRealTime) Strategy.doLong("", Strategy.MARKET, Strategy.THISBAR, Strategy.DEFAULT, 0);
if (vLastAlert != 1 && bRealTime) buyMarket(getSymbol(), 200 ); // Equities
vLastAlert = 1;
nDir = 1;
}
function onAction2() {
if (vLastAlert != 2) drawTextRelative(0, high(), "Verkauf", Color.RGB(255,0,0), Color.RGB(255,255,255), Text.LEFT, "Arial", 9);
if (vLastAlert != 2) drawShapeRelative(0, high(), Shape.DOWNARROW, "", Color.RGB(255,0,0), Shape.LEFT);
if (vLastAlert != 2 && !bRealTime) Strategy.doShort ("", Strategy.MARKET, Strategy.THISBAR, Strategy.DEFAULT, 0);
if (vLastAlert != 2 && bRealTime) sellShortMarket(getSymbol(), 200 ); // Equities
vLastAlert = 2;
nDir = 0;
}
I have finished a trading system for trading with IB.
I know receive ERRORS:
No default broker found for sell short market.
This is how I made the trading parameters:
function onAction1() {
if (vLastAlert != 1) drawTextRelative(0, low(-2), "Kauf", Color.RGB(0,128,0), Color.RGB(255,255,255), Text.LEFT, "Arial", 9);
if (vLastAlert != 1) drawShapeRelative(0, low(), Shape.UPARROW, "", Color.RGB(0,128,0), Shape.LEFT);
if (vLastAlert != 1 && !bRealTime) Strategy.doLong("", Strategy.MARKET, Strategy.THISBAR, Strategy.DEFAULT, 0);
if (vLastAlert != 1 && bRealTime) buyMarket(getSymbol(), 200 ); // Equities
vLastAlert = 1;
nDir = 1;
}
function onAction2() {
if (vLastAlert != 2) drawTextRelative(0, high(), "Verkauf", Color.RGB(255,0,0), Color.RGB(255,255,255), Text.LEFT, "Arial", 9);
if (vLastAlert != 2) drawShapeRelative(0, high(), Shape.DOWNARROW, "", Color.RGB(255,0,0), Shape.LEFT);
if (vLastAlert != 2 && !bRealTime) Strategy.doShort ("", Strategy.MARKET, Strategy.THISBAR, Strategy.DEFAULT, 0);
if (vLastAlert != 2 && bRealTime) sellShortMarket(getSymbol(), 200 ); // Equities
vLastAlert = 2;
nDir = 0;
}
Comment