Insufficient Capital in Strategy Backtesting when Buying Futures and Forex Asset

Forums ProRealTime English forum ProBuilder support Insufficient Capital in Strategy Backtesting when Buying Futures and Forex Asset

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

    I am backtesting a trading strategy with different asset classes. For the time being, it has worked properly with indices and stocks. Nonetheless, when analysing Futures or Forex , the position is opened at the opening price of a candle and then closed at the close price of the very same candle, although the sell conditions are not met.

    I believe the error is related to how shares are bought and the leverage that might be involved, as the message I am getting In the ‘Equity Curve’ chart panel is Insufficient capital, but since I am still a beginner, I do not actually know how to go about this . I am using the following code:

    It would be highly appreciated if you could let me know how to fix the code.

    Many thanks in advance for your help!

    #243395

    As to your exiting condition, simply append this line to your code, so you can see when it’s TRUE:

    As to the Capital, input the value you want as shown in the highlighed box (see the attached pic).

    But you should also reduce your InitialCapital, as the larger it is the higher number of assets/lots will be traded, without solving the problem.

    #243403

    Thanks for your reply, robertogozzi.

    I have been modifying the code as you suggested, and the sell condition is not triggered, as you can see in the image attached.

    Concerning the initial capital, I have tried different values: 100, 1k, 10k, 100k, 1M. Although 1 future contract was worth 35-40USD at the entry time step, the ‘insufficient capital’ issue is not solved…any ideas?

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