Buy and Sell Code Discrepancy

Forums ProRealTime English forum ProOrder support Buy and Sell Code Discrepancy

Viewing 3 posts - 1 through 3 (of 3 total)
  • #92853

    Hi guys, I’m new here just tinkering around my setup until I have this problem.

     

    I want to close out all short/long position when a condition is fulfilled and proceed with adding new long/short position at the same time. The problem is I have three different result when the code seemingly have the same logic. *or is it me?*

     

    Below code give me below error when I want to prepare it for automated trading.

    “Trading systems with orders that partially close a position cannot be sent to ProOrder”

    This version 1 below gives me 400% return but code does not work as mentioned earlier.

    So I moved on to the version 2, the code works however it only give me 100% return.

    So I went on with version 3, this code works as well but this time give me 300% return

    I like to be able to get back where i can have 400% return, but I do not understand why there are differences in the results from the three versions.

     

    Appreciate it if any guru can help with this.

    EJ

     

    #92856

    Found the solution. Replaced BUY AT MARKET with EXITSHORT. Still don’t understand the difference.

     

    #92858
    • To open a long position use BUY.
    • To close a long position use SELL.
    • To open a short position use SELLSHORT.
    • To close a short position use EXITSHORT.

     

    If you are long on the market then a SELLSHORT instruction will close all long positions.

    If you are short on the market then a BUY instruction will close all short positions.

    Partial closure of positions, for example: BUY 5 contracts then SELL 1 contract is possible only in backtesting. You cannot run a strategy live with partial closure at the moment in PRT.

    1 user thanked author for this post.
Viewing 3 posts - 1 through 3 (of 3 total)

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