How to exit condition if a stock is bought after 20 days?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #90597 quote
    thomas2004ch
    Participant
    Average

    Hi,

    I am going to create a backtesting/trading system. One of my exit conditions is: If a stock is bought after 20 days, it will exit. How is the code for that?

    Besides, I don’t want to set the fix number of the stock. I want to use 5% for example of the capital. How to do that?

    Regards

    #90621 quote
    Nicolas
    Keymaster
    Master

    For position size, there is an interesting topic with some code snippets: Dynamic Position size

    How to exit after n bars:

    Exit after (n) days

    Exit after 10 bars?

    #90774 quote
    thomas2004ch
    Participant
    Average

    Hi Nicolas,

    Thanks for the reply. I wonder where can I find the documentation of ProBacktest(as PDF or HTML)?

    #90775 quote
    thomas2004ch
    Participant
    Average

    Besides, as I use the TOTALEQUITY, I got error that this is not defined. Also the INITIALCAPITAL is not defined.

    #90961 quote
    thomas2004ch
    Participant
    Average

    I find out the document.

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

How to exit condition if a stock is bought after 20 days?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by thomas2004ch
7 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 02/06/2019
Status: Active
Attachments: No files
Logo Logo
Loading...