calculate number of transactions per day

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #173935 quote
    hhintzen
    Participant
    Junior
    I use this simple strategy.
    I want that this strategy is only allowed to trade twice (or any other number) a day.
    The strategy must start at 9am every day, regardless of whether the day before closed with a profit.
    // 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 10 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
    #173936 quote
    robertogozzi
    Moderator
    Master

    There you go:

    // 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 FlatBefore = 090000
    DefParam FlatAfter  = 230000
    
    // Voorkomt dat het systeem handelt op specifieke dagen van de week
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    MyConditions = (open <= WeightedAverage[14](medianPrice))
     
    Once TradeON = 2
    If IntraDayBarIndex = 0 then
    TradeON = 2
    Endif
     
    //If OnMarket or StrategyProfit <> StrategyProfit[1] Then
    //TradeON = 0
    //endif
     
    If MyConditions and TradeON and Not DaysForbiddenEntry and time >= 090000 and time <= 230000 and Not OnMarket Then
    Sellshort 10 CONTRACT AT MARKET
    TradeON = TradeON - 1
    Endif
     
    // Stops and targets
    //SET STOP ptrailing 15
    SET TARGET pPROFIT 10
    graph MyConditions
    graph TradeON

    1.5 pips for the stop loss was too little to work.

    #174055 quote
    hhintzen
    Participant
    Junior

    <span class=”Y2IQFc” lang=”en”>Hi Roberto, thank you for your help.
    I have one more question, my “system” buys every morning from 9 am, and closes at 11 pm.
    Can i also program it to allow him to buy every day from 9 am, but not close at 11pm.
    Only close when 10 points profit is achieved, no matter how many days this takes.</span>

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

calculate number of transactions per day


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
hhintzen @hhintzen Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 07/20/2021
Status: Active
Attachments: No files
Logo Logo
Loading...