Morning Everybody !
Can somebody please tell me why (on 6e #f), does the following code not *always* close my open positions at the end of the day ? :
if (getHour(0)>=21){
if (Strategy.isLong){
Strategy.doSell("End of Day", Strategy.CLOSE, Strategy.THISBAR);
}
if (Strategy.isShort){
Strategy.doCover("End of Day", Strategy.CLOSE, Strategy.THISBAR);
}
}
It only seems to work about 50% of the time which is weird.
Many Thanks
Roger
Can somebody please tell me why (on 6e #f), does the following code not *always* close my open positions at the end of the day ? :
if (getHour(0)>=21){
if (Strategy.isLong){
Strategy.doSell("End of Day", Strategy.CLOSE, Strategy.THISBAR);
}
if (Strategy.isShort){
Strategy.doCover("End of Day", Strategy.CLOSE, Strategy.THISBAR);
}
}
It only seems to work about 50% of the time which is weird.
Many Thanks
Roger
Comment