Entry methods : at market, stop and limit
Forums › ProRealTime English forum › ProOrder support › Entry methods : at market, stop and limit
- This topic has 12 replies, 6 voices, and was last updated 5 years ago by robertogozzi.
-
-
03/03/2018 at 10:30 PM #64323
If you want to open a position, there appears to be (at least) two entry commands possible at the end of the line, see example below:
if Condition A then
Buy 1 share “at market” (most commonly used, which execute the buy order always, usually at the price of opening of the first following bar, after spread)
Buy 1 share at Low “stop”
My question is what exactly the latest command does ?
Thanks in advance for the information !
Moderator’s edit: topic moved from “platform support forum” to “ProOrder support forum” (rule number one of platform support forum: do not use it for programming issues/questions, use dedicated forums instead)
03/03/2018 at 10:40 PM #64324Hi Jan
Hope below helps?
If not just say.
Cheers
GraHalPS Low or Low[0] is the Low of the current bar, Low[5] is the Low of bar which is / was 5 bars before the current bar.
https://www.investopedia.com/ask/answers/04/022704.asp
03/05/2018 at 5:53 PM #64474GraHal,
thanks for the reply, and the attachment ! The link /topic/entry-methods-at-market-stop-and-limit/#post-64324 is clear !
Should have known this. Another question:
- When does the stop or limit order disappear (when not filled) ? Alternatively which code to use to do so ?
2. How to best search on this platform for topics ?
Kind regards
03/05/2018 at 6:28 PM #64478- When does the stop or limit order disappear (when not filled) ? Alternatively which code to use to do so ?
Pending orders are deleted every time when the bar closes. If you needed longer then make it so in the code like:
buy 1 share at lowest[5](low) Limit
or
sellshort 1 share at lowest[5](low) Stop
03/05/2018 at 7:00 PM #6448303/05/2018 at 9:39 PM #6450603/07/2018 at 2:15 PM #64671Pending orders are deleted every time when the bar closes. If you needed longer then make it so in the code like:
Pending orders have an expiration time of only 1 period, whatever is the price levels set with STOP or LIMIT.
04/10/2019 at 8:39 PM #96003Hi Nicolas,
Is there any way to extend the expiration time of a pending order to more than 1 period, like for the next two or three periods?
If not, is it possible to create an alternative solution like for example:
1. if order not filled then place order again or
2. if order not filled then check the entry conditions again but now we have to check two periods ago? Does that make sense?
Thanks.
Sascha
04/10/2019 at 9:13 PM #96005Set a flag when conditions are met, then clear it when conditions are no more met.
While the flag is set place a new pending order each bar.
04/11/2019 at 12:14 PM #96067Thanks Roberto for your comment.
However, how do I set a flag and put what you said in a code?
Is there any other forum post that you know of that describes this in more detail?
It’s hard to find with so many posts in this forum.
Thanks in advance.
04/11/2019 at 12:26 PM #96068You can easily search topics with common words like “sma”, “stochastic”,”ichimoku”, but it’s difficult to find matches for, say, “set a flag” or similar.
You can set it when your conditions are met:
123456ONCE CondFlag = 0 //Write this line BEFORE using CondFlag..IF MyConditions THENCondFlag = 1ENDIFThen clear it when they are no more met or when onmarket:
123IF not MyConditions OR OnMarket THENCondFlag = 0ENDIFUse it to place a pending order:
123IF CondFlag THENBUY/SELLSHORT 1 CONTRACT AT MyEntryPrice STOP/LIMITENDIF04/11/2019 at 2:49 PM #96106Thanks Roberto.
I’m trying to wrap my head around this.
If on the 1st 15min bar MyConditions are met (I have 7 conditions), then it will set the CondFlag to 1.
It will then place a pending order.
Question: Will this order stay or would it be cancelled like every other order after the end of the 15min bar if there is no fill?
Then in the 2nd 15min bar it will check again if MyConditions are met (which for my strategy is not the case as the signal will always be there for only 1 bar), so it would immediately set the CondFlag to 0 again and there would be no new order.
Thanks.
04/11/2019 at 3:25 PM #96113Pending orders expire after ONE bars and have to be placed again, if needed.
You set the CONDFLAG when your conditions are true, then, to enter a BUY/SELLSHORT pending order you should NOT rely on your conditions any more, rather use CONDFLAG.
You don’t have to set CONDFLAG exactly when your 7 conditions are no more met, otherwise it is useless. You must clear it when:
- you are OnMarket (unless you want to add further contracts)
- your conditions (can be different from those to start placing it) to place the pending order are no more valid (maybe after a number of elapsed bars without being triggered or when some MA’s cross the other way round….)
-
AuthorPosts
Find exclusive trading pro-tools on