I have a quick question regarding integrating live orders via IB into my current backtest strategy.
For example, if i have the following if statement:
if((Strategy.isLong()==true))
Strategy.doSell("End", Strategy.Market, Strategy.THISBAR);
Can i modify it to the following in order to invoke live trading:
if((Strategy.isLong()==true))
{
Strategy.doSell("End",Strategy.Market, Strategy.THISBAR);
IBBroker.Sell(getSymbol(), Quantity, IBBroker.Limit, close()-0.02);
}
Then, will everything automatically work by enabling the formula on the current chart I am looking at, and execute a trade via IB when the next buy/sell signal is hit?
Thank you,
Anthony
For example, if i have the following if statement:
if((Strategy.isLong()==true))
Strategy.doSell("End", Strategy.Market, Strategy.THISBAR);
Can i modify it to the following in order to invoke live trading:
if((Strategy.isLong()==true))
{
Strategy.doSell("End",Strategy.Market, Strategy.THISBAR);
IBBroker.Sell(getSymbol(), Quantity, IBBroker.Limit, close()-0.02);
}
Then, will everything automatically work by enabling the formula on the current chart I am looking at, and execute a trade via IB when the next buy/sell signal is hit?
Thank you,
Anthony
Comment