API(C#)를 이용한 자동매매 개발 #6

in #kr7 years ago (edited)

주말동안 코인들이 급등세를 보였다.

#5 (https://steemit.com/kr/@cowin/api-c-5) 글의 소스대로라면
8월6일 09:18분에 ETC 매수발생.

뭔가 늦어도 한참 늦다...

소스 만들때만 해도, 빡!! 치고오르는 시간이 비슷했던면에 반해
이번 주말오름세는 BTC, LTC, XRP가 급등, ETC, ETH, DASH가 완만한 상승을 이룬 모습이다.
심지어 60분봉별 상승 시작점도 다르니 ...

소스를 바꿔보았다.
7종목중... (최근 BCH 추가)

  1. 30이격도의 값 101 초과
  2. 최근 10봉의 등락률이 -1% 미만 제외
  3. 1~2번 조건을 3종목 이상 만족(전반적인 상승세일때만 매수한다는...)

1~3조건 만족한 종목 중, 이격도가 가장 작은 종목을 뒤도 안돌아보고 매수!!
는 아직도 안하고 ㅡㅡ; 로그만... ㅋㅋ

  • 가장 작은 종목을 매수하는 이유는 전반적 상승추세에서 가장 조금오른녀석이 곧 오를것이라는 믿음때문...

지금은 호가창/주문기능을 개발중이니, 돌려보고 로그만 추후에 살펴보자....
궁금해하시는 분들을 위해 아래 로직을 첨부합니다~

이것도 다음 포스팅때 시그널 결과 공개할께요~ ^^

private string IsGlobalBuySignal()
        {
            Dictionary<string, double> maxDisDic = new Dictionary<string, double>();

            foreach (string currency in StaticData.usingCurrencyList)
            {
                double rate;
                bool skip_conditon = false;
                for (int i = 1; i <= 10; i++)
                {
                    rate = logicDic[currency].GetRate(SERIES_TYPE.MIN_60, i);
                    if (rate < -1)
                    {
                        skip_conditon = true;
                        break;
                    }
                }

                if (skip_conditon)
                    continue;

                double disparity = logicDic[currency].GetDisparity(SERIES_TYPE.MIN_60, 30, 0);
                if (101 < disparity)
                {
                    maxDisDic[currency] = disparity;

                    CowinLogger.makeLog(CowinLogger.LogLevel.DBG, GetType().Name, MethodBase.GetCurrentMethod().Name,
                        currency, string.Format("disparity : {0:0}", disparity));
                }
            }

            if (maxDisDic.Count < 3)
                return null;

            foreach (KeyValuePair<string, double> dicPair in maxDisDic)
            {
                CowinLogger.makeLog(CowinLogger.LogLevel.DBG, GetType().Name, MethodBase.GetCurrentMethod().Name,
                         "시그널로그", string.Format("{0} value:{1:0.00}", dicPair.Key, dicPair.Value));
            }

            return maxDisDic.FirstOrDefault(x => x.Value == maxDisDic.Values.Min()).Key;
        }

#현재까지 완료된 실행파일 : http://bitcoin.cowincomfunny.com/
API제한이 있으니(Private는 초당10회) 프로세스를 여러개 실행하면 안됩니다

Sort:  

워~ 능력자시네요^^

아직 하찮은 뻘짓에 불과합니다 ^^

뉴비는 언제나 환영!이에요.
팁! : 비트코인, 이더리움, 스팀, 스팀달러등은 암호화폐 혹은 cryptocurrency라고 불린다네요.
3.47% 보팅
현재 보상량 : [ 평균 - 0.83 / 4개 / 합계 : 3.31 ]

  • kr-newbie 보안관 봇! (beta 0.5.0 - 2017/07/17)

Congratulations @cowin! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

You got your First payout
Award for the number of comments

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!