#Quantopian Algorithm ordertarget_percent

4063 단어 QuantopianPython

order_target_percent


order_target_percentorder_percent와 마찬가지로 현재 투자조합 가치의 ~%를 주문하는 함수로 현재 위치에 대한 평가액과 현금의 합계, ~%를 주문하지만 다른'order target~'함수와 마찬가지로 이미 위치가 있으면 구매를 늘리지 않는다.

알고리즘 예

def initialize(context):
    context.security = sid(35902)
    schedule_function(rebalance, 
                      date_rule=date_rules.every_day(),
                      time_rule=time_rules.market_close(minutes = 1))

def rebalance(context, data):
    if data.can_trade(context.security):
            order_target_percent(context.security, 1)

메모지


Phillip Morris로 시뮬레이션했습니다.
거래 개시일에는 PM을 100% 자기자본으로 매입하고 보유는 팔지 않는다.
이 시뮬레이션은 초기 투자 1000달러, 2017/1~2017/12/31 사이에 진행됩니다.
1월 4일에 10주, 10월 13일에 1주를 샀다.

1월 4일은 첫 거래일이고,
10월 13일 주식 1주 증가는 과연 무엇일까?
그것은 이익 분배다.
PM이 10월 12일 개최한 페이먼트에 따르면 자신에 대한 자금은 단 1개로, 살 시간이 충분해 13일 클로즈업에서 구매를 늘렸다PM의 분배 이력
이런 일도 자동으로 할 수 있는Simulation은 매우 편리하다.

기타 주문 방법


#Quantopian Algorithm order
#Quantopian Algorithm ordervalue
#Quantopian Algorithm orderpercent
#Quantopian Algorithm ordertarget
#Quantopian Algorithm ordertarget_value

좋은 웹페이지 즐겨찾기