Maximize the number of intraday trades to 3 trades on one day

Forums ProRealTime English forum ProOrder support Maximize the number of intraday trades to 3 trades on one day

  • This topic has 6 replies, 4 voices, and was last updated 3 years ago by avatarJan.
Viewing 7 posts - 1 through 7 (of 7 total)
  • #44617

    A request that was addressed to ProRealTime:

    I am looking for the code to maximize the number of intraday trades of an automatic intraday system to 3 trades on one day.

    Suggestion for an anwser:

     

    You have to add countcondition to your buy and sell conditions.

    #44653

    Does this work?

    #69368
    Jan

    Dear Henry,

     

    I want to reduce my trades to one per day, then I searched on “Maximize the number of intraday trades ” and came to your request. I was not aware of IntradayBarIndex command possibility.

    If you want to limit your trades to one per day,  the following added condition will do:    IntradayBarIndex < (Barindex – TradeIndex(1))

    Consequently if you wan tot limit your trades to three per day,  the added condition  — IntradayBarIndex < (Barindex – TradeIndex(3)) —  should work.  Barindex  – TradeIndex(3) counts the bars between the current bar and the third previous trade (close trade)

    Hope it helps

    Do you know you can search the whole Prorealcode.com website by typing a requested topic at Search , when clicking on your AccountID, right top on the screen, see also attached Word printscreen.

     

    Kind regards,

    Jan

    #155493
    Jan

    I found a problem in version 11 with limiting trades per day:

    in back testing it works fine, but with activating Automated Trading at PRT version 11, it does not work : no error codes given, the code runs in automated trading, but it does not trade ??

    I have used the code often, and it used to work fine, could anyone give me feedback what is going wrong ? See the line below and the dummy code below in the box, what I tested.

    OTD = (Barindex – TradeIndex(1) > IntradayBarIndex) // IntradayBarIndex < (Barindex – TradeIndex(1)) limits the (opening) trades till 1 per day (OTD One Trade per Day)

     

    #155852
    Jan

    About my previous post above: I found that there is no error, so no problem.

    Make sure a strategy with limited trades per day, as coded OTD = (Barindex TradeIndex(1) > IntradayBarIndex) starts running the previous day, than it works fine !

    Explanation:

    OTD = (Barindex TradeIndex(1) > IntradayBarIndex)  :   

    When starting running the strategy,  TradeIndex is always zero, as not trade made yet !  During the first day after the strategy has been started,  Barindex  equals IntradayBarindex and, as TradeIndex is initially zero,  the condition Barindex TradeIndex(1) > IntradayBarIndex is never true.  IntradayBarindex resets every day, it counts the bars during the day.

    The next day of running the strategy, Barindex is greater then IntradayBarindex, so the condition become true, and the limitation of number of trades works fine.

     

    #155859

    Thanks for that clarification Jan. I have a few strategies that use your OTD code (in conjunction with your crossing averages), but they’re recently re-worked for v11 and haven’t taken any trades yet.

    But do you mean that OTD will work on the second day after activation, or the second day after it takes a trade? (ie, the first day that it trades it will potentially make more than one?)

    #155872
    Jan

    Goodevening nonetheless,

     

    a healthy and prosperous New Year 2021 !

    To answer your question:

    OTD will work the second day after activation.

    At the first day after activation Barindex and IntradayBarindex are always the same,  and the  (Barindex  TradeIndex(1> IntradayBarIndex)  never becomes true.  This changes as BarIndex continues on the second day, while IntradayBarIndex resets itself.

    In the simulation results, you do not see this (that’s why I could not understand it was not working after activation), as default 1000 bars are loaded. If you enter at the end of the dummy code “Graph Barindex” and “Graph IntradayBarIndex” you can see the values of the two.

    1 user thanked author for this post.
Viewing 7 posts - 1 through 7 (of 7 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login