Onetrade per day (help)

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #232505 quote
    jackyhuichunkit
    Participant
    New

    Dear all,

    I tried to setup a one trade per day strategy on a 5 minute chart but it does not work.

    I followed some tutorials from this tutorial and uses the oneTrade variable to keep track of trading history.

    if I remove the IF statement at line 84, pro-backtest will have several trades on a certain day.

    However, no trades are made if the condition at line 84 is kept there.

    Any ideas?

    Screenshot-2024-05-09-at-7.10.44 AM.png Screenshot-2024-05-09-at-7.10.44 AM.png
    #232507 quote
    Wim
    Participant
    Junior

    Try dropping the part (minute=15….) for starters. You have already forced the timeframe to M15, no need to check whether minute=n*15. And moreover, all calculations are made for the values at the end of a candle, and the end of the 10:15 candle is 10:30 etc.

    #232509 quote
    robertogozzi
    Moderator
    Master

    Please post the code, not a screenshot of it, so that it can be used. Thanks 🙂

    I suggest that you add this line (as line 77 or 82):

    OTD = Barindex - TradeIndex(1) > IntradayBarIndex

    then replace the condition OneTrade = 0 by OTD (or OTD = 1) in line 84.

    Iván González thanked this post
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Onetrade per day (help)


Platform Support: Charts, Data & Broker Setup

New Reply
Author
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by robertogozzi
1 year, 9 months ago.

Topic Details
Forum: Platform Support: Charts, Data & Broker Setup
Language: English
Started: 05/09/2024
Status: Active
Attachments: 1 files
Logo Logo
Loading...