Close system at Next day

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #123850 quote
    Fran55Fran55
    Participant
    Veteran

    Hi.

    I want that the system fails an operation does not operate until the Next day.

     

    Thanks!

    #123862 quote
    robertogozzirobertogozzi
    Moderator
    Legend
    ONCE TradeON = 1
    IF IntraDayBarIndex = 0 THEN
       TradeON = 1
    ENDIF
    IF StrategyProfit < StrategyProfit[1] THEN
       TradeON = 0
    ENDIF
    IF MyConditionsLong AND TradeON THEN
       BUY AT MARKET
    ENDIF

    There you go, add (as I did) TradeON to your conditions to open a trade.

    #124006 quote
    Fran55Fran55
    Participant
    Veteran

    Thanks Roberto.

     

    One other question, please…

    I want when the system loss 2% of total gain in one day… The system dont operate until the Next day.

     

    Thanks!

    #124007 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Similar to the one above:

    ONCE TradeON = 1
    ONCE Capital = 10000         //this is your initial capital
    IF IntraDayBarIndex = 0 THEN
       TradeON  = 1
       MyProfit = Capital + StrategyProfit
    ENDIF
    IF (MyProfit - (Capital + StrategyProfit)) >= (MyProfit * 0.02)  THEN
       TradeON = 0
    ENDIF
    IF MyConditionsLong AND TradeON THEN
       BUY AT MARKET
    ENDIF

    Then add TradeON to your conditions to open a trade, as above.

Viewing 4 posts - 1 through 4 (of 4 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

Close system at Next day


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Fran55 @fran55 Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by robertogozzirobertogozzi
6 years, 6 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/29/2020
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...