open every day, only closes when limit is reached

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #174203 quote
    hhintzen
    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
    robertogozzi
    Moderator
    Master

    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
    robertogozzi
    Moderator
    Master

    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.

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 robertogozzi
4 years, 7 months ago.

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