strategy forex with python

Solutions on MaxInterview for strategy forex with python by the best coders in the world

showing results for - "strategy forex with python"
Ivanna
20 Sep 2018
1# Put any initialization logic here.  The context object will be passed to
2# the other methods in your algorithm.
3def initialize(context):
4    pass
5
6# Will be called on every trade event for the securities you specify. 
7def handle_data(context, data):
8    # Implement your algorithm logic here.
9
10    # data[sid(X)] holds the trade event data for that security.
11    # context.portfolio holds the current portfolio state.
12
13    # Place orders with the order(SID, amount) method.
14
15    # TODO: implement your own logic here.
16    order(sid(24), 50)
Esther
24 Aug 2017
1def initialize(context):
2    context.security = symbol('SPY')