Fixed number of trades per day

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #233588 quote
    MaoRai54MaoRai54
    Participant
    Master

    hi,

    I’m trying a strategy in which I want to fix the number of trades per each day.

    I’ve found the OTD of Roberto but it is limited to only a trade per day.

    I’d like to have a flexible snippet in which I put the number I’ve chosen.

    Is there any snippet available?

    Thanks in advance

    #233589 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Hi! you should create a variable to control the number of trades.
    For example “n”:

    ema20=average[20,1](close)
    
    //if intradaybarindex=0 then
    //n=0
    //endif
    
    if close>ema20 and n<4 then
    n=n+1
    buy 1 contract at market
    endif
    
    if time>160000 then
    sell at market
    n=0
    endif

    You can restart after close the position or when intradaybarindex is cero.

    MaoRai54 and robertogozzi thanked this post
    #233592 quote
    MaoRai54MaoRai54
    Participant
    Master

    Many thanks IVAN.

    it’s working.

    Would you be so kind to help me again. I just wrote in the italian forum and I’m in trouble with a strategy that involves 2 weeks.

    Cheers

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

Fixed number of trades per day


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
MaoRai54 @maorai Participant
Summary

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

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