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

Importing orders #219


  • administrators

    From #219


    Hello,
    Is there a way to import orders from an array? I have them in an array that looks like [0,0,1,0,0,-1,-1...], length of this array is the same as the length of the data(one signal for each timeframe).

    This is for backtesting only, the calculations are done outside of the testing script.

    Or simpler, signals are saved in a csv with lines like this

    2016-01-09;100200;-1
    2016-01-09;110200;1
    

    etc


  • administrators

    As explained above order importing is not a feature of the the platform.

    If you have the data in that format:

    ....
    2016-01-09;100200;-1
    2016-01-10;110200;1
    ...
    

    there are several approaches:

    • Make a custom data feed with it containing only 2 fields

      • datetime
      • trigger (or any other name you wish)

      In this case you would add the data feed to the system and could at each moment in time and synchronized with the data read if an order has to be executed or not

    • Read that input with something like a pandas.read_csv module and during each call to next in the strategy, look for the corresponding datetime index in the dataframe to see if an order has to be executed or not.