Algotopian is starting. Let it be the future of backtrader. Check it out! https://www.algotopian.com
For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

Order management with Calendar day?



  • https://www.backtrader.com/docu/order-creation-execution/order-creation-execution.html,

    Execution Type: Limit with validity
    
    To not wait forever on a limit order which may only execute when the price is moving against the “buy” order, the order will only be valid 4 (calendar) days.
    

    May I know why we use calendar day to define validity of order? When I check the result, I usually count number of bars (valid trade days).



  • The right question here would be not "how you count it" but how brokers (usually) count it. My personal experience with different brokers is that there is no "bar based" system.

    Bars can have many different durations (1-min, 5-min, 2-days), you would have to 1st define the actual bar duration and then the length. You would also have to take into account that during thin trading sessions, several 1-min bars will be missing (no negotiation took place). Should they count because your expected timeframe is 1-min or shall the broker be counting only those with executed volume?


Log in to reply
 

Looks like your connection to Backtrader Community was lost, please wait while we try to reconnect.