Where do I insert the '' trade.Sell(getSymbol(), 1, IBBroker.MARKET); '' code:
function onAction2() {
if (vLastAlert != 2) Strategy.doSell("", Strategy.CLOSE, Strategy.THISBAR, Strategy.DEFAULT, 0);
vLastAlert = 2;
}
I have tried to replace the '' Strategy.doSell '' with IBBroker sell code but without success.
Should use a doSell functionÉ
function doSell(); {¨
trade.Sell(getSymbol(), 1, IBBroker.MARKET);
function onAction2() {
if (vLastAlert != 2) Strategy.doSell("", Strategy.CLOSE, Strategy.THISBAR, Strategy.DEFAULT, 0);
vLastAlert = 2;
}
I have tried to replace the '' Strategy.doSell '' with IBBroker sell code but without success.
Should use a doSell functionÉ
function doSell(); {¨
trade.Sell(getSymbol(), 1, IBBroker.MARKET);