Hi
Any idea what the code is to open and close a position in 1 bar.
Many thanks
You have to use MTF (Muti Time Frame) support.
If you are using 1-hour TF to open a position you can use 1-minute (or lower) TF to exit on minute ore second 59:
Timeframe (1h,UpdateOnClose)
If MyConditions Then
Buy at market
Endif
Timeframe (default)
If LongOnMarket and OpenMinute = 59 Then
Sell At Market
Endif
This topic is about a strategy, not a screener, so I moved it to ProOrder support.
Next time try to use the correct support forum, please.
Thanks 🙂
If not at the end of the same candle, what about at the beginning of the next candle?
What if we define for exiting long (or short) position conditions: (for backtesting purposes)
close>= opening price
close<opening price
(any condition to be acomplished, to ensure every position opened at the beginning of the candle will be closed at the beginning of the next candle)
I’ve tried to do like this, but it seems not to work I don’t know why (it seems to work just for the first candle an order is opened,… but probacktest don’t open any order more later than this first time the first order is opened and closed) Thank you.