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
    thomas2004chthomas2004ch
    Participant
    Senior

    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
    NicolasNicolas
    Keymaster
    Legend

    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
    thomas2004chthomas2004ch
    Participant
    Senior

    Hi Nicolas,

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

    #90775 quote
    thomas2004chthomas2004ch
    Participant
    Senior

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

    #90961 quote
    thomas2004chthomas2004ch
    Participant
    Senior

    I find out the document.

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

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

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 thomas2004chthomas2004ch
7 years, 9 months ago.

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