I'm referring to BTMovingAverage.efs
Strategy.CLOSE – uses the closing price as the fill price.
Strategy.MARKET – uses the open price as the fill price.
Can it be made possible to use the MA value as the fill price?
I tried to add 3 Cents to the open price when open a long, and subtracting 3 Cents when open a short position, like:
if(close() >= v) {
if(!Strategy.isLong()) {
Strategy.doLong("Crossing Up", Strategy.MARKET+0.03, Strategy.THISBAR);
}
} else {
if(!Strategy.isShort()) {
Strategy.doShort("Crossing Down", Strategy.MARKET-0.03, Strategy.THISBAR);
}
}
It didn't work.
Is there another way to modifiy the fill price?
Thanks for suggestions.
Strategy.CLOSE – uses the closing price as the fill price.
Strategy.MARKET – uses the open price as the fill price.
Can it be made possible to use the MA value as the fill price?
I tried to add 3 Cents to the open price when open a long, and subtracting 3 Cents when open a short position, like:
if(close() >= v) {
if(!Strategy.isLong()) {
Strategy.doLong("Crossing Up", Strategy.MARKET+0.03, Strategy.THISBAR);
}
} else {
if(!Strategy.isShort()) {
Strategy.doShort("Crossing Down", Strategy.MARKET-0.03, Strategy.THISBAR);
}
}
It didn't work.
Is there another way to modifiy the fill price?
Thanks for suggestions.
Comment