For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
how to buy/sell in current (not yet closed) candle
-
Hi all,
I would like to test a strategy using Bollinger Bands that:- If price goes below (breaks out of) bottom line of Bbands:
- set a layer of buys at 2,4,6,8,10% lower than the price of said line.
- sell higher (/flex, 100% winrate)
The thing is, the logic is not that hard and I think I would know how to code it live,but I want to backtest it ofc.
Is there a way to tell bt to buy in the same candle that breaks out of the Bbands and not at the next one once the current is closed?
I'm imagining something that buys in the same candle if (layer 1,2,3,4,5) is at a price higher than the low of the candle, this way I'm not cheating because the price has surely been filled.
What im missing is basically how to tell bt to buy in data[0] and not at the open of the candle after.
Thanks to anyone who can help, and sorry if it's been asked before, I looked for an answer without luck
- If price goes below (breaks out of) bottom line of Bbands: