Trailing buy order

Forums ProRealTime English forum ProBuilder support Trailing buy order

Viewing 9 posts - 1 through 9 (of 9 total)
  • #9861

    Hi everyone,

    Just wondered if you could advise on few things.

    1. How to code trailing BUY orders based on a price difference from a previous order?
    2. How to code current remaining account balance or percentage from it?

    Thanks.

    #9867

    Hello,

    You can try these codes for trailing stop functions:

    http://www.prorealcode.com/blog/learning/trailing-stop-max-favorable-execution-mfe/

    http://www.prorealcode.com/blog/trading/complete-trailing-stop-code-function/

    To retrieve the current balance of your account, you need first to set a variable with the balance amount at the launch of the algorithm, because it is not possible to get it with code. Then just add the strategy profit to it and you’ll get the current balance amount:

     

    #9979

    Thank you, much appreciated.

    #9995

    I looked at some examples of cumulative orders but not entirely sure how to translate them into a buying order such as:

    Buying 1st order at price x, 2nd order at price x + variable, 3d order at the price of a previous order + variable

    There are examples for shares but there is no equivalent for spreadbetting where position expressed as £pp

    Example:

     

    #9999

    You can find example of adding positions in the TRADEPRICE instruction page :

    http://www.prorealcode.com/documentation/tradeprice/

    #10004

    Tried suggested code but system constantly adds positions at stated interval, how to limit them to 3 ?

    Thank you.

    #10005

    Your ENDIF at line 5 should be at the end of the code otherwise your count of position test is doing nothing.

    #10006

    Done that. Still buying/selling orders continuously until exit. I need to limit them to 3 or 4 max. Any ideas? Thanks

    #10008

    Seems to be working now. Thank you for your advice.

Viewing 9 posts - 1 through 9 (of 9 total)

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