Number of open positions?

Forums ProRealTime English forum ProBuilder support Number of open positions?

Viewing 15 posts - 1 through 15 (of 24 total)
  • #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

    #28367

    There 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.
    #28388

    These keywords are part of the online documentation: ProBacktest instructions

     

    1 user thanked author for this post.
    #28963

    Thanks guys,

    just a follow up question: How can i make contract size contingent on funds or equity?

    Sincerely

    Mikael

    #28990

    Indicators (Probuilder) can’t retrieve currently opened orders,even with the keywords listed above in previous  Noobywan’s post.

    #29030

    Thank 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

    #29038

    1. 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.

    #29282

    Thank you,

    strange, when i called my broker they said it wasn’t possible to code pending stop/limit orders. What is the code for that?

    Sincerely

    Mikael

    #29470

    Hi,

    If anyone knows how to “code pending stop or limit orders to enter at precise prices” or can direct me to some text explaining it, I would be grateful.

    Sincerely

    Mikael

    #29473

    Pending 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.
    #29557

    Thank you,

    I am trying to buy 1.2 contracts by writing “if x then buy 1 contract endif”. The code executes but only buys 1 contract instead of 1.2. Do you know why?

     

    Sincerely

    Mikael

    #29559

    Because you can only buy rounded contracts quantity, not with decimals.

    1 user thanked author for this post.
    #29991

    Thank you,

    One more question: I want to program two stop orders, one long and one short. I only want the long one to trigger if the first was triggered. Do you know how I can do that?

    Sincerely

    Mikael

    #30275

    Hi again,

    Still looking for an answer to the question above but have one more: How can i make to program the code to only allow for a maximum loss of the system?

    Sincerely

    Mikael

    #30378

    I 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:

     

    How 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.
Viewing 15 posts - 1 through 15 (of 24 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login