Hi all,
Please can anyone tell me whether the code below will turn the price bar yellow on the same bar on which the profit target is breached, or the next one. I am in backtesting mode.
Thanks
Deax.
/*----------------------------------------------------------
This portion of the code tests for a stop level breach and
executes trades accordingly.
----------------------------------------------------------*/
if (Strategy.isInTrade() == true && (Strategy.isShort() == true)) {
// Check if the profit target has been reached/breached
if (high() >= nStopLevel) {
// Stop Breached, Execute Cover order.
Strategy.doCover("Short Stop Exit", Strategy.STOP, Strategy.THISBAR,
Strategy.getDefaultLotSize(), nStopLevel);
setPriceBarColor(Color.yellow);
}
}
Please can anyone tell me whether the code below will turn the price bar yellow on the same bar on which the profit target is breached, or the next one. I am in backtesting mode.
Thanks
Deax.
/*----------------------------------------------------------
This portion of the code tests for a stop level breach and
executes trades accordingly.
----------------------------------------------------------*/
if (Strategy.isInTrade() == true && (Strategy.isShort() == true)) {
// Check if the profit target has been reached/breached
if (high() >= nStopLevel) {
// Stop Breached, Execute Cover order.
Strategy.doCover("Short Stop Exit", Strategy.STOP, Strategy.THISBAR,
Strategy.getDefaultLotSize(), nStopLevel);
setPriceBarColor(Color.yellow);
}
}
Comment