shut down by itself because of insufficient funds

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #116621 quote
    J.
    Participant
    Average

    So I was forward testing a trading strategy on my demo account. But this morning I saw that unfortunately it shut down by itself because of insufficient funds while trying to go short, even though it was long on market.

    I was in multiple long positions and they were in profit, but the cash I had available wasn’t enough to open a short position. However, I expected it to first close my long positions and THEN open the short position. Because closing the long positions would have freed cash from my account again to open the short position.

    This is very annoying and now I have to start over my forward testing.

    So now I want to put this in my code:

    IF SHORTCONDITION THEN
     IF LONGONMARKET THEN
      SELL AT MARKET
     ENDIF
     
     SELLSHORT AMOUNT CONTRACT AT MARKET
    ENDIF

    Will this close all my long positions before going short and thus freeing up funds to go short?

    Thank you in advance.

    #116623 quote
    Nicolas
    Keymaster
    Master

    Indeed, closing first all your orders at market will force the account to recalculate the free margin available. So your solution should work.

    J. thanked this post
    #116626 quote
    deletedaccount100622
    Participant
    New

    If your on IG.com you can bump the demo balance from the original to give you plenty of margin for testing

    Annotation-2020-01-13-115515.png Annotation-2020-01-13-115515.png
    #116628 quote
    J.
    Participant
    Average

    Great Nicolas, so SELL AT MARKET closes ALL of the open positions right? I don’t have to fill in the amount of contract for selling and exitshort?

    Thank you.

    #116629 quote
    J.
    Participant
    Average

    Thanks Robo Futures Trader, but I want my forward test to have the same amount of starting capital in comparison to what I’d trade it with on a live account, so it will give me the best representation of how it would have performed in real life.

    #116630 quote
    deletedaccount100622
    Participant
    New

    Hi @J.

    if you are out of funds when flipping from one direction to the other then perhaps this is not the size to be trading at, the margin requirements aren’t usually that high so if you stopped on trying to open two positions it sounds like you would be pretty wedded to the performance of one strategy and its drawdowns. Can you reduce the size so that you can diversify a bit and try to hedge some of the risk?

    #116635 quote
    deletedaccount100622
    Participant
    New

    I don’t know if you have seen this but if you put a value for the position size into PRT directly the minimum Qty is 1, however if you say “Buy positionsize shares at market” and have a position size variable = X then you can use the smallest amount your broker allows so 0.5 on Dax 0.2 on Wall Street for me with Ig.com

    This can let you use your capital more efficiently if it is limited

    GraHal thanked this post
    #116641 quote
    J.
    Participant
    Average

    Robo Futures Trader, so this strategy is very risky and I’ll only use it after at least 6 months of forward testing and only with money I won from trading. I won’t have to take money out of my trading account, because I don’t have to live of this fortunately.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.

shut down by itself because of insufficient funds


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
J. @j_slowly Participant
Summary

This topic contains 7 replies,
has 3 voices, and was last updated by J.
6 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/13/2020
Status: Active
Attachments: 1 files
Logo Logo
Loading...