Hello,
If I have a strategy that enters on the open and have this logic beneath the entry… will it execute on the same bar if the condition is met?
if longonmarket then
sell at close[0] - averagetrueRange[20](Close) * 2 stop
endif
Thanks,
David
Same as
if longonmarket then
sell at close - averagetrueRange[20](Close) * 2 stop
endif
will sell at that price whenever it’s hit.
This is a pending order expiring after one bar and needs to be placed again at each new bar, if still needed.
Orders AT MARKET will be placed and executed when a candle CLOSES, while PENDING orders will be placed when a candle CLOSES but will be executed anytime, if desired price is reached, while the new candle is being formed and once the candle is formed and closed the order expires and needs to be placed again, eventually.
Yes, I am hoping the price updates every bar. Will the code re-send the order every bar it is unfilled and still in a long position?
also, you said “will sell at the price whenever it is hit”
I guess my question is.. if I enter on Monday’s open and then later in the day the price is hit will it trigger a sell on the same day (Monday)?
Is longonmarket updated immediately or at the bar’s close?
Thanks
Is longonmarket updated immediately or at the bar’s close? NO, it takes a whole bar to ProOrder to detect any status update. But you can work it around using the new MTF engine which allows you to use a lower TF which will enable your strategy to detect a new status earlier than the biggest one (but still at the end of a bar).
Do you see how confusing this is? If I enter a position on Monday’s open (because signal was True as of Friday’s close) then the sell order will not trigger until Monday’s close because LongOnMarket is not set until Monday’s close. So if my level is hit on Monday it will not exit based on what you’re saying.
‘at the end of the bar’ of the lower TF, since code is always read at Close. You can look at LongOnMarket condition on a lower timeframe, like the 5-minute one for instance.
Surely if conditions for Long entry at Market are met on Friday Close and the Long entry is executed on Monday open then (from Monday Open / Long entry executed) PRT knows it is LongonMarket (because PRT will update status at the point of Long entry conditions being met (at Market) which is Friday Close??)?
Even as I write above (and I’m glad I did) I guess there is always the possibility that the at Market Long is not met on Monday Open and so Long Status can only be updated after the next complete bar so at Monday Close … is this correct??
Yes, I do not want to use multiple time frames and asked a simple YES or NO question. Every time I use this thread I can never get a clear response without obfuscation. I will ask a final time…
if trading signal is true on Friday’s close and I enter on Monday’s open.
will this logic
if longonmarket then
sell at close[0] - averageTrueRange[20](close) * 2 stop
endif
execute an order on that same Monday if the price is hit?
YES or NO?
YES.
But ‘longonmarket’ condition must be true, and only if the long order is present when the code is read at Friday’s Close. Hope that it is clear now and without obfuscation, people just trying to help 😉