Open immediately
Forums › ProRealTime English forum › ProOrder support › Open immediately
- This topic has 7 replies, 2 voices, and was last updated 5 years ago by robertogozzi.
-
-
08/12/2018 at 1:04 AM #78024
What is the code to enter a trade when a condition is met instead of next candle open?
What I am trying to do is once it has passed my condition say yesterdays close to open a position immediately and not wait until the open of the next candle?
08/12/2018 at 2:08 AM #78025Trades are ALWAYS opened immediately, unless you delay them with pending orders.
Strategies are executed when a candle closes and, if conditions are met, a trade is immediately entered in the new just opening candle.
Conditions cannot be evaluated while a candle is forming.
Multiple Time Frame, MTF, support just added for demo trading, did not change this behaviour, but it allows to combine higher and lower TFs so that you can evaluate conditions and eventually enter earlier, but still when the candle in the lower TF closes.
08/12/2018 at 2:18 AM #78026Thank you Robert for your reply.
That seems silly. If say I want to buy once the price has past yesterdays high, I dont want to wait for the candle to close and start a new one. So the only way I can do this is manually? For an example – lets say I have a 4hr bar and I want to go long once the high of the previous bar has been passed are you saying I cannot do this and it will only enter a trade once the next 4 hour bar has opened? meanwhile the breakout has already happened and left my entry on the next candle which just might be a retrace and get stopped out.
08/12/2018 at 7:18 AM #78029You can certainly do that using pending orders.
You can write:
12BUY 1 CONTRACT AT HIGH STOP //buy when current HIGH is reachedBUY 1 CONTRACT AT HIGH[1] STOP //buy when previous HIGH is reachedBear in mind that pending orders expire when each bar closes and you need to enter them again if conditions are still met.
But, to go back to your question, even the decision to enter a pending order must be made when a bar closes, not while a bar is being formed.
That’s not a big problem, we normally make decisions after some event, say MA crossovers or the like, are confirmed at the closure of a bar.
08/12/2018 at 9:02 AM #7803108/12/2018 at 9:41 AM #78033Yes, you can!
You should backtest them always in tick-by-tick mode.
ProOrder will be aware of them only when the bar closes and by then more than one pending order could be triggered, regardless of how you set DEFPARAM CUMULATEORDERS, say you set two orders, one triggered when thr price reaches the previous high and another one when it reaches the previous low. They might be both triggered before the candle closes, you need to know that!
You can find examples here:
https://www.prorealcode.com/topic/setting-a-pending-order-while-on-market/#post-25881
https://www.prorealcode.com/topic/hedging-strategy/#post-33807
https://www.prorealcode.com/prorealtime-trading-strategies/breakout-range-ts/
https://www.prorealcode.com/topic/number-of-open-positions/#post-29473
You can also read documentation about Stop/Limit orders.
08/12/2018 at 9:48 AM #78034Looks like I have more reading to do.
My strategy is based on a 4hr bar and can only enter on the next bar. If an entry is triggered it must be closed by close of bar unless profit or loss reached. If no entry I wait until the next days time frame when the 4 hr bar is completed and the system starts again. Entry is based on prior high or low or open. May consider trend filter yo stop trades entering for no good reason
08/12/2018 at 10:39 AM #78035MTF is a highly acclaimed feature now available for demo accounts, but will soon be available for real autotrading.
If you want to queue up further readings:
https://www.prorealcode.com/blog/learning/approach-multi-timeframe-trading-prorealtime/
https://www.prorealcode.com/topic/betatesting-multitimeframe-support-automatic-trading/
-
AuthorPosts
Find exclusive trading pro-tools on