Is it possible to buy and sell position on the same bar?
For example, I have a signal price to open position and I want to exit position on the same bar if my stop price is reached.
BuyAtStop(bar, Low[bar - 1]);
Stop = Low[bar - 1] - Atr[bar];
SellAtStop(bar, ActivePositions[p], Stop, "StopExit")?
When I use this script WL only exits next bar or two bars later. Using SellAtStop(bar+1, ActivePositions[p], Stop, "StopExit") not helps.
Thanks,
Size:
Color:
Since your same bar scenario is known to be pretty specific, please look no further:
FAQ >
FAQ | Strategies and WealthScript >
I want to test a strategy that buys and sells with stop/limit orders on the same barArmed with this knowledge, search the forum for
"same bar": the search-as-you-type feature is making it effortless, and I'm sure you'll find a number of code snippets to serve as example.
Size:
Color: