Number of open positions?
Forums › ProRealTime English forum › ProBuilder support › Number of open positions?
- This topic has 23 replies, 3 voices, and was last updated 6 years ago by Mikael K.
-
-
03/13/2017 at 9:35 AM #28362
Hello,
I wonder if it is possible to program an indicator for the number of open positions. This information is provided in the interface and in back testing so it should be available. Does anyone know how to program this?
Sincerely
Mikael
03/13/2017 at 10:05 AM #28367There are 3 useful keywords for this already existing in PRT language depending on what positions you want to track (see manual page 18):
countofposition
countoflongshares
countofshortshares
1 user thanked author for this post.
03/13/2017 at 11:57 AM #28388These keywords are part of the online documentation: ProBacktest instructions
1 user thanked author for this post.
03/17/2017 at 5:24 PM #2896303/17/2017 at 9:36 PM #2899003/18/2017 at 4:17 PM #29030Thank you Nicolas,
two more questions:
1. Alarm: Can I have the program send an alert to my mobile when a trade opens or closes?2. Can I open as position at a certain price instead of “at market”? I want it to open a trade at a certain value but not use a stop order (since stop orders cannot be programmed in pro real code).
Sincerely
Mikael
03/18/2017 at 8:42 PM #290381. You can’t program alert with code. But you can use your broker interface to send alerts with email. You should contact them.
2. Why? It’s of course possible to code pending stop or limit orders to enter at precise prices.
03/21/2017 at 12:44 PM #2928203/22/2017 at 4:55 PM #2947003/22/2017 at 5:24 PM #29473Pending stop order: https://www.prorealcode.com/documentation/stop-pending/
Pending limit order: https://www.prorealcode.com/documentation/limit/
1 user thanked author for this post.
03/23/2017 at 10:02 AM #2955703/23/2017 at 10:32 AM #2955903/27/2017 at 2:30 PM #2999103/30/2017 at 9:31 AM #3027503/30/2017 at 4:02 PM #30378I only want the long one to trigger if the first was triggered. Do you know how I can do that?
You can set your pending long order only if you are shortonmarket on this candle and not in the previous one:
1golong = shortonmarket and shortonmarket[1]=0How can i make to program the code to only allow for a maximum loss of the system?
You can have a look at this blog article: https://www.prorealcode.com/blog/learning/max-profit-loss-day-trading-strategy/ which contain a code snippet to disallow trading when you have reached a certain amount of money loss.
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on