For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

Strategy using timer takes different actions when feed with PandasData and GenericCSVData



  • As i tested monthly automatic investment by using timer, I found that my strategy takes different actions when feed with PandasData and GenericCSVData, setting param 'when' with 'SESSION_END'.

    • Result from PandasData feed with SESSION_END:

    06aa7e39-0a07-435f-a4c7-80036905bb2e-image.png

    • Result from GenericCSVData feed with SESSION_END:

    6095a418-bd36-4439-b636-cb8529da2ab5-image.png

    Try to find the difference source, i change 'when' to 'SESSION_START'. Getting result for these two scenarios:

    • Result from PandasData feed with SESSION_START:

    fc7d189a-6d4b-45f6-a8d0-1d7b86eb437b-image.png

    • Result from GenericCSVData feed with SESSION_START:

    dac016ee-e9b9-45fd-9bb2-16486c3504d3-image.png

    I found that these two data feed get the same result with SESSION_START, but the time stamps are different. And i found the default time value in GenericCSVData is 23:59:59:999990 though we know that we get datetime.time(0,0) when we read a file with no time setting, which leads to the default time in PandasData is 00:00:00.

    Found out the real value of SESSION_START and SESSION_END, i get this:

    cc872a8c-ba57-4b07-bcb7-4f47462bd069-image.png

    So we know that:

    • If we use SESSION_END: the bar from PandasData time is earlier than SESSION_END(default: 23:59:59:999990), but bar GenericCSVData can fit the requirement and execute the command.
    • If we use SESSION_START: the bar from PandasData time is the same with SESSION_START(default: 00:00:00), and bar GenericCSVData is later than SESSION_START, so it can also be executed.


  • I think for daily an higher time frame, use of the session_start and session_end parameters meaningless and they can be skipped.


Log in to reply
 

});