평면-트렌드_디지털 통화 전략 V0.2

저자:태극, 날짜: 2016-09-13 17:36:54
태그:추세파이썬MA

@타이도 QQ7650371 #평평선/트렌드 전략 # 얼마나 많은 것을 사는지 판단하여 #금포크가 정상에 올라갔을 때 얼마나 팔렸는지


#!/usr/local/bin/python
#-*- coding: UTF-8 -*-
#均线/趋势  策略
#通过判断  在死叉下底后回弹多少买入
#在金叉上扬至顶后下降多少卖出


# FastPeriod=3 #开仓快线周期
# SlowPeriod=7 #开仓慢线周期
# EnterPeriod=1       #开仓观察期
# ExitFastPeriod=3 #平仓线周期
# ExitSlowPeriod=7 #平仓慢线周期
# ExitPeriod=2        #平仓观察期
# PositionRatio=0.5 #仓位比例
# Interval=10 #轮询周期
# MAType=0 #均线类型 TA.EMA|TA.MA


import types
array = [TA.EMA,TA.MA]
_MACalcMethod = array[MAType]
def Cross(a,b):   #计算均线方法
    crossNum = 0
    arr1 = []
    arr2 = []
    if(type(a) == types.ListType and type(b) == types.ListType):
        arr1 = a
        arr2 = b
    else:
        records = null
        while True:
            records = exchange.GetRecords()
            if(records and len(records) > a and len(records) > b):
                break
            Sleep(Interval)
        arr1 = _MACalcMethod(records,a)
        arr2 = _MACalcMethod(records,b)
    if(len(arr1) != len(arr2)):
        raise Exception("array length not equal")
    for i in range(len(arr1) - 1,-1,-1):
        if((type(arr1[i]) != types.IntType and type(arr1[i]) != types.FloatType) or (type(arr2[i]) != types.IntType and type(arr2[i]) != types.FloatType) ):
            break
        if(arr1[i] < arr2[i]):
            if(crossNum > 0):
                break
            crossNum -= 1
        elif(arr1[i] > arr2[i]):
            if(crossNum < 0):
                break
            crossNum += 1
        else:
            break
    return crossNum

import datetime
def Caltime(date1,date2):
    try:
        date1=time.strptime(date1,"%Y-%m-%d %H:%M:%S")
        date2=time.strptime(date2,"%Y-%m-%d %H:%M:%S")
        date1=datetime.datetime(date1[0],date1[1],date1[2],date1[3],date1[4],date1[5])
        date2=datetime.datetime(date2[0],date2[1],date2[2],date2[3],date2[4],date2[5])
        return date2-date1
    except Exception,ex:
        Log('except Exception Caltime:',ex)
        return "except Exception"

import time
start_timexx =time.localtime(time.time()) #time.clock()
start_time=time.strftime("%Y-%m-%d %H:%M:%S",start_timexx)
buy_price=0 #买入价格
buy_qty=0  #买入数量
gains=0  #盈利

def my_buy(): #开仓
    try:
        global buy_price,buy_qty
        initAccount = ext.GetAccount()  #交易模板的导出函数, 获得账户状态,保存策略运行前账户初始状态
        opAmount=1
        #开仓之前判断有币没有没有先进行买入
        if int(initAccount.Stocks)>1:
            if buy_price<1:
                buy_price=_C(exchange.GetTicker).Last
                buy_qty=initAccount.Stocks
            Log('开仓信息1 仓内还有比:',initAccount.Stocks,'进行清空','--开仓详情:',initAccount)
            return 1
        if int(initAccount.Stocks)<1:
            if int(str(initAccount.Stocks).replace('0.',''))>=1:
                if buy_price<1:
                    buy_price=_C(exchange.GetTicker).Last
                    buy_qty=initAccount.Stocks
                Log('开仓信息2 仓内还有比:',initAccount.Stocks,'进行清空','--开仓详情:',initAccount)
                return 1

        #if int(initAccount.Stocks)<1:
        if int(str(initAccount.Stocks).replace('0.',''))==0:
            #opAmount=1
            opAmount = _N(initAccount.Balance*PositionRatio,3)  #买入数量
            Log("开仓没有币先进行 开仓买入%s元"%(str(opAmount)))   #生成LOG日志
        #     else:
        #         opAmount = _N(initAccount.Stocks * PositionRatio,3)  #获取交易数量
        # else:
        #     opAmount = _N(initAccount.Stocks * PositionRatio,3)  #获取交易数量
        Dict = ext.Buy(opAmount)  #买入ext.Buy
        if(Dict):#确认开仓成功
            buy_price=Dict['price'] #买入价格   #{'price': 4046.446, 'amount': 1.5}
            buy_qty=Dict['amount']  #买入数量
            print_log(1,initAccount,Dict)
            return 1
        return 0

    except Exception,ex:
        Log('except Exception my_buy:',ex)
        return 0

outAccount = ext.GetAccount()  #初始化信息
def print_log(k_p,Account,Dict):
    try:
        global outAccount
        name=""
        if k_p:
            LogProfit(_N(gains,4),'开仓信息 钱:',Account.Balance,'--币:',Account.Stocks,'--开仓详情:',Dict)
            name="开仓"
        else:
            LogProfit(_N(gains,4),'平仓信息 钱:',Account.Balance,'--币:',Account.Stocks,'--平仓详情:',Dict)
            name="平仓"
        endAccount = ext.GetAccount()  #初始化信息
        date1=time.strftime("%Y-%m-%d %H:%M:%S",time.localtime(time.time()))
        LogStatus("初始化投入2016/9/16  投入资金2000元\r\n",
                  "本次初始化状态:",outAccount,
                  "\r\n当前运  行状态:",endAccount,
                  "\r\n本次开始运行时间:%s  已运行:%s\r\n"%(start_time,Caltime(start_time,date1)),
                  "本次盈利:%s\r\n"%(str(gains)),
                  "当前状态:%s--钱:%s--币:%s\r\n"%(str(name),str(Account.Balance),str(Account.Stocks)),
                  "更新时间:%s"%(date1)
                  ) # 测试
    except Exception,ex:
        Log('except Exception print_log:',ex)


def my_sell(): #平仓
    try:
        global buy_price,buy_qty,gains,start_time
        nowAccount = ext.GetAccount()  #交易模板的导出函数  获取账户信息
        if _C(exchange.GetTicker).Last>buy_price+4:   #当前价格一定要大于  开仓价格
            Dict = ext.Sell(nowAccount.Stocks)
            if(Dict):
                sell_gains=(Dict['price']-buy_price)*Dict['amount']
                gains=gains+sell_gains
                buy_price=0 #买入价格
                buy_qty=0  #买入数量
                print_log(0,nowAccount,Dict)
                return 1
        return 0
    except Exception,ex:
        Log('except Exception my_sell:',ex)
        return 0

def main():
    global outAccount
    STATE_IDLE = -1  #空闲状态
    state = STATE_IDLE  #初始化  状态 为 空闲

    Log("run  ",outAccount)  #输出初始账户信息
    SetErrorFilter("GetAccount|GetRecords|GetTicker")  #屏蔽错误内容

    b=0  #开仓
    b1=0  #检测次数
    a=0  #平仓
    a1=0  #检测次数
    while True:
        if(state == STATE_IDLE):   #判断状态是否 为空闲 触发开仓
            #开仓
            n = Cross(FastPeriod,SlowPeriod) #模板函数获取EMA指标快线、慢线交叉结果
            if n<0:  #确定当前为死叉
                b1+=1
                if b>=int(n): #说明现在还是在下跌涨趋势
                    b=int(n)
                else: #开始下跌  开仓
                    if(int(n)>=int(b)+int(EnterPeriod)):  #确认上行走势 至自己定义的点
                        if my_buy():  #开仓
                            b=0
                            b1=0
                            state = PD_SHORT
                            # if(b1>=10):#小波动操作开仓
                            #     b1=0
                            #     if my_buy():
                            #         b=0
                            #         state = PD_SHORT
        else:#平仓
            n = Cross(ExitFastPeriod,ExitSlowPeriod) #模板函数获取EMA指标快线、慢线交叉结果
            if n>0:  #确定当前为金叉
                a1+=1
                if a<=int(n): #说明现在还是在上涨趋势
                    a=int(n)
                else: #开始下跌  平仓
                    if(int(n)<=int(a)-int(ExitPeriod)):  #确认下行走势 至自己定义的点
                        if my_sell(): #平仓
                            a=0
                            a1=0
                            state = STATE_IDLE   #更改状态  为空闲 触发开仓
                            # if(a1>=10): #小波动操作平仓
                            #     a1=0
                            #     if my_sell():
                            #         a=0
                            #         state = STATE_IDLE   #更改状态  为空闲 触发开仓
        Sleep(Interval * 1000)



관련

더 많은

마우트레이스백 (most recent call last) 를 실행합니다: 파일 "", line 967, in __init_ctx__ 파일 "", line 63 except Exception, ex: ^ SyntaxError: invalid syntax

정말저는 그 방법을 바꾸었고, 매번 시장 가격에 매입을 했고, 몇 번이나 실수 없이 달렸지만, 매번 손실을 입었습니다.

정말#!/usr/local/bin/python #-*- 코드: UTF-8 -*- #평평선/트렌드 전략 # 포크 밑에서 얼마나 살는지 판단해서 # 골드포크가 꼭대기에 올라갔을 때 얼마나 팔렸는지 #FastPeriod=3 #시장 개시 빠른 라인 사이클 #SlowPeriod=7 #시장 개장 느린 라인 사이클 # 엔터페리오드=1 # 오프닝 관찰 기간 # ExitFastPeriod=3 # 평평선 주기 # ExitSlowPeriod=7 # 평형의 느린 라인 사이클 #ExitPeriod=2 #평화 관찰 기간 # 포지션 비율 = 0.5 # 포지션 비율 #Interval=10 #순환주기 # MAType=0 # 직선형 TA.EMA .MA array = [TA.EMA, TA.MA] _MACalcMethod = array[MAType] ext = 교환 def Cross ((a, b): # 평선 방법을 계산합니다 crossNum = 0 arr1 = [] 이 식의 값은 listType = type ((arr1)) intType = type(1) floatType = type(1.1) if (type (a) == type (arr1) and type (b) == type (arr2)): arr1 = a arr2 = b 입니다 else: records = null while True: while True: records = exchange.GetRecords (역주) if (records and len (records) > a and len (records) > b): 브레이크 수면 (interval) arr1 = _MACalcMethod ((records, a) ] arr2 = _MACalcMethod (records, b) if ((len ((arr1)!= len ((arr2)): raise Exception (("array length not equal") "배열 길이가 같지 않습니다" for i in range ((len(arr1) - 1, -1, -1): if (((type(arr1[i])!= intType and type ((arr1[i])!= floatType) or (type(arr2[i])!= intType and type ((arr2[i])!= floatType)): 브레이크 if ((arr1[i] < arr2[i]): if ((crossNum > 0): 브레이크 crossNum -= 1 elif ((arr1[i] > arr2[i]): if ((crossNum < 0): 브레이크 crossNum += 1 입니다 else: 브레이크 복귀 crossNum import datetime def Caltime ((date1, date2)): try: date1 = time.strptime ((date1, "%Y-%m-%d %H:%M:%S") date2 = time.strptime ((date2, "%Y-%m-%d %H:%M:%S") date1 = datetime.datetime ((date1[0], date1[1], date1[ 2], date1[3], date1[4], date1[5]) date2 = datetime.datetime ((date2[0], date2[1], date2[ 2], date2[3], date2[4], date2[5]) return date2 - date1 EXCEPTION as ex: 예외로 Log (('except Exception Caltime:', ex) return "except Exception" (특례를 제외하고) 임포트 시간 start_timexx = time.localtime ((time.time))) # time.clock (() start_time = time.strftime (("%Y-%m-%d %H:%M:%S", start_timexx) 이 값은 0입니다 buy_qty = 0 # 구매량 이윤 = 0 # def my_buy ((): # 오픈 try: global buy_price, buy_qty initAccount = ext.GetAccount() # 거래 템플릿의 출력 함수, 계정 상태를 얻으며, 정책을 실행하기 전에 계정의 초기 상태를 저장합니다 opAmount = 1 # 거래 시작하기 전에 돈을 결정하지 않고 구매하지 않고 if int ((initAccount.Stocks) > 1: 만약 buy_price < 1: buy_price = _C ((exchange.GetTicker).Last buy_qty = initAccount.Stocks Log (('상장 정보1'에는 이보다 더 많은:', initAccount.Stocks, '공백', '-- 창고 세부 사항:', initAccount) return 1 if int ((initAccount.Stocks) < 1: if int ((float))) str ((initAccount.Stocks).replace (('0.', ''))) >= 1: 만약 buy_price < 1: buy_price = _C ((exchange.GetTicker).Last buy_qty = initAccount.Stocks Log (('상장 정보2'는 상장 안에는:', initAccount.Stocks, '공백', '-- 창고 세부 사항:', initAccount) return 1 # if int ((initAccount.Stocks) <1: if int (float) (str) (init) (Account.Stocks).replace (('0.', ''))) == 0: # opAmount=1 opAmount = _N(initAccount.Balance * PositionRatio, 3) # 구매량 Log (("투자 개시에는 코인이 없습니다. %s를 구매합니다". % (str ((opAmount))) # LOG 로그를 생성합니다. # else: # opAmount = _N ((initAccount.Stocks * PositionRatio,3) # 거래 수를 얻습니다 # else: # opAmount = _N ((initAccount.Stocks * PositionRatio,3) # 거래 수를 얻습니다 orderId = ext.Buy ((-1,opAmount) # 구매ext.Buy -1 시장 가격을 나타냅니다 if ((orderId): # 거래 성공 확인 # 구매 가격 #{'price': 4046.446, 'amount: 1.5} Dict = exchange.GetOrder (orderId) buy_price = Dict ['가격'] buy_qty = Dict['Amount'] # 구매량 print_log ((1, initAccount, Dict) return 1 return 0 EXCEPTION as ex: 예외로 Log (('except Exception my_buy:',ex) 0을 반환합니다 outAccount = ext.GetAccount (() # 초기화 정보 def print_log ((k_p, 계정, Dict): try: global outAccount name = "" if k_p: LogProfit ((_N(gains, 4), '개시 정보 돈:', Account.Balance, '--화폐:', Account.Stocks, '--시장 개설 세부 사항:', Dict) name = "투자 개시" else: LogProfit ((_N(gains, 4), '평화 정보 돈:', Account.Balance, '--화폐:', Account.Stocks, '--평화 세부 사항:', Dict) name = "평화" endAccount = ext.GetAccount (() # 초기화 정보 date1 = time.strftime (("%Y-%m-%d %H:%M:%S", time.localtime(time.time())) LogStatus (("초시화 투입 2016/9/16 투입 2000원\r\n", "이 초기화 상태:", outAccount, "\r\n 현재 실행 상태:", endAccount, "\r\n 이 실행 시작 시간: %s 실행 완료: %s\r\n" % ( start_time, Caltime (start_time, date1)), "이번 수익: %s\r\n" % (str(gains) "현재 상태: %s--금: %s--화폐: %s\r\n" % (str(name), 이 글은 이쪽에서 http://www.account.balance.com/account.stock/account. 업데이트 시간: %s (date1) #테스트 EXCEPTION as ex: 예외로 Log (('except Exception print_log:', ex) def my_sell (((): # 평평화 try: global buy_price, buy_qty, gains, start_time nowAccount = ext.GetAccount() # 거래 템플릿의 엑스포트 함수 if _C ((exchange.GetTicker).Last > buy_price + 4: # 현재 가격은 오픈 가격보다 커야 합니다. 로그 (nowAccount.Stocks), nowAccount.Stocks) orderId = ext.Sell ((-1,nowAccount.Stocks) #-1는 시장 가격을 나타냅니다. if ((orderId): 로그 ((type ((orderId)) Dict = ext.GetOrder (orderId) sell_gains = (Dict['Price'] - buy_price) * 디트['Amount'] gains = gains + sell_gains 이 값은 0입니다 buy_qty = 0 # 구매량 print_log ((0, nowAccount, Dict) return 1 return 0 EXCEPTION as ex: 예외로 Log (('except Exception my_sell:',ex) 로 로그 (('except Exception my_sell:',ex) 로 로그 (('except) 로 로그 (except) 로그 (except) 로그 (except) 로그 (except) 로그 (except) 로그 (except) 로그 (except) 로그 (except) 로그 (except) 로그 (except) 로그 (except) 로그 (except) 로그 (except) 로그 (except) 로그 (ex) 로그 (ex) 로그 (ex) 로그 (ex) 로그 (ex) 로그 (ex) 로그 (ex) 로그 (ex) 로그 (ex) 로그 (ex) 로그 (ex) return 0 def main (: global outAccount STATE_IDLE = -1 # 빈 상태 state = STATE_IDLE # 초기화 상태가 비어있다 로그 (~ run, outAccount) # 초기 계정 정보를 출력 SetErrorFilter (("GetAccount에서GetRecords에서GetTicker") # 잘못된 내용을 차단합니다. b = 0 # 포지션 오픈 b1 = 0 # 검출 횟수 a = 0 # 평면 a1 = 0 # 검출 횟수 while True: while True: if ((state == STATE_IDLE): # 상태가 빈칸을 열지 여부를 판단합니다. # 창업 n = Cross ((FastPeriod, SlowPeriod) # 템플릿 함수는 EMA 지표의 빠른 라인, 느린 라인 교차 결과를 얻습니다. if n < 0: # 현재 도형으로 설정 b1 더하기 1 if b >= int ((n): # 현재 추락 추세를 보이고 있음을 설명합니다. b = int ((n) else: # 하락하기 시작해 if ((int(n) >= int(b) + int ((EnterPeriod)): # 자기 정의된 지점까지 상승세를 확인합니다. if my_buy (((): #매매 개시 b는 0입니다 b1 = 0 state = PD_SHORT #if(b1>=10):# 소액 변동 조작 시점 #b1=0 #if my_buy (내 구매) #b=0 #state = PD_SHORT else: # 평장 n = Cross ((ExitFastPeriod, ExitSlowPeriod) # 템플릿 함수는 EMA 지표의 빠른 라인, 느린 라인 교차 결과를 얻는다. if n > 0: # 현재 골드포크로 설정 a1 + 1 = 1 if a <= int ((n): # 현재 상승 추세를 보이고 있음을 설명합니다. a = int ((n) else: # 하락하기 시작해 평평하다 if ((int ((n) <= int ((a) - int ((ExitPeriod)): # 자기 정의된 지점까지의 하향 움직임을 확인합니다. if my_sell (if my_sell): # 평평화 a = 0 a1 = 0 state = STATE_IDLE # 상태 변경 공백으로 거래 시작을 촉발 #if(a1>=10): # 작은 변동 조작 평형 # a1=0 #if my_sell (내_판매) # a=0 #state = STATE_IDLE # 상태 변경 공백으로 열기 시작 수면 (Interval * 1000)

정말#!/usr/local/bin/python #-*- 코드: UTF-8 -*- #평평선/트렌드 전략 # 포크 밑에서 얼마나 살는지 판단해서 # 골드포크가 꼭대기에 올라갔을 때 얼마나 팔렸는지 #FastPeriod=3 #시장 개시 빠른 라인 사이클 #SlowPeriod=7 #시장 개장 느린 라인 사이클 # 엔터페리오드=1 # 오프닝 관찰 기간 # ExitFastPeriod=3 # 평평선 주기 # ExitSlowPeriod=7 # 평형의 느린 라인 사이클 #ExitPeriod=2 #평화 관찰 기간 # 포지션 비율 = 0.5 # 포지션 비율 #Interval=10 #순환주기 # MAType=0 # 직선형 TA.EMA .MA array = [TA.EMA, TA.MA] _MACalcMethod = array[MAType] ext = 교환 def Cross ((a, b): # 평선 방법을 계산합니다 crossNum = 0 arr1 = [] 이 식의 값은 listType = type ((arr1)) intType = type(1) floatType = type(1.1) if (type (a) == type (arr1) and type (b) == type (arr2)): arr1 = a arr2 = b 입니다 else: records = null while True: while True: records = exchange.GetRecords (역주) if (records and len (records) > a and len (records) > b): 브레이크 수면 (interval) arr1 = _MACalcMethod ((records, a) ] arr2 = _MACalcMethod (records, b) if ((len ((arr1)!= len ((arr2)): raise Exception (("array length not equal") "배열 길이가 같지 않습니다" for i in range ((len(arr1) - 1, -1, -1): if (((type(arr1[i])!= intType and type ((arr1[i])!= floatType) or (type(arr2[i])!= intType and type ((arr2[i])!= floatType)): 브레이크 if ((arr1[i] < arr2[i]): if ((crossNum > 0): 브레이크 crossNum -= 1 elif ((arr1[i] > arr2[i]): if ((crossNum < 0): 브레이크 crossNum += 1 입니다 else: 브레이크 복귀 crossNum import datetime def Caltime ((date1, date2)): try: date1 = time.strptime ((date1, "%Y-%m-%d %H:%M:%S") date2 = time.strptime ((date2, "%Y-%m-%d %H:%M:%S") date1 = datetime.datetime ((date1[0], date1[1], date1[ 2], date1[3], date1[4], date1[5]) date2 = datetime.datetime ((date2[0], date2[1], date2[ 2], date2[3], date2[4], date2[5]) return date2 - date1 EXCEPTION as ex: 예외로 Log (('except Exception Caltime:', ex) return "except Exception" (특례를 제외하고) 임포트 시간 start_timexx = time.localtime ((time.time))) # time.clock (() start_time = time.strftime (("%Y-%m-%d %H:%M:%S", start_timexx) 이 값은 0입니다 buy_qty = 0 # 구매량 이윤 = 0 # def my_buy ((): # 오픈 try: global buy_price, buy_qty initAccount = ext.GetAccount() # 거래 템플릿의 출력 함수, 계정 상태를 얻으며, 정책을 실행하기 전에 계정의 초기 상태를 저장합니다 opAmount = 1 # 거래 시작하기 전에 돈을 결정하지 않고 구매하지 않고 if int ((initAccount.Stocks) > 1: 만약 buy_price < 1: buy_price = _C ((exchange.GetTicker).Last buy_qty = initAccount.Stocks Log (('상장 정보1'에는 이보다 더 많은:', initAccount.Stocks, '공백', '-- 창고 세부 사항:', initAccount) return 1 if int ((initAccount.Stocks) < 1: if int ((float))) str ((initAccount.Stocks).replace (('0.', ''))) >= 1: 만약 buy_price < 1: buy_price = _C ((exchange.GetTicker).Last buy_qty = initAccount.Stocks Log (('상장 정보2'는 상장 안에는:', initAccount.Stocks, '공백', '-- 창고 세부 사항:', initAccount) return 1 # if int ((initAccount.Stocks) <1: if int (float) (str) (init) (Account.Stocks).replace (('0.', ''))) == 0: # opAmount=1 opAmount = _N(initAccount.Balance * PositionRatio, 3) # 구매량 Log (("투자 개시에는 코인이 없습니다. %s를 구매합니다". % (str ((opAmount))) # LOG 로그를 생성합니다. # else: # opAmount = _N ((initAccount.Stocks * PositionRatio,3) # 거래 수를 얻습니다 # else: # opAmount = _N ((initAccount.Stocks * PositionRatio,3) # 거래 수를 얻습니다 orderId = ext.Buy ((-1,opAmount) # 구매ext.Buy -1 시장 가격을 나타냅니다 if ((orderId): # 거래 성공 확인 # 구매 가격 #{'price': 4046.446, 'amount: 1.5} Dict = exchange.GetOrder (orderId) buy_price = Dict ['가격'] buy_qty = Dict['Amount'] # 구매량 print_log ((1, initAccount, Dict) return 1 return 0 EXCEPTION as ex: 예외로 Log (('except Exception my_buy:',ex) 0을 반환합니다 outAccount = ext.GetAccount (() # 초기화 정보 def print_log ((k_p, 계정, Dict): try: global outAccount name = "" if k_p: LogProfit ((_N(gains, 4), '개시 정보 돈:', Account.Balance, '--화폐:', Account.Stocks, '--시장 개설 세부 사항:', Dict) name = "투자 개시" else: LogProfit ((_N(gains, 4), '평화 정보 돈:', Account.Balance, '--화폐:', Account.Stocks, '--평화 세부 사항:', Dict) name = "평화" endAccount = ext.GetAccount (() # 초기화 정보 date1 = time.strftime (("%Y-%m-%d %H:%M:%S", time.localtime(time.time())) LogStatus (("초시화 투입 2016/9/16 투입 2000원\r\n", "이 초기화 상태:", outAccount, "\r\n 현재 실행 상태:", endAccount, "\r\n 이 실행 시작 시간: %s 실행 완료: %s\r\n" % ( start_time, Caltime (start_time, date1)), "이번 수익: %s\r\n" % (str(gains) "현재 상태: %s--금: %s--화폐: %s\r\n" % (str(name), 이 글은 이쪽에서 http://www.account.balance.com/account.stock/account. 업데이트 시간: %s (date1) #테스트 EXCEPTION as ex: 예외로 Log (('except Exception print_log:', ex) def my_sell (((): # 평평화 try: global buy_price, buy_qty, gains, start_time nowAccount = ext.GetAccount() # 거래 템플릿의 엑스포트 함수 if _C ((exchange.GetTicker).Last > buy_price + 4: # 현재 가격은 오픈 가격보다 커야 합니다. 로그 (nowAccount.Stocks), nowAccount.Stocks) orderId = ext.Sell ((-1,nowAccount.Stocks) #-1는 시장 가격을 나타냅니다. if ((orderId): 로그 ((type ((orderId)) Dict = ext.GetOrder (orderId) sell_gains = (Dict['Price'] - buy_price) * 디트['Amount'] gains = gains + sell_gains 이 값은 0입니다 buy_qty = 0 # 구매량 print_log ((0, nowAccount, Dict) return 1 return 0 EXCEPTION as ex: 예외로 Log (('except Exception my_sell:',ex) 로 로그 (('except Exception my_sell:',ex) 로 로그 (('except) 로 로그 (except) 로그 (except) 로그 (except) 로그 (except) 로그 (except) 로그 (except) 로그 (except) 로그 (except) 로그 (except) 로그 (except) 로그 (except) 로그 (except) 로그 (except) 로그 (except) 로그 (ex) 로그 (ex) 로그 (ex) 로그 (ex) 로그 (ex) 로그 (ex) 로그 (ex) 로그 (ex) 로그 (ex) 로그 (ex) 로그 (ex) return 0 def main (: global outAccount STATE_IDLE = -1 # 빈 상태 state = STATE_IDLE # 초기화 상태가 비어있다 로그 (~ run, outAccount) # 초기 계정 정보를 출력 SetErrorFilter (("GetAccount에서GetRecords에서GetTicker") # 잘못된 내용을 차단합니다. b = 0 # 포지션 오픈 b1 = 0 # 검출 횟수 a = 0 # 평면 a1 = 0 # 검출 횟수 while True: while True: if ((state == STATE_IDLE): # 상태가 빈칸을 열지 여부를 판단합니다. # 창업 n = Cross ((FastPeriod, SlowPeriod) # 템플릿 함수는 EMA 지표의 빠른 라인, 느린 라인 교차 결과를 얻습니다. if n < 0: # 현재 도형으로 설정 b1 더하기 1 if b >= int ((n): # 현재 추락 추세를 보이고 있음을 설명합니다. b = int ((n) else: # 하락하기 시작해 if ((int(n) >= int(b) + int ((EnterPeriod)): # 자기 정의된 지점까지 상승세를 확인합니다. if my_buy (((): #매매 개시 b는 0입니다 b1 = 0 state = PD_SHORT #if(b1>=10):# 소액 변동 조작 시점 #b1=0 #if my_buy (내 구매) #b=0 #state = PD_SHORT else: # 평장 n = Cross ((ExitFastPeriod, ExitSlowPeriod) # 템플릿 함수는 EMA 지표의 빠른 라인, 느린 라인 교차 결과를 얻는다. if n > 0: # 현재 골드포크로 설정 a1 + 1 = 1 if a <= int ((n): # 현재 상승 추세를 보이고 있음을 설명합니다. a = int ((n) else: # 하락하기 시작해 평평하다 if ((int ((n) <= int ((a) - int ((ExitPeriod)): # 자기 정의된 지점까지의 하향 움직임을 확인합니다. if my_sell (if my_sell): # 평평화 a = 0 a1 = 0 state = STATE_IDLE # 상태 변경 공백으로 거래 시작을 촉발 #if(a1>=10): # 작은 변동 조작 평형 # a1=0 #if my_sell (내_판매) # a=0 #state = STATE_IDLE # 상태 변경 공백으로 열기 시작 수면 (Interval * 1000)

ddbo2015except Exception my_sell: ooOooo000oOO instance has no attribute 'GetMinStock' (제곱: my_sell: ooOooo000oOO) 인스턴스에는 'GetMinStock'라는 속성이 없습니다 이 문서는 제가 이 문서를 읽고 있는 동안 계속 언급하고 있는 것에 대해 설명해 주시겠습니까?

17707250703하지만 지금은 쓸모가 없습니다.

태극평평선 _ 트렌드 _ 전략 거래 _ 1 고화질 http://v.youku.com/v_show/id_XMTczMTAxMjQ5Ng==.html 유평선 _ 트렌드 _ 전략 거래 _ 고화질 2 http://v.youku.com/v_show/id_XMTczMDk4MTEwMA==.html