Maximum one trade per day- what is to do?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #187972 quote
    drive
    Participant
    Junior

    Maximum one trade per day- what is to do?

    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    // The system will cancel all pending orders and close all positions at 0:00. No new ones will be allowed until after the "FLATBEFORE" time.
    DEFPARAM FLATBEFORE = 070000
    // Cancel all pending orders and close all positions at the "FLATAFTER" time
    DEFPARAM FLATAFTER = 181500
    
    // Prevents the system from placing new orders on specified days of the week
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    // Conditions to enter long positions
    indicator1 = BollingerUp[20](close)
    c1 = (close > indicator1)
    indicator2 = Volume
    c2 = (indicator2 >= 8000)
    
    IF (c1 AND c2) AND not daysForbiddenEntry THEN
    BUY 10 PERPOINT AT MARKET
    ENDIF
    
    // Conditions to enter short positions
    indicator3 = BollingerDown[20](close)
    c3 = (close < indicator3)
    indicator4 = Volume
    c4 = (indicator4 >= 8000)
    
    IF (c3 AND c4) AND not daysForbiddenEntry THEN
    SELLSHORT 10 PERPOINT AT MARKET
    ENDIF
    
    // Stops and targets
    SET STOP pLOSS 30
    SET TARGET pPROFIT 60
    #187973 quote
    Nicolas
    Keymaster
    Master

    I added some text in your message, code only without words that explain the request are discarded.

    #187980 quote
    robertogozzi
    Moderator
    Master

    Use the OTD variable as I used it here https://www.prorealcode.com/topic/1-trade-per-day/#post-179884.

    #188016 quote
    robertogozzi
    Moderator
    Master

    This is your code ready to trade only ONCE per day:

    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    // The system will cancel all pending orders and close all positions at 0:00. No new ones will be allowed until after the "FLATBEFORE" time.
    DEFPARAM FLATBEFORE = 070000
    // Cancel all pending orders and close all positions at the "FLATAFTER" time
    DEFPARAM FLATAFTER = 181500
    
    OTD = (Barindex - TradeIndex(1) > IntradayBarIndex)
    
    // Prevents the system from placing new orders on specified days of the week
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
     
    // Conditions to enter long positions
    indicator1 = BollingerUp[20](close)
    c1 = (close > indicator1)
    indicator2 = Volume
    c2 = (indicator2 >= 8000)
     
    IF (c1 AND c2) AND not daysForbiddenEntry AND OTD THEN
    BUY 10 PERPOINT AT MARKET
    ENDIF
     
    // Conditions to enter short positions
    indicator3 = BollingerDown[20](close)
    c3 = (close < indicator3)
    indicator4 = Volume
    c4 = (indicator4 >= 8000)
     
    IF (c3 AND c4) AND not daysForbiddenEntry AND OTD THEN
    SELLSHORT 10 PERPOINT AT MARKET
    ENDIF
     
    // Stops and targets
    SET STOP pLOSS 30
    SET TARGET pPROFIT 60
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Maximum one trade per day- what is to do?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
drive @drive Participant
Summary

This topic contains 3 replies,
has 3 voices, and was last updated by robertogozzi
4 years ago.

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