public static string GetTechnicalIndicatorsII(TechnicalIndicator value)
        {
            switch (value)
            {
            case TechnicalIndicator.MACD:
                return("m26-12-9,");

            case TechnicalIndicator.MFI:
                return("f14,");

            case TechnicalIndicator.ROC:
                return("p12,");

            case TechnicalIndicator.RSI:
                return("r14,");

            case TechnicalIndicator.Slow_Stoch:
                return("ss,");

            case TechnicalIndicator.Fast_Stoch:
                return("fs,");

            case TechnicalIndicator.Vol:
                return("v,");

            case TechnicalIndicator.Vol_MA:
                return("vm,");

            case TechnicalIndicator.W_R:
                return("w14,");

            default:
                return(string.Empty);
            }
        }
        public static string GetTechnicalIndicatorsI(TechnicalIndicator value)
        {
            switch (value)
            {
            case TechnicalIndicator.Bollinger_Bands:
                return(value.ToString().Substring(0, 1).ToLower() + ',');

            case TechnicalIndicator.Parabolic_SAR:
                return(value.ToString().Substring(0, 1).ToLower() + ',');

            case TechnicalIndicator.Splits:
                return(value.ToString().Substring(0, 1).ToLower() + ',');

            case TechnicalIndicator.Volume:
                return(value.ToString().Substring(0, 1).ToLower() + ',');

            default:
                return(string.Empty);
            }
        }
예제 #3
0
        static void DemoTechnicalIndicators()
        {
            TechnicalIndicator ti = new TechnicalIndicator(_apiKey);

            AvResponse response = ti.SMA(_symbol, _interval, _timePeriod, _seriesType);

            ReportResponse("TechnicalIndicators.SMA", response);

            response = ti.EMA(_symbol, _interval, _timePeriod, _seriesType);
            ReportResponse("TechnicalIndicators.EMA", response);

            response = ti.WMA(_symbol, _interval, _timePeriod, _seriesType);
            ReportResponse("TechnicalIndicators.WMA", response);

            response = ti.DEMA(_symbol, _interval, _timePeriod, _seriesType);
            ReportResponse("TechnicalIndicators.DEMA", response);

            response = ti.TEMA(_symbol, _interval, _timePeriod, _seriesType);
            ReportResponse("TechnicalIndicators.TEMA", response);

            response = ti.TRIMA(_symbol, _interval, _timePeriod, _seriesType);
            ReportResponse("TechnicalIndicators.TRIMA", response);

            response = ti.KAMA(_symbol, _interval, _timePeriod, _seriesType);
            ReportResponse("TechnicalIndicators.KAMA", response);

            response = ti.MAMA(_symbol, _interval, _timePeriod, _seriesType);
            ReportResponse("TechnicalIndicators.MAMA", response);

            response = ti.T3(_symbol, _interval, _timePeriod, _seriesType);
            ReportResponse("TechnicalIndicators.T3", response);

            response = ti.MACD(_symbol, _interval, _timePeriod, _seriesType);
            ReportResponse("TechnicalIndicators.MACD", response);

            response = ti.MACDEXT(_symbol, _interval, _timePeriod, _seriesType);
            ReportResponse("TechnicalIndicators.MACDEXT", response);

            response = ti.STOCH(_symbol, _interval);
            ReportResponse("TechnicalIndicators.STOCH", response);

            response = ti.STOCHF(_symbol, _interval);
            ReportResponse("TechnicalIndicators.STOCHF", response);

            response = ti.RSI(_symbol, _interval, _timePeriod, _seriesType);
            ReportResponse("TechnicalIndicators.RSI", response);

            response = ti.STOCHRSI(_symbol, _interval, _timePeriod, _seriesType);
            ReportResponse("TechnicalIndicators.STOCHRSI", response);

            response = ti.WILLR(_symbol, _interval, _timePeriod);
            ReportResponse("TechnicalIndicators.WILLR", response);

            response = ti.ADX(_symbol, _interval, _timePeriod);
            ReportResponse("TechnicalIndicators.ADX", response);

            response = ti.ADXR(_symbol, _interval, _timePeriod);
            ReportResponse("TechnicalIndicators.ADXR", response);

            response = ti.APO(_symbol, _interval, _seriesType);
            ReportResponse("TechnicalIndicators.APO", response);

            response = ti.PPO(_symbol, _interval, _seriesType);
            ReportResponse("TechnicalIndicators.PPO", response);

            response = ti.MOM(_symbol, _interval, _timePeriod, _seriesType);
            ReportResponse("TechnicalIndicators.MOM", response);

            response = ti.BOP(_symbol, _interval);
            ReportResponse("TechnicalIndicators.ADXR", response);

            response = ti.CCI(_symbol, _interval, _timePeriod);
            ReportResponse("TechnicalIndicators.CCI", response);

            response = ti.CMO(_symbol, _interval, _timePeriod, _seriesType);
            ReportResponse("TechnicalIndicators.CMO", response);

            response = ti.ROC(_symbol, _interval, _timePeriod, _seriesType);
            ReportResponse("TechnicalIndicators.ROC", response);

            response = ti.ROCR(_symbol, _interval, _timePeriod, _seriesType);
            ReportResponse("TechnicalIndicators.ROCR", response);

            response = ti.AROON(_symbol, _interval, _timePeriod);
            ReportResponse("TechnicalIndicators.AROON", response);

            response = ti.AROONOSC(_symbol, _interval, _timePeriod);
            ReportResponse("TechnicalIndicators.AROONOSC", response);

            response = ti.MFI(_symbol, _interval, _timePeriod);
            ReportResponse("TechnicalIndicators.MFI", response);

            response = ti.TRIX(_symbol, _interval, _timePeriod, _seriesType);
            ReportResponse("TechnicalIndicators.TRIX", response);

            response = ti.ULTOSC(_symbol, _interval);
            ReportResponse("TechnicalIndicators.ULTOSC", response);

            response = ti.DX(_symbol, _interval, _timePeriod);
            ReportResponse("TechnicalIndicators.DX", response);

            response = ti.MINUS_DI(_symbol, _interval, _timePeriod);
            ReportResponse("TechnicalIndicators.MINUS_DI", response);

            response = ti.PLUS_DI(_symbol, _interval, _timePeriod);
            ReportResponse("TechnicalIndicators.PLUS_DI", response);

            response = ti.MINUS_DM(_symbol, _interval, _timePeriod);
            ReportResponse("TechnicalIndicators.MINUS_DM", response);

            response = ti.PLUS_DM(_symbol, _interval, _timePeriod);
            ReportResponse("TechnicalIndicators.PLUS_DM", response);

            response = ti.BBANDS(_symbol, _interval, _timePeriod, _seriesType);
            ReportResponse("TechnicalIndicators.BBANDS", response);

            response = ti.MIDPOINT(_symbol, _interval, _timePeriod, _seriesType);
            ReportResponse("TechnicalIndicators.MIDPOINT", response);

            response = ti.MIDPRICE(_symbol, _interval, _timePeriod);
            ReportResponse("TechnicalIndicators.MIDPRICE", response);

            response = ti.SAR(_symbol, _interval);
            ReportResponse("TechnicalIndicators.SAR", response);

            response = ti.TRANGE(_symbol, _interval);
            ReportResponse("TechnicalIndicators.TRANGE", response);

            response = ti.ATR(_symbol, _interval, _timePeriod);
            ReportResponse("TechnicalIndicators.ATR", response);

            response = ti.NATR(_symbol, _interval, _timePeriod);
            ReportResponse("TechnicalIndicators.NATR", response);

            response = ti.AD(_symbol, _interval, _timePeriod);
            ReportResponse("TechnicalIndicators.AD", response);

            response = ti.ADOSC(_symbol, _interval);
            ReportResponse("TechnicalIndicators.ADOSC", response);

            response = ti.OBV(_symbol, _interval);
            ReportResponse("TechnicalIndicators.OBV", response);

            response = ti.HT_TRENDLINE(_symbol, _interval, _seriesType);
            ReportResponse("TechnicalIndicators.HT_TRENDLINE", response);

            response = ti.HT_SINE(_symbol, _interval, _seriesType);
            ReportResponse("TechnicalIndicators.HT_SINE", response);

            response = ti.HT_TRENDMODE(_symbol, _interval, _seriesType);
            ReportResponse("TechnicalIndicators.HT_TRENDMODE", response);

            response = ti.HT_DCPERIOD(_symbol, _interval, _seriesType);
            ReportResponse("TechnicalIndicators.HT_DCPERIOD", response);

            response = ti.HT_DCPHASE(_symbol, _interval, _seriesType);
            ReportResponse("TechnicalIndicators.HT_DCPHASE", response);

            response = ti.HT_PHASOR(_symbol, _interval, _seriesType);
            ReportResponse("TechnicalIndicators.HT_PHASOR", response);
        }
예제 #4
0
 public static string GetTechnicalIndicatorsII(TechnicalIndicator value)
 {
     switch (value)
     {
         case TechnicalIndicator.MACD:
             return "m26-12-9,";
         case TechnicalIndicator.MFI:
             return "f14,";
         case TechnicalIndicator.ROC:
             return "p12,";
         case TechnicalIndicator.RSI:
             return "r14,";
         case TechnicalIndicator.Slow_Stoch:
             return "ss,";
         case TechnicalIndicator.Fast_Stoch:
             return "fs,";
         case TechnicalIndicator.Vol:
             return "v,";
         case TechnicalIndicator.Vol_MA:
             return "vm,";
         case TechnicalIndicator.W_R:
             return "w14,";
         default:
             return string.Empty;
     }
 }
예제 #5
0
 public static string GetTechnicalIndicatorsI(TechnicalIndicator value)
 {
     switch (value)
     {
         case TechnicalIndicator.Bollinger_Bands:
             return value.ToString().Substring(0, 1).ToLower() + ',';
         case TechnicalIndicator.Parabolic_SAR:
             return value.ToString().Substring(0, 1).ToLower() + ',';
         case TechnicalIndicator.Splits:
             return value.ToString().Substring(0, 1).ToLower() + ',';
         case TechnicalIndicator.Volume:
             return value.ToString().Substring(0, 1).ToLower() + ',';
         default:
             return string.Empty;
     }
 }
예제 #6
0
 public void AddIndicator(TechnicalIndicator indicator)
 {
     Indicators.Add(indicator.Name, indicator);
 }
        public void SendQuotesToCalculationOnCertainActor(List <Quote> quotes, Parameters parameters, TechnicalIndicator indicator)
        {
            lock (_padlock)
            {
                _queryActorsByQuotesSet.TryGetValue(quotes, out IActorRef query);
                object message = new object();

                if (query == null)
                {
                    query = _system.ActorOf <QueryActor>("query" + Guid.NewGuid());

                    _queryActorsByQuotesSet.Add(quotes, query);
                    _quotesByQueryActors.Add(query, quotes);

                    Thread thread = Thread.CurrentThread;
                    _queryActorsByThreadsIds.Add(thread.ManagedThreadId, query);
                }

                message = new CalculateSingleTechnicalIndicatorRequest()
                {
                    TechnicalIndicator = indicator,
                    Quotes             = quotes,
                    Parameters         = parameters,
                };

                query.Tell(message);
            }
        }
예제 #8
0
 public void CalculateSingleIndicator(List <Quote> quotes, Parameters parameters, TechnicalIndicator indicator)
 {
     _strategy.SendData(quotes, parameters, indicator);
 }
 public void SendData(List <Quote> quotes, Parameters parameters, TechnicalIndicator indicator)
 {
     _adapter.SendQuotesToCalculationOnCertainActor(quotes, parameters, indicator);
 }
 public static Props Props(TechnicalIndicator indicator)
 {
     return(Akka.Actor.Props.Create(() => new TechnicalIndicatorActor(indicator)));
 }
 public TechnicalIndicatorActor(TechnicalIndicator indicator)
 {
     _indicator = indicator;
 }
예제 #12
0
 public RabbitCalculateIndicator(string exchange, string queueReceiveFrom, string queueSendTo, TechnicalIndicator indicator) : base(exchange, queueReceiveFrom, queueSendTo)
 {
     _indicator = indicator;
 }
예제 #13
0
        public void SendData(List <Quote> quotes, Parameters parameters, TechnicalIndicator indicator)
        {
            RabbitMQAdapter adapter = new RabbitMQAdapter();

            adapter.SendQuotesToCalculationInConsumer(quotes, parameters, _exchange, indicator.GetType().ToString());
        }