open every day, only closes when limit is reached

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #174203 quote
    hhintzenhhintzen
    Participant
    Junior

    I use this strategy.
    Tis system aso opens every day, but also closes at midnight.
    I want this system not to close at midnight, but only close when the limit is reached.
    No mather how long this takes to close.

    // Definitie van code parameters
    DEFPARAM CumulateOrders = False // Opstapelen posities gedeactiveerd
    // Het systeem zal alle lopende orders annuleren en alle posities sluiten om 0:00. Er zijn geen nieuwe toegestaan totdat na de ā€œFLATBEFOREā€ tijd.
    DEFPARAM CumulateOrders=false
    
    DefParam FlatBefore = 090000
    //DefParam FlatAfter = 230000
    
    MyConditions = (open <= WeightedAverage[14](medianPrice))
    
    Once TradeON = 1
    If IntraDayBarIndex = 0 then
    TradeON = 2
    Endif
    If OnMarket or StrategyProfit <> StrategyProfit[1] Then
    TradeON = 0
    endif
    
    If MyConditions and TradeON and Not OnMarket Then
    Sellshort 100 CONTRACT AT MARKET
    Endif
    
    // Voorkomt dat het systeem handelt op specifieke dagen van de week
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    // Stops and targets
    //SET STOP ptrailing 15
    SET TARGET pPROFIT 1.5
    #174205 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Post your topic in the correct forum:
    _ ProRealTime Platform Support: only platform related issues.
    _ ProOrder: only strategy topics.
    _ ProBuilder: only indicator topics.
    _ ProScreener: only screener topics
    _ General Discussion: any other topics.
    _ Welcome New Members: for new forum members to introduce themselves.

    I moved it from ProBuilder.

    Thank you šŸ™‚

    #174206 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Remove or comment out line 6.

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

open every day, only closes when limit is reached


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
hhintzen @hhintzen Participant
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/26/2021
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...