Avoid several trades within 1 candle

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #244888 quote
    Hercules306
    Participant
    New
    Dear Community,
    in backtesting, my algo opens several positions within1 Candle (DAX – Timeframe 1mn)
    I want to avoid “defparam cumulate orders = false”, because I want open another position if there is an entry conditions later a day, but not within the same candle.
    Maybe, it is only a backtesting problem, I am not sure. Attached, I have simple code to demonstrate my problem.
    Can anybody help me please?
    Thanks in advance and best regards!
    Bildschirmfoto-2025-03-12-um-20.17.24.png Bildschirmfoto-2025-03-12-um-20.17.24.png Bildschirmfoto-2025-03-12-um-20.21.06.jpg Bildschirmfoto-2025-03-12-um-20.21.06.jpg
    #244917 quote
    robertogozzi
    Moderator
    Master

    As I can read in your code, it’s impossible that more than 1 short trade is entered on the same candle on the 1-minute bar if you are using a 1-minute timeframe, because once the entry conditions are met they won’t be evaluated again until next bar.

    It only may occur if you are using a lower timeframe.

    Please post the code you are using and info about the default timeframe.

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

Avoid several trades within 1 candle


Platform Support: Charts, Data & Broker Setup

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
11 months, 1 week ago.

Topic Details
Forum: Platform Support: Charts, Data & Broker Setup
Language: English
Started: 03/12/2025
Status: Active
Attachments: 2 files
Logo Logo
Loading...