├── Avapi ├── AD │ ├── Const_AD.cs │ ├── Impl_AD.cs │ └── Int_AD.cs ├── ADOSC │ ├── Const_ADOSC.cs │ ├── Impl_ADOSC.cs │ └── Int_ADOSC.cs ├── ADX │ ├── Const_ADX.cs │ ├── Impl_ADX.cs │ └── Int_ADX.cs ├── ADXR │ ├── Const_ADXR.cs │ ├── Impl_ADXR.cs │ └── Int_ADXR.cs ├── APO │ ├── Const_APO.cs │ ├── Impl_APO.cs │ └── Int_APO.cs ├── AROON │ ├── Const_AROON.cs │ ├── Impl_AROON.cs │ └── Int_AROON.cs ├── AROONOSC │ ├── Const_AROONOSC.cs │ ├── Impl_AROONOSC.cs │ └── Int_AROONOSC.cs ├── ATR │ ├── Const_ATR.cs │ ├── Impl_ATR.cs │ └── Int_ATR.cs ├── Avapi.csproj ├── AvapiConnection.cs ├── BATCH_STOCK_QUOTES │ ├── Const_BATCH_STOCK_QUOTES.cs │ ├── Impl_BATCH_STOCK_QUOTES.cs │ └── Int_BATCH_STOCK_QUOTES.cs ├── BBANDS │ ├── Const_BBANDS.cs │ ├── Impl_BBANDS.cs │ └── Int_BBANDS.cs ├── BOP │ ├── Const_BOP.cs │ ├── Impl_BOP.cs │ └── Int_BOP.cs ├── CCI │ ├── Const_CCI.cs │ ├── Impl_CCI.cs │ └── Int_CCI.cs ├── CMO │ ├── Const_CMO.cs │ ├── Impl_CMO.cs │ └── Int_CMO.cs ├── CURRENCY_EXCHANGE_RATE │ ├── Const_CURRENCY_EXCHANGE_RATE.cs │ ├── Impl_CURRENCY_EXCHANGE_RATE.cs │ └── Int_CURRENCY_EXCHANGE_RATE.cs ├── DEMA │ ├── Const_DEMA.cs │ ├── Impl_DEMA.cs │ └── Int_DEMA.cs ├── DIGITAL_CURRENCY_DAILY │ ├── Const_DIGITAL_CURRENCY_DAILY.cs │ ├── Impl_DIGITAL_CURRENCY_DAILY.cs │ └── Int_DIGITAL_CURRENCY_DAILY.cs ├── DIGITAL_CURRENCY_INTRADAY │ ├── Const_DIGITAL_CURRENCY_INTRADAY.cs │ ├── Impl_DIGITAL_CURRENCY_INTRADAY.cs │ └── Int_DIGITAL_CURRENCY_INTRADAY.cs ├── DIGITAL_CURRENCY_MONTHLY │ ├── Const_DIGITAL_CURRENCY_MONTHLY.cs │ ├── Impl_DIGITAL_CURRENCY_MONTHLY.cs │ └── Int_DIGITAL_CURRENCY_MONTHLY.cs ├── DIGITAL_CURRENCY_WEEKLY │ ├── Const_DIGITAL_CURRENCY_WEEKLY.cs │ ├── Impl_DIGITAL_CURRENCY_WEEKLY.cs │ └── Int_DIGITAL_CURRENCY_WEEKLY.cs ├── DX │ ├── Const_DX.cs │ ├── Impl_DX.cs │ └── Int_DX.cs ├── EMA │ ├── Const_EMA.cs │ ├── Impl_EMA.cs │ └── Int_EMA.cs ├── HT_DCPERIOD │ ├── Const_HT_DCPERIOD.cs │ ├── Impl_HT_DCPERIOD.cs │ └── Int_HT_DCPERIOD.cs ├── HT_DCPHASE │ ├── Const_HT_DCPHASE.cs │ ├── Impl_HT_DCPHASE.cs │ └── Int_HT_DCPHASE.cs ├── HT_PHASOR │ ├── Const_HT_PHASOR.cs │ ├── Impl_HT_PHASOR.cs │ └── Int_HT_PHASOR.cs ├── HT_SINE │ ├── Const_HT_SINE.cs │ ├── Impl_HT_SINE.cs │ └── Int_HT_SINE.cs ├── HT_TRENDLINE │ ├── Const_HT_TRENDLINE.cs │ ├── Impl_HT_TRENDLINE.cs │ └── Int_HT_TRENDLINE.cs ├── HT_TRENDMODE │ ├── Const_HT_TRENDMODE.cs │ ├── Impl_HT_TRENDMODE.cs │ └── Int_HT_TRENDMODE.cs ├── IAvapiConnection.cs ├── KAMA │ ├── Const_KAMA.cs │ ├── Impl_KAMA.cs │ └── Int_KAMA.cs ├── MACD │ ├── Const_MACD.cs │ ├── Impl_MACD.cs │ └── Int_MACD.cs ├── MACDEXT │ ├── Const_MACDEXT.cs │ ├── Impl_MACDEXT.cs │ └── Int_MACDEXT.cs ├── MAMA │ ├── Const_MAMA.cs │ ├── Impl_MAMA.cs │ └── Int_MAMA.cs ├── MFI │ ├── Const_MFI.cs │ ├── Impl_MFI.cs │ └── Int_MFI.cs ├── MIDPOINT │ ├── Const_MIDPOINT.cs │ ├── Impl_MIDPOINT.cs │ └── Int_MIDPOINT.cs ├── MIDPRICE │ ├── Const_MIDPRICE.cs │ ├── Impl_MIDPRICE.cs │ └── Int_MIDPRICE.cs ├── MINUS_DI │ ├── Const_MINUS_DI.cs │ ├── Impl_MINUS_DI.cs │ └── Int_MINUS_DI.cs ├── MINUS_DM │ ├── Const_MINUS_DM.cs │ ├── Impl_MINUS_DM.cs │ └── Int_MINUS_DM.cs ├── MOM │ ├── Const_MOM.cs │ ├── Impl_MOM.cs │ └── Int_MOM.cs ├── NATR │ ├── Const_NATR.cs │ ├── Impl_NATR.cs │ └── Int_NATR.cs ├── OBV │ ├── Const_OBV.cs │ ├── Impl_OBV.cs │ └── Int_OBV.cs ├── PLUS_DI │ ├── Const_PLUS_DI.cs │ ├── Impl_PLUS_DI.cs │ └── Int_PLUS_DI.cs ├── PLUS_DM │ ├── Const_PLUS_DM.cs │ ├── Impl_PLUS_DM.cs │ └── Int_PLUS_DM.cs ├── PPO │ ├── Const_PPO.cs │ ├── Impl_PPO.cs │ └── Int_PPO.cs ├── ROC │ ├── Const_ROC.cs │ ├── Impl_ROC.cs │ └── Int_ROC.cs ├── ROCR │ ├── Const_ROCR.cs │ ├── Impl_ROCR.cs │ └── Int_ROCR.cs ├── RSI │ ├── Const_RSI.cs │ ├── Impl_RSI.cs │ └── Int_RSI.cs ├── SAR │ ├── Const_SAR.cs │ ├── Impl_SAR.cs │ └── Int_SAR.cs ├── SECTOR │ ├── Impl_SECTOR.cs │ └── Int_SECTOR.cs ├── SMA │ ├── Const_SMA.cs │ ├── Impl_SMA.cs │ └── Int_SMA.cs ├── STOCH │ ├── Const_STOCH.cs │ ├── Impl_STOCH.cs │ └── Int_STOCH.cs ├── STOCHF │ ├── Const_STOCHF.cs │ ├── Impl_STOCHF.cs │ └── Int_STOCHF.cs ├── STOCHRSI │ ├── Const_STOCHRSI.cs │ ├── Impl_STOCHRSI.cs │ └── Int_STOCHRSI.cs ├── T3 │ ├── Const_T3.cs │ ├── Impl_T3.cs │ └── Int_T3.cs ├── TEMA │ ├── Const_TEMA.cs │ ├── Impl_TEMA.cs │ └── Int_TEMA.cs ├── TIME_SERIES_DAILY │ ├── Const_TIME_SERIES_DAILY.cs │ ├── Impl_TIME_SERIES_DAILY.cs │ └── Int_TIME_SERIES_DAILY.cs ├── TIME_SERIES_DAILY_ADJUSTED │ ├── Const_TIME_SERIES_DAILY_ADJUSTED.cs │ ├── Impl_TIME_SERIES_DAILY_ADJUSTED.cs │ └── Int_TIME_SERIES_DAILY_ADJUSTED.cs ├── TIME_SERIES_INTRADAY │ ├── Const_TIME_SERIES_INTRADAY.cs │ ├── Impl_TIME_SERIES_INTRADAY.cs │ └── Int_TIME_SERIES_INTRADAY.cs ├── TIME_SERIES_MONTHLY │ ├── Const_TIME_SERIES_MONTHLY.cs │ ├── Impl_TIME_SERIES_MONTHLY.cs │ └── Int_TIME_SERIES_MONTHLY.cs ├── TIME_SERIES_MONTHLY_ADJUSTED │ ├── Const_TIME_SERIES_MONTHLY_ADJUSTED.cs │ ├── Impl_TIME_SERIES_MONTHLY_ADJUSTED.cs │ └── Int_TIME_SERIES_MONTHLY_ADJUSTED.cs ├── TIME_SERIES_WEEKLY │ ├── Const_TIME_SERIES_WEEKLY.cs │ ├── Impl_TIME_SERIES_WEEKLY.cs │ └── Int_TIME_SERIES_WEEKLY.cs ├── TIME_SERIES_WEEKLY_ADJUSTED │ ├── Const_TIME_SERIES_WEEKLY_ADJUSTED.cs │ ├── Impl_TIME_SERIES_WEEKLY_ADJUSTED.cs │ └── Int_TIME_SERIES_WEEKLY_ADJUSTED.cs ├── TRANGE │ ├── Const_TRANGE.cs │ ├── Impl_TRANGE.cs │ └── Int_TRANGE.cs ├── TRIMA │ ├── Const_TRIMA.cs │ ├── Impl_TRIMA.cs │ └── Int_TRIMA.cs ├── TRIX │ ├── Const_TRIX.cs │ ├── Impl_TRIX.cs │ └── Int_TRIX.cs ├── ULTOSC │ ├── Const_ULTOSC.cs │ ├── Impl_ULTOSC.cs │ └── Int_ULTOSC.cs ├── Utility.cs ├── WILLR │ ├── Const_WILLR.cs │ ├── Impl_WILLR.cs │ └── Int_WILLR.cs ├── WMA │ ├── Const_WMA.cs │ ├── Impl_WMA.cs │ └── Int_WMA.cs └── project.json ├── LICENSE.md ├── README.md └── tools └── AvapiGenerator ├── AvapiConnection.cs ├── AvapiGenerator.csproj ├── CodeGenerator.cs ├── Constant.cs ├── Csproj.cs ├── DocGenerator.cs ├── Documentation.cs ├── Example.cs ├── ExampleGenerator.cs ├── IAvapiConnection.cs ├── Implementation.cs ├── InterfaceAvaApi.cs ├── Program.cs ├── Utility.cs ├── avapi.xml ├── project.json └── version.txt /Avapi/AD/Const_AD.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiAD 2 | { 3 | public static class Const_AD 4 | { 5 | public enum AD_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Avapi/AD/Int_AD.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiAD 4 | { 5 | public interface Int_AD 6 | { 7 | IAvapiResponse_AD Query( 8 | string symbol, 9 | Const_AD.AD_interval interval); 10 | 11 | Task QueryAsync( 12 | string symbol, 13 | Const_AD.AD_interval interval); 14 | 15 | 16 | IAvapiResponse_AD QueryPrimitive( 17 | string symbol, 18 | string interval); 19 | 20 | Task QueryPrimitiveAsync( 21 | string symbol, 22 | string interval); 23 | 24 | } 25 | 26 | public interface IAvapiResponse_AD 27 | { 28 | string LastHttpRequest 29 | { 30 | get; 31 | } 32 | 33 | string RawData 34 | { 35 | get; 36 | } 37 | 38 | IAvapiResponse_AD_Content Data 39 | { 40 | get; 41 | } 42 | } 43 | 44 | public interface IAvapiResponse_AD_Content 45 | { 46 | bool Error 47 | { 48 | get; 49 | } 50 | 51 | string ErrorMessage 52 | { 53 | get; 54 | } 55 | 56 | MetaData_Type_AD MetaData 57 | { 58 | get; 59 | } 60 | 61 | IList TechnicalIndicator 62 | { 63 | get; 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Avapi/ADOSC/Const_ADOSC.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiADOSC 2 | { 3 | public static class Const_ADOSC 4 | { 5 | public enum ADOSC_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Avapi/ADOSC/Int_ADOSC.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiADOSC 4 | { 5 | public interface Int_ADOSC 6 | { 7 | IAvapiResponse_ADOSC Query( 8 | string symbol, 9 | Const_ADOSC.ADOSC_interval interval, 10 | int fastperiod = -1, 11 | int slowperiod = -1); 12 | 13 | Task QueryAsync( 14 | string symbol, 15 | Const_ADOSC.ADOSC_interval interval, 16 | int fastperiod = -1, 17 | int slowperiod = -1); 18 | 19 | 20 | IAvapiResponse_ADOSC QueryPrimitive( 21 | string symbol, 22 | string interval, 23 | int fastperiod = -1, 24 | int slowperiod = -1); 25 | 26 | Task QueryPrimitiveAsync( 27 | string symbol, 28 | string interval, 29 | int fastperiod = -1, 30 | int slowperiod = -1); 31 | 32 | } 33 | 34 | public interface IAvapiResponse_ADOSC 35 | { 36 | string LastHttpRequest 37 | { 38 | get; 39 | } 40 | 41 | string RawData 42 | { 43 | get; 44 | } 45 | 46 | IAvapiResponse_ADOSC_Content Data 47 | { 48 | get; 49 | } 50 | } 51 | 52 | public interface IAvapiResponse_ADOSC_Content 53 | { 54 | bool Error 55 | { 56 | get; 57 | } 58 | 59 | string ErrorMessage 60 | { 61 | get; 62 | } 63 | 64 | MetaData_Type_ADOSC MetaData 65 | { 66 | get; 67 | } 68 | 69 | IList TechnicalIndicator 70 | { 71 | get; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Avapi/ADX/Const_ADX.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiADX 2 | { 3 | public static class Const_ADX 4 | { 5 | public enum ADX_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Avapi/ADX/Int_ADX.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiADX 4 | { 5 | public interface Int_ADX 6 | { 7 | IAvapiResponse_ADX Query( 8 | string symbol, 9 | Const_ADX.ADX_interval interval, 10 | int time_period); 11 | 12 | Task QueryAsync( 13 | string symbol, 14 | Const_ADX.ADX_interval interval, 15 | int time_period); 16 | 17 | 18 | IAvapiResponse_ADX QueryPrimitive( 19 | string symbol, 20 | string interval, 21 | int time_period); 22 | 23 | Task QueryPrimitiveAsync( 24 | string symbol, 25 | string interval, 26 | int time_period); 27 | 28 | } 29 | 30 | public interface IAvapiResponse_ADX 31 | { 32 | string LastHttpRequest 33 | { 34 | get; 35 | } 36 | 37 | string RawData 38 | { 39 | get; 40 | } 41 | 42 | IAvapiResponse_ADX_Content Data 43 | { 44 | get; 45 | } 46 | } 47 | 48 | public interface IAvapiResponse_ADX_Content 49 | { 50 | bool Error 51 | { 52 | get; 53 | } 54 | 55 | string ErrorMessage 56 | { 57 | get; 58 | } 59 | 60 | MetaData_Type_ADX MetaData 61 | { 62 | get; 63 | } 64 | 65 | IList TechnicalIndicator 66 | { 67 | get; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Avapi/ADXR/Const_ADXR.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiADXR 2 | { 3 | public static class Const_ADXR 4 | { 5 | public enum ADXR_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Avapi/ADXR/Int_ADXR.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiADXR 4 | { 5 | public interface Int_ADXR 6 | { 7 | IAvapiResponse_ADXR Query( 8 | string symbol, 9 | Const_ADXR.ADXR_interval interval, 10 | int time_period); 11 | 12 | Task QueryAsync( 13 | string symbol, 14 | Const_ADXR.ADXR_interval interval, 15 | int time_period); 16 | 17 | 18 | IAvapiResponse_ADXR QueryPrimitive( 19 | string symbol, 20 | string interval, 21 | int time_period); 22 | 23 | Task QueryPrimitiveAsync( 24 | string symbol, 25 | string interval, 26 | int time_period); 27 | 28 | } 29 | 30 | public interface IAvapiResponse_ADXR 31 | { 32 | string LastHttpRequest 33 | { 34 | get; 35 | } 36 | 37 | string RawData 38 | { 39 | get; 40 | } 41 | 42 | IAvapiResponse_ADXR_Content Data 43 | { 44 | get; 45 | } 46 | } 47 | 48 | public interface IAvapiResponse_ADXR_Content 49 | { 50 | bool Error 51 | { 52 | get; 53 | } 54 | 55 | string ErrorMessage 56 | { 57 | get; 58 | } 59 | 60 | MetaData_Type_ADXR MetaData 61 | { 62 | get; 63 | } 64 | 65 | IList TechnicalIndicator 66 | { 67 | get; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Avapi/APO/Const_APO.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiAPO 2 | { 3 | public static class Const_APO 4 | { 5 | public enum APO_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum APO_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | public enum APO_matype 26 | {none, 27 | n_0, 28 | n_1, 29 | n_2, 30 | n_3, 31 | n_4, 32 | n_5, 33 | n_6, 34 | n_7, 35 | n_8 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Avapi/APO/Int_APO.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiAPO 4 | { 5 | public interface Int_APO 6 | { 7 | IAvapiResponse_APO Query( 8 | string symbol, 9 | Const_APO.APO_interval interval, 10 | Const_APO.APO_series_type series_type, 11 | int fastperiod = -1, 12 | int slowperiod = -1, 13 | Const_APO.APO_matype matype = Const_APO.APO_matype.none); 14 | 15 | Task QueryAsync( 16 | string symbol, 17 | Const_APO.APO_interval interval, 18 | Const_APO.APO_series_type series_type, 19 | int fastperiod = -1, 20 | int slowperiod = -1, 21 | Const_APO.APO_matype matype = Const_APO.APO_matype.none); 22 | 23 | 24 | IAvapiResponse_APO QueryPrimitive( 25 | string symbol, 26 | string interval, 27 | string series_type, 28 | int fastperiod = -1, 29 | int slowperiod = -1, 30 | int matype = -1); 31 | 32 | Task QueryPrimitiveAsync( 33 | string symbol, 34 | string interval, 35 | string series_type, 36 | int fastperiod = -1, 37 | int slowperiod = -1, 38 | int matype = -1); 39 | 40 | } 41 | 42 | public interface IAvapiResponse_APO 43 | { 44 | string LastHttpRequest 45 | { 46 | get; 47 | } 48 | 49 | string RawData 50 | { 51 | get; 52 | } 53 | 54 | IAvapiResponse_APO_Content Data 55 | { 56 | get; 57 | } 58 | } 59 | 60 | public interface IAvapiResponse_APO_Content 61 | { 62 | bool Error 63 | { 64 | get; 65 | } 66 | 67 | string ErrorMessage 68 | { 69 | get; 70 | } 71 | 72 | MetaData_Type_APO MetaData 73 | { 74 | get; 75 | } 76 | 77 | IList TechnicalIndicator 78 | { 79 | get; 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /Avapi/AROON/Const_AROON.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiAROON 2 | { 3 | public static class Const_AROON 4 | { 5 | public enum AROON_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Avapi/AROON/Int_AROON.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiAROON 4 | { 5 | public interface Int_AROON 6 | { 7 | IAvapiResponse_AROON Query( 8 | string symbol, 9 | Const_AROON.AROON_interval interval, 10 | int time_period); 11 | 12 | Task QueryAsync( 13 | string symbol, 14 | Const_AROON.AROON_interval interval, 15 | int time_period); 16 | 17 | 18 | IAvapiResponse_AROON QueryPrimitive( 19 | string symbol, 20 | string interval, 21 | int time_period); 22 | 23 | Task QueryPrimitiveAsync( 24 | string symbol, 25 | string interval, 26 | int time_period); 27 | 28 | } 29 | 30 | public interface IAvapiResponse_AROON 31 | { 32 | string LastHttpRequest 33 | { 34 | get; 35 | } 36 | 37 | string RawData 38 | { 39 | get; 40 | } 41 | 42 | IAvapiResponse_AROON_Content Data 43 | { 44 | get; 45 | } 46 | } 47 | 48 | public interface IAvapiResponse_AROON_Content 49 | { 50 | bool Error 51 | { 52 | get; 53 | } 54 | 55 | string ErrorMessage 56 | { 57 | get; 58 | } 59 | 60 | MetaData_Type_AROON MetaData 61 | { 62 | get; 63 | } 64 | 65 | IList TechnicalIndicator 66 | { 67 | get; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Avapi/AROONOSC/Const_AROONOSC.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiAROONOSC 2 | { 3 | public static class Const_AROONOSC 4 | { 5 | public enum AROONOSC_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Avapi/AROONOSC/Int_AROONOSC.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiAROONOSC 4 | { 5 | public interface Int_AROONOSC 6 | { 7 | IAvapiResponse_AROONOSC Query( 8 | string symbol, 9 | Const_AROONOSC.AROONOSC_interval interval, 10 | int time_period); 11 | 12 | Task QueryAsync( 13 | string symbol, 14 | Const_AROONOSC.AROONOSC_interval interval, 15 | int time_period); 16 | 17 | 18 | IAvapiResponse_AROONOSC QueryPrimitive( 19 | string symbol, 20 | string interval, 21 | int time_period); 22 | 23 | Task QueryPrimitiveAsync( 24 | string symbol, 25 | string interval, 26 | int time_period); 27 | 28 | } 29 | 30 | public interface IAvapiResponse_AROONOSC 31 | { 32 | string LastHttpRequest 33 | { 34 | get; 35 | } 36 | 37 | string RawData 38 | { 39 | get; 40 | } 41 | 42 | IAvapiResponse_AROONOSC_Content Data 43 | { 44 | get; 45 | } 46 | } 47 | 48 | public interface IAvapiResponse_AROONOSC_Content 49 | { 50 | bool Error 51 | { 52 | get; 53 | } 54 | 55 | string ErrorMessage 56 | { 57 | get; 58 | } 59 | 60 | MetaData_Type_AROONOSC MetaData 61 | { 62 | get; 63 | } 64 | 65 | IList TechnicalIndicator 66 | { 67 | get; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Avapi/ATR/Const_ATR.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiATR 2 | { 3 | public static class Const_ATR 4 | { 5 | public enum ATR_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Avapi/ATR/Int_ATR.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiATR 4 | { 5 | public interface Int_ATR 6 | { 7 | IAvapiResponse_ATR Query( 8 | string symbol, 9 | Const_ATR.ATR_interval interval, 10 | int time_period); 11 | 12 | Task QueryAsync( 13 | string symbol, 14 | Const_ATR.ATR_interval interval, 15 | int time_period); 16 | 17 | 18 | IAvapiResponse_ATR QueryPrimitive( 19 | string symbol, 20 | string interval, 21 | int time_period); 22 | 23 | Task QueryPrimitiveAsync( 24 | string symbol, 25 | string interval, 26 | int time_period); 27 | 28 | } 29 | 30 | public interface IAvapiResponse_ATR 31 | { 32 | string LastHttpRequest 33 | { 34 | get; 35 | } 36 | 37 | string RawData 38 | { 39 | get; 40 | } 41 | 42 | IAvapiResponse_ATR_Content Data 43 | { 44 | get; 45 | } 46 | } 47 | 48 | public interface IAvapiResponse_ATR_Content 49 | { 50 | bool Error 51 | { 52 | get; 53 | } 54 | 55 | string ErrorMessage 56 | { 57 | get; 58 | } 59 | 60 | MetaData_Type_ATR MetaData 61 | { 62 | get; 63 | } 64 | 65 | IList TechnicalIndicator 66 | { 67 | get; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Avapi/Avapi.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netcoreapp1.1;netstandard2.0 4 | 1.4.8.3 5 | Avapi 6 | 1.4.8.3 7 | Simone Giuliani, Antonio Papa 8 | Alpha Vantage .NET API Wrapper 9 | 10 | This library allows to retrieve financial data using Alpha Vantage API. 11 | 12 | The official page of Avapi.NET CORE is available at this link: https://github.com/AvapiDotNet/Avapi/ 13 | 14 | The complete documentation of Avapi.NET CORE is available at this link: https://github.com/AvapiDotNet/Avapi/wiki 15 | 16 | To start using Avapi you just need to: 17 | 18 | 1. Register to Alpha Vantage web site and get your personal api key(https://www.alphavantage.co/support/#api-key). It's for free! 19 | 20 | 2. Install Avapi package on your project 21 | 22 | 3. Consume the Avapi library 23 | 24 | 25 | https://github.com/AvapiDotNet/Avapi 26 | false 27 | Internal change 28 | AlphaVantage Alpha Vantage API Wrapper Financial Data Finance .NET Core Avapi 29 | 30 | 31 | 32 | 33 | 34 | Copyright (c) 2018 Simone Giuliani and Antonio Papa 35 | 36 | Permission is hereby granted, free of charge, to any person obtaining a copy 37 | of this software and associated documentation files (the "Software"), to deal 38 | in the Software without restriction, including without limitation the rights 39 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 40 | copies of the Software, and to permit persons to whom the Software is 41 | furnished to do so, subject to the following conditions: 42 | 43 | The above copyright notice and this permission notice shall be included in all 44 | copies or substantial portions of the Software. 45 | 46 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 47 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 48 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 49 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 50 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 51 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 52 | SOFTWARE. 53 | 54 | 1.4.8.3 55 | 1.4.8.3 56 | en-GB 57 | false 58 | 59 | Library 60 | 61 | true 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /Avapi/BATCH_STOCK_QUOTES/Const_BATCH_STOCK_QUOTES.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiBATCH_STOCK_QUOTES 2 | { 3 | public static class Const_BATCH_STOCK_QUOTES 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Avapi/BATCH_STOCK_QUOTES/Impl_BATCH_STOCK_QUOTES.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Net.Http; 5 | using Newtonsoft.Json; 6 | using System.Threading.Tasks; 7 | using Newtonsoft.Json.Linq; 8 | 9 | namespace Avapi.AvapiBATCH_STOCK_QUOTES 10 | { 11 | internal class AvapiResponse_BATCH_STOCK_QUOTES : IAvapiResponse_BATCH_STOCK_QUOTES 12 | { 13 | public string LastHttpRequest 14 | { 15 | get; 16 | internal set; 17 | 18 | } 19 | public string RawData 20 | { 21 | get; 22 | internal set; 23 | } 24 | 25 | public IAvapiResponse_BATCH_STOCK_QUOTES_Content Data 26 | { 27 | get; 28 | internal set; 29 | } 30 | } 31 | 32 | public class MetaData_Type_BATCH_STOCK_QUOTES 33 | { 34 | public string Information 35 | { 36 | internal set; 37 | get; 38 | } 39 | 40 | public string Notes 41 | { 42 | internal set; 43 | get; 44 | } 45 | 46 | public string TimeZone 47 | { 48 | internal set; 49 | get; 50 | } 51 | 52 | } 53 | 54 | public class StockQuotes_Type_BATCH_STOCK_QUOTES 55 | { 56 | [JsonProperty("1. symbol")] 57 | public string Symbol 58 | { 59 | internal set; 60 | get; 61 | } 62 | 63 | [JsonProperty("2. price")] 64 | public string Price 65 | { 66 | internal set; 67 | get; 68 | } 69 | 70 | [JsonProperty("3. volume")] 71 | public string Volume 72 | { 73 | internal set; 74 | get; 75 | } 76 | 77 | [JsonProperty("4. timestamp")] 78 | public string TimeStamp 79 | { 80 | internal set; 81 | get; 82 | } 83 | 84 | } 85 | 86 | internal class AvapiResponse_BATCH_STOCK_QUOTES_Content : IAvapiResponse_BATCH_STOCK_QUOTES_Content 87 | { 88 | internal AvapiResponse_BATCH_STOCK_QUOTES_Content() 89 | { 90 | MetaData = new MetaData_Type_BATCH_STOCK_QUOTES(); 91 | StockQuotes = new List(); 92 | } 93 | 94 | public MetaData_Type_BATCH_STOCK_QUOTES MetaData 95 | { 96 | internal set; 97 | get; 98 | } 99 | 100 | public IList StockQuotes 101 | { 102 | internal set; 103 | get; 104 | } 105 | 106 | public bool Error 107 | { 108 | internal set; 109 | get; 110 | } 111 | 112 | public string ErrorMessage 113 | { 114 | internal set; 115 | get; 116 | } 117 | } 118 | 119 | public class Impl_BATCH_STOCK_QUOTES : Int_BATCH_STOCK_QUOTES 120 | { 121 | const string s_function = "BATCH_STOCK_QUOTES"; 122 | 123 | internal static string ApiKey 124 | { 125 | get; 126 | set; 127 | } 128 | 129 | internal static HttpClient RestClient 130 | { 131 | get; 132 | set; 133 | } 134 | 135 | internal static string AvapiUrl 136 | { 137 | get; 138 | set; 139 | } 140 | 141 | private static readonly Lazy s_Impl_BATCH_STOCK_QUOTES = 142 | new Lazy(() => new Impl_BATCH_STOCK_QUOTES()); 143 | public static Impl_BATCH_STOCK_QUOTES Instance 144 | { 145 | get 146 | { 147 | return s_Impl_BATCH_STOCK_QUOTES.Value; 148 | } 149 | } 150 | private Impl_BATCH_STOCK_QUOTES() 151 | { 152 | } 153 | 154 | 155 | public IAvapiResponse_BATCH_STOCK_QUOTES QueryPrimitive( 156 | string symbols) 157 | { 158 | // Build Base Uri 159 | string queryString = AvapiUrl + "/query"; 160 | 161 | // Build query parameters 162 | IDictionary getParameters = new Dictionary(); 163 | getParameters.Add(new KeyValuePair("function", s_function)); 164 | getParameters.Add(new KeyValuePair("apikey", ApiKey)); 165 | getParameters.Add(new KeyValuePair("symbols",symbols)); 166 | queryString += UrlUtility.AsQueryString(getParameters); 167 | 168 | // Sent the Request and get the raw data from the Response 169 | string response = RestClient?. 170 | GetAsync(queryString)?. 171 | Result?. 172 | Content?. 173 | ReadAsStringAsync()?. 174 | Result; 175 | 176 | IAvapiResponse_BATCH_STOCK_QUOTES ret = new AvapiResponse_BATCH_STOCK_QUOTES 177 | { 178 | RawData = response, 179 | Data = ParseInternal(response), 180 | LastHttpRequest = queryString 181 | }; 182 | 183 | return ret; 184 | } 185 | 186 | public async Task QueryPrimitiveAsync( 187 | string symbols) 188 | { 189 | // Build Base Uri 190 | string queryString = AvapiUrl + "/query"; 191 | 192 | // Build query parameters 193 | IDictionary getParameters = new Dictionary(); 194 | getParameters.Add(new KeyValuePair("function", s_function)); 195 | getParameters.Add(new KeyValuePair("apikey", ApiKey)); 196 | getParameters.Add(new KeyValuePair("symbols",symbols)); 197 | queryString += UrlUtility.AsQueryString(getParameters); 198 | 199 | string response; 200 | using (var result = await RestClient.GetAsync(queryString)) 201 | { 202 | response = await result.Content.ReadAsStringAsync(); 203 | } 204 | IAvapiResponse_BATCH_STOCK_QUOTES ret = new AvapiResponse_BATCH_STOCK_QUOTES 205 | { 206 | RawData = response, 207 | Data = ParseInternal(response), 208 | LastHttpRequest = queryString 209 | }; 210 | 211 | return ret; 212 | } 213 | 214 | static internal IAvapiResponse_BATCH_STOCK_QUOTES_Content ParseInternal(string jsonInput) 215 | { 216 | if (string.IsNullOrEmpty(jsonInput)) 217 | { 218 | return null; 219 | } 220 | if(jsonInput == "{}") 221 | { 222 | return null; 223 | } 224 | 225 | AvapiResponse_BATCH_STOCK_QUOTES_Content ret = new AvapiResponse_BATCH_STOCK_QUOTES_Content(); 226 | JObject jsonInputParsed = JObject.Parse(jsonInput); 227 | string errorMessage = (string)jsonInputParsed["Error Message"]; 228 | if (!string.IsNullOrEmpty(errorMessage)) 229 | { 230 | ret.Error = true; 231 | ret.ErrorMessage = errorMessage; 232 | } 233 | else 234 | { 235 | JToken metaData = jsonInputParsed["Meta Data"]; 236 | ret.MetaData.Information = (string)metaData["1. Information"]; 237 | ret.MetaData.Notes = (string)metaData["2. Notes"]; 238 | ret.MetaData.TimeZone = (string)metaData["3. Time Zone"]; 239 | ret.StockQuotes = JsonConvert.DeserializeObject>(jsonInputParsed["Stock Quotes"].ToString()); 240 | } 241 | return ret; 242 | } 243 | } 244 | } -------------------------------------------------------------------------------- /Avapi/BATCH_STOCK_QUOTES/Int_BATCH_STOCK_QUOTES.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiBATCH_STOCK_QUOTES 4 | { 5 | public interface Int_BATCH_STOCK_QUOTES 6 | { 7 | 8 | IAvapiResponse_BATCH_STOCK_QUOTES QueryPrimitive( 9 | string symbols); 10 | 11 | Task QueryPrimitiveAsync( 12 | string symbols); 13 | 14 | } 15 | 16 | public interface IAvapiResponse_BATCH_STOCK_QUOTES 17 | { 18 | string LastHttpRequest 19 | { 20 | get; 21 | } 22 | 23 | string RawData 24 | { 25 | get; 26 | } 27 | 28 | IAvapiResponse_BATCH_STOCK_QUOTES_Content Data 29 | { 30 | get; 31 | } 32 | } 33 | 34 | public interface IAvapiResponse_BATCH_STOCK_QUOTES_Content 35 | { 36 | bool Error 37 | { 38 | get; 39 | } 40 | 41 | string ErrorMessage 42 | { 43 | get; 44 | } 45 | 46 | MetaData_Type_BATCH_STOCK_QUOTES MetaData 47 | { 48 | get; 49 | } 50 | 51 | IList StockQuotes 52 | { 53 | get; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Avapi/BBANDS/Const_BBANDS.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiBBANDS 2 | { 3 | public static class Const_BBANDS 4 | { 5 | public enum BBANDS_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum BBANDS_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | public enum BBANDS_matype 26 | {none, 27 | n_0, 28 | n_1, 29 | n_2, 30 | n_3, 31 | n_4, 32 | n_5, 33 | n_6, 34 | n_7, 35 | n_8 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Avapi/BBANDS/Int_BBANDS.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiBBANDS 4 | { 5 | public interface Int_BBANDS 6 | { 7 | IAvapiResponse_BBANDS Query( 8 | string symbol, 9 | Const_BBANDS.BBANDS_interval interval, 10 | int time_period, 11 | Const_BBANDS.BBANDS_series_type series_type, 12 | int nbdevup = -1, 13 | int nbdevdn = -1, 14 | Const_BBANDS.BBANDS_matype matype = Const_BBANDS.BBANDS_matype.none); 15 | 16 | Task QueryAsync( 17 | string symbol, 18 | Const_BBANDS.BBANDS_interval interval, 19 | int time_period, 20 | Const_BBANDS.BBANDS_series_type series_type, 21 | int nbdevup = -1, 22 | int nbdevdn = -1, 23 | Const_BBANDS.BBANDS_matype matype = Const_BBANDS.BBANDS_matype.none); 24 | 25 | 26 | IAvapiResponse_BBANDS QueryPrimitive( 27 | string symbol, 28 | string interval, 29 | int time_period, 30 | string series_type, 31 | int nbdevup = -1, 32 | int nbdevdn = -1, 33 | int matype = -1); 34 | 35 | Task QueryPrimitiveAsync( 36 | string symbol, 37 | string interval, 38 | int time_period, 39 | string series_type, 40 | int nbdevup = -1, 41 | int nbdevdn = -1, 42 | int matype = -1); 43 | 44 | } 45 | 46 | public interface IAvapiResponse_BBANDS 47 | { 48 | string LastHttpRequest 49 | { 50 | get; 51 | } 52 | 53 | string RawData 54 | { 55 | get; 56 | } 57 | 58 | IAvapiResponse_BBANDS_Content Data 59 | { 60 | get; 61 | } 62 | } 63 | 64 | public interface IAvapiResponse_BBANDS_Content 65 | { 66 | bool Error 67 | { 68 | get; 69 | } 70 | 71 | string ErrorMessage 72 | { 73 | get; 74 | } 75 | 76 | MetaData_Type_BBANDS MetaData 77 | { 78 | get; 79 | } 80 | 81 | IList TechnicalIndicator 82 | { 83 | get; 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /Avapi/BOP/Const_BOP.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiBOP 2 | { 3 | public static class Const_BOP 4 | { 5 | public enum BOP_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Avapi/BOP/Int_BOP.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiBOP 4 | { 5 | public interface Int_BOP 6 | { 7 | IAvapiResponse_BOP Query( 8 | string symbol, 9 | Const_BOP.BOP_interval interval); 10 | 11 | Task QueryAsync( 12 | string symbol, 13 | Const_BOP.BOP_interval interval); 14 | 15 | 16 | IAvapiResponse_BOP QueryPrimitive( 17 | string symbol, 18 | string interval); 19 | 20 | Task QueryPrimitiveAsync( 21 | string symbol, 22 | string interval); 23 | 24 | } 25 | 26 | public interface IAvapiResponse_BOP 27 | { 28 | string LastHttpRequest 29 | { 30 | get; 31 | } 32 | 33 | string RawData 34 | { 35 | get; 36 | } 37 | 38 | IAvapiResponse_BOP_Content Data 39 | { 40 | get; 41 | } 42 | } 43 | 44 | public interface IAvapiResponse_BOP_Content 45 | { 46 | bool Error 47 | { 48 | get; 49 | } 50 | 51 | string ErrorMessage 52 | { 53 | get; 54 | } 55 | 56 | MetaData_Type_BOP MetaData 57 | { 58 | get; 59 | } 60 | 61 | IList TechnicalIndicator 62 | { 63 | get; 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Avapi/CCI/Const_CCI.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiCCI 2 | { 3 | public static class Const_CCI 4 | { 5 | public enum CCI_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Avapi/CCI/Int_CCI.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiCCI 4 | { 5 | public interface Int_CCI 6 | { 7 | IAvapiResponse_CCI Query( 8 | string symbol, 9 | Const_CCI.CCI_interval interval, 10 | int time_period); 11 | 12 | Task QueryAsync( 13 | string symbol, 14 | Const_CCI.CCI_interval interval, 15 | int time_period); 16 | 17 | 18 | IAvapiResponse_CCI QueryPrimitive( 19 | string symbol, 20 | string interval, 21 | int time_period); 22 | 23 | Task QueryPrimitiveAsync( 24 | string symbol, 25 | string interval, 26 | int time_period); 27 | 28 | } 29 | 30 | public interface IAvapiResponse_CCI 31 | { 32 | string LastHttpRequest 33 | { 34 | get; 35 | } 36 | 37 | string RawData 38 | { 39 | get; 40 | } 41 | 42 | IAvapiResponse_CCI_Content Data 43 | { 44 | get; 45 | } 46 | } 47 | 48 | public interface IAvapiResponse_CCI_Content 49 | { 50 | bool Error 51 | { 52 | get; 53 | } 54 | 55 | string ErrorMessage 56 | { 57 | get; 58 | } 59 | 60 | MetaData_Type_CCI MetaData 61 | { 62 | get; 63 | } 64 | 65 | IList TechnicalIndicator 66 | { 67 | get; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Avapi/CMO/Const_CMO.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiCMO 2 | { 3 | public static class Const_CMO 4 | { 5 | public enum CMO_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum CMO_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Avapi/CMO/Int_CMO.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiCMO 4 | { 5 | public interface Int_CMO 6 | { 7 | IAvapiResponse_CMO Query( 8 | string symbol, 9 | Const_CMO.CMO_interval interval, 10 | int time_period, 11 | Const_CMO.CMO_series_type series_type); 12 | 13 | Task QueryAsync( 14 | string symbol, 15 | Const_CMO.CMO_interval interval, 16 | int time_period, 17 | Const_CMO.CMO_series_type series_type); 18 | 19 | 20 | IAvapiResponse_CMO QueryPrimitive( 21 | string symbol, 22 | string interval, 23 | int time_period, 24 | string series_type); 25 | 26 | Task QueryPrimitiveAsync( 27 | string symbol, 28 | string interval, 29 | int time_period, 30 | string series_type); 31 | 32 | } 33 | 34 | public interface IAvapiResponse_CMO 35 | { 36 | string LastHttpRequest 37 | { 38 | get; 39 | } 40 | 41 | string RawData 42 | { 43 | get; 44 | } 45 | 46 | IAvapiResponse_CMO_Content Data 47 | { 48 | get; 49 | } 50 | } 51 | 52 | public interface IAvapiResponse_CMO_Content 53 | { 54 | bool Error 55 | { 56 | get; 57 | } 58 | 59 | string ErrorMessage 60 | { 61 | get; 62 | } 63 | 64 | MetaData_Type_CMO MetaData 65 | { 66 | get; 67 | } 68 | 69 | IList TechnicalIndicator 70 | { 71 | get; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Avapi/CURRENCY_EXCHANGE_RATE/Const_CURRENCY_EXCHANGE_RATE.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiCURRENCY_EXCHANGE_RATE 2 | { 3 | public static class Const_CURRENCY_EXCHANGE_RATE 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Avapi/CURRENCY_EXCHANGE_RATE/Impl_CURRENCY_EXCHANGE_RATE.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Net.Http; 5 | using Newtonsoft.Json; 6 | using System.Threading.Tasks; 7 | using Newtonsoft.Json.Linq; 8 | 9 | namespace Avapi.AvapiCURRENCY_EXCHANGE_RATE 10 | { 11 | internal class AvapiResponse_CURRENCY_EXCHANGE_RATE : IAvapiResponse_CURRENCY_EXCHANGE_RATE 12 | { 13 | public string LastHttpRequest 14 | { 15 | get; 16 | internal set; 17 | 18 | } 19 | public string RawData 20 | { 21 | get; 22 | internal set; 23 | } 24 | 25 | public IAvapiResponse_CURRENCY_EXCHANGE_RATE_Content Data 26 | { 27 | get; 28 | internal set; 29 | } 30 | } 31 | 32 | internal class AvapiResponse_CURRENCY_EXCHANGE_RATE_Content : IAvapiResponse_CURRENCY_EXCHANGE_RATE_Content 33 | { 34 | internal AvapiResponse_CURRENCY_EXCHANGE_RATE_Content() 35 | { 36 | } 37 | 38 | public string FromCurrencyCode 39 | { 40 | internal set; 41 | get; 42 | } 43 | 44 | public string FromCurrencyName 45 | { 46 | internal set; 47 | get; 48 | } 49 | 50 | public string ToCurrencyCode 51 | { 52 | internal set; 53 | get; 54 | } 55 | 56 | public string ToCurrencyName 57 | { 58 | internal set; 59 | get; 60 | } 61 | 62 | public string ExchangeRate 63 | { 64 | internal set; 65 | get; 66 | } 67 | 68 | public string LastRefreshed 69 | { 70 | internal set; 71 | get; 72 | } 73 | 74 | public string TimeZone 75 | { 76 | internal set; 77 | get; 78 | } 79 | 80 | public bool Error 81 | { 82 | internal set; 83 | get; 84 | } 85 | 86 | public string ErrorMessage 87 | { 88 | internal set; 89 | get; 90 | } 91 | } 92 | 93 | public class Impl_CURRENCY_EXCHANGE_RATE : Int_CURRENCY_EXCHANGE_RATE 94 | { 95 | const string s_function = "CURRENCY_EXCHANGE_RATE"; 96 | 97 | internal static string ApiKey 98 | { 99 | get; 100 | set; 101 | } 102 | 103 | internal static HttpClient RestClient 104 | { 105 | get; 106 | set; 107 | } 108 | 109 | internal static string AvapiUrl 110 | { 111 | get; 112 | set; 113 | } 114 | 115 | private static readonly Lazy s_Impl_CURRENCY_EXCHANGE_RATE = 116 | new Lazy(() => new Impl_CURRENCY_EXCHANGE_RATE()); 117 | public static Impl_CURRENCY_EXCHANGE_RATE Instance 118 | { 119 | get 120 | { 121 | return s_Impl_CURRENCY_EXCHANGE_RATE.Value; 122 | } 123 | } 124 | private Impl_CURRENCY_EXCHANGE_RATE() 125 | { 126 | } 127 | 128 | 129 | public IAvapiResponse_CURRENCY_EXCHANGE_RATE QueryPrimitive( 130 | string from_currency, 131 | string to_currency) 132 | { 133 | // Build Base Uri 134 | string queryString = AvapiUrl + "/query"; 135 | 136 | // Build query parameters 137 | IDictionary getParameters = new Dictionary(); 138 | getParameters.Add(new KeyValuePair("function", s_function)); 139 | getParameters.Add(new KeyValuePair("apikey", ApiKey)); 140 | getParameters.Add(new KeyValuePair("from_currency",from_currency)); 141 | getParameters.Add(new KeyValuePair("to_currency",to_currency)); 142 | queryString += UrlUtility.AsQueryString(getParameters); 143 | 144 | // Sent the Request and get the raw data from the Response 145 | string response = RestClient?. 146 | GetAsync(queryString)?. 147 | Result?. 148 | Content?. 149 | ReadAsStringAsync()?. 150 | Result; 151 | 152 | IAvapiResponse_CURRENCY_EXCHANGE_RATE ret = new AvapiResponse_CURRENCY_EXCHANGE_RATE 153 | { 154 | RawData = response, 155 | Data = ParseInternal(response), 156 | LastHttpRequest = queryString 157 | }; 158 | 159 | return ret; 160 | } 161 | 162 | public async Task QueryPrimitiveAsync( 163 | string from_currency, 164 | string to_currency) 165 | { 166 | // Build Base Uri 167 | string queryString = AvapiUrl + "/query"; 168 | 169 | // Build query parameters 170 | IDictionary getParameters = new Dictionary(); 171 | getParameters.Add(new KeyValuePair("function", s_function)); 172 | getParameters.Add(new KeyValuePair("apikey", ApiKey)); 173 | getParameters.Add(new KeyValuePair("from_currency",from_currency)); 174 | getParameters.Add(new KeyValuePair("to_currency",to_currency)); 175 | queryString += UrlUtility.AsQueryString(getParameters); 176 | 177 | string response; 178 | using (var result = await RestClient.GetAsync(queryString)) 179 | { 180 | response = await result.Content.ReadAsStringAsync(); 181 | } 182 | IAvapiResponse_CURRENCY_EXCHANGE_RATE ret = new AvapiResponse_CURRENCY_EXCHANGE_RATE 183 | { 184 | RawData = response, 185 | Data = ParseInternal(response), 186 | LastHttpRequest = queryString 187 | }; 188 | 189 | return ret; 190 | } 191 | 192 | static internal IAvapiResponse_CURRENCY_EXCHANGE_RATE_Content ParseInternal(string jsonInput) 193 | { 194 | if (string.IsNullOrEmpty(jsonInput)) 195 | { 196 | return null; 197 | } 198 | if(jsonInput == "{}") 199 | { 200 | return null; 201 | } 202 | 203 | AvapiResponse_CURRENCY_EXCHANGE_RATE_Content ret = new AvapiResponse_CURRENCY_EXCHANGE_RATE_Content(); 204 | JObject jsonInputParsed = JObject.Parse(jsonInput); 205 | string errorMessage = (string)jsonInputParsed["Error Message"]; 206 | if (!string.IsNullOrEmpty(errorMessage)) 207 | { 208 | ret.Error = true; 209 | ret.ErrorMessage = errorMessage; 210 | } 211 | else 212 | { 213 | JToken currencyExchange = jsonInputParsed["Realtime Currency Exchange Rate"]; 214 | ret.FromCurrencyCode = (string)currencyExchange["1. From_Currency Code"]; 215 | ret.FromCurrencyName = (string)currencyExchange["2. From_Currency Name"]; 216 | ret.ToCurrencyCode = (string)currencyExchange["3. To_Currency Code"]; 217 | ret.ToCurrencyName = (string)currencyExchange["4. To_Currency Name"]; 218 | ret.ExchangeRate = (string)currencyExchange["5. Exchange Rate"]; 219 | ret.LastRefreshed = (string)currencyExchange["6. Last Refreshed"]; 220 | ret.TimeZone = (string)currencyExchange["7. Time Zone"]; 221 | } 222 | return ret; 223 | } 224 | } 225 | } -------------------------------------------------------------------------------- /Avapi/CURRENCY_EXCHANGE_RATE/Int_CURRENCY_EXCHANGE_RATE.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiCURRENCY_EXCHANGE_RATE 4 | { 5 | public interface Int_CURRENCY_EXCHANGE_RATE 6 | { 7 | 8 | IAvapiResponse_CURRENCY_EXCHANGE_RATE QueryPrimitive( 9 | string from_currency, 10 | string to_currency); 11 | 12 | Task QueryPrimitiveAsync( 13 | string from_currency, 14 | string to_currency); 15 | 16 | } 17 | 18 | public interface IAvapiResponse_CURRENCY_EXCHANGE_RATE 19 | { 20 | string LastHttpRequest 21 | { 22 | get; 23 | } 24 | 25 | string RawData 26 | { 27 | get; 28 | } 29 | 30 | IAvapiResponse_CURRENCY_EXCHANGE_RATE_Content Data 31 | { 32 | get; 33 | } 34 | } 35 | 36 | public interface IAvapiResponse_CURRENCY_EXCHANGE_RATE_Content 37 | { 38 | string FromCurrencyCode 39 | { 40 | get; 41 | } 42 | 43 | string FromCurrencyName 44 | { 45 | get; 46 | } 47 | 48 | string ToCurrencyCode 49 | { 50 | get; 51 | } 52 | 53 | string ToCurrencyName 54 | { 55 | get; 56 | } 57 | 58 | string ExchangeRate 59 | { 60 | get; 61 | } 62 | 63 | string LastRefreshed 64 | { 65 | get; 66 | } 67 | 68 | string TimeZone 69 | { 70 | get; 71 | } 72 | 73 | bool Error 74 | { 75 | get; 76 | } 77 | 78 | string ErrorMessage 79 | { 80 | get; 81 | } 82 | 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Avapi/DEMA/Const_DEMA.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiDEMA 2 | { 3 | public static class Const_DEMA 4 | { 5 | public enum DEMA_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum DEMA_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Avapi/DEMA/Int_DEMA.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiDEMA 4 | { 5 | public interface Int_DEMA 6 | { 7 | IAvapiResponse_DEMA Query( 8 | string symbol, 9 | Const_DEMA.DEMA_interval interval, 10 | int time_period, 11 | Const_DEMA.DEMA_series_type series_type); 12 | 13 | Task QueryAsync( 14 | string symbol, 15 | Const_DEMA.DEMA_interval interval, 16 | int time_period, 17 | Const_DEMA.DEMA_series_type series_type); 18 | 19 | 20 | IAvapiResponse_DEMA QueryPrimitive( 21 | string symbol, 22 | string interval, 23 | int time_period, 24 | string series_type); 25 | 26 | Task QueryPrimitiveAsync( 27 | string symbol, 28 | string interval, 29 | int time_period, 30 | string series_type); 31 | 32 | } 33 | 34 | public interface IAvapiResponse_DEMA 35 | { 36 | string LastHttpRequest 37 | { 38 | get; 39 | } 40 | 41 | string RawData 42 | { 43 | get; 44 | } 45 | 46 | IAvapiResponse_DEMA_Content Data 47 | { 48 | get; 49 | } 50 | } 51 | 52 | public interface IAvapiResponse_DEMA_Content 53 | { 54 | bool Error 55 | { 56 | get; 57 | } 58 | 59 | string ErrorMessage 60 | { 61 | get; 62 | } 63 | 64 | MetaData_Type_DEMA MetaData 65 | { 66 | get; 67 | } 68 | 69 | IList TechnicalIndicator 70 | { 71 | get; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Avapi/DIGITAL_CURRENCY_DAILY/Const_DIGITAL_CURRENCY_DAILY.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiDIGITAL_CURRENCY_DAILY 2 | { 3 | public static class Const_DIGITAL_CURRENCY_DAILY 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Avapi/DIGITAL_CURRENCY_DAILY/Int_DIGITAL_CURRENCY_DAILY.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiDIGITAL_CURRENCY_DAILY 4 | { 5 | public interface Int_DIGITAL_CURRENCY_DAILY 6 | { 7 | 8 | IAvapiResponse_DIGITAL_CURRENCY_DAILY QueryPrimitive( 9 | string symbol, 10 | string market); 11 | 12 | Task QueryPrimitiveAsync( 13 | string symbol, 14 | string market); 15 | 16 | } 17 | 18 | public interface IAvapiResponse_DIGITAL_CURRENCY_DAILY 19 | { 20 | string LastHttpRequest 21 | { 22 | get; 23 | } 24 | 25 | string RawData 26 | { 27 | get; 28 | } 29 | 30 | IAvapiResponse_DIGITAL_CURRENCY_DAILY_Content Data 31 | { 32 | get; 33 | } 34 | } 35 | 36 | public interface IAvapiResponse_DIGITAL_CURRENCY_DAILY_Content 37 | { 38 | bool Error 39 | { 40 | get; 41 | } 42 | 43 | string ErrorMessage 44 | { 45 | get; 46 | } 47 | 48 | MetaData_Type_DIGITAL_CURRENCY_DAILY MetaData 49 | { 50 | get; 51 | } 52 | 53 | IList TimeSeries 54 | { 55 | get; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Avapi/DIGITAL_CURRENCY_INTRADAY/Const_DIGITAL_CURRENCY_INTRADAY.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiDIGITAL_CURRENCY_INTRADAY 2 | { 3 | public static class Const_DIGITAL_CURRENCY_INTRADAY 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Avapi/DIGITAL_CURRENCY_INTRADAY/Int_DIGITAL_CURRENCY_INTRADAY.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiDIGITAL_CURRENCY_INTRADAY 4 | { 5 | public interface Int_DIGITAL_CURRENCY_INTRADAY 6 | { 7 | 8 | IAvapiResponse_DIGITAL_CURRENCY_INTRADAY QueryPrimitive( 9 | string symbol, 10 | string market); 11 | 12 | Task QueryPrimitiveAsync( 13 | string symbol, 14 | string market); 15 | 16 | } 17 | 18 | public interface IAvapiResponse_DIGITAL_CURRENCY_INTRADAY 19 | { 20 | string LastHttpRequest 21 | { 22 | get; 23 | } 24 | 25 | string RawData 26 | { 27 | get; 28 | } 29 | 30 | IAvapiResponse_DIGITAL_CURRENCY_INTRADAY_Content Data 31 | { 32 | get; 33 | } 34 | } 35 | 36 | public interface IAvapiResponse_DIGITAL_CURRENCY_INTRADAY_Content 37 | { 38 | bool Error 39 | { 40 | get; 41 | } 42 | 43 | string ErrorMessage 44 | { 45 | get; 46 | } 47 | 48 | MetaData_Type_DIGITAL_CURRENCY_INTRADAY MetaData 49 | { 50 | get; 51 | } 52 | 53 | IList TimeSeries 54 | { 55 | get; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Avapi/DIGITAL_CURRENCY_MONTHLY/Const_DIGITAL_CURRENCY_MONTHLY.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiDIGITAL_CURRENCY_MONTHLY 2 | { 3 | public static class Const_DIGITAL_CURRENCY_MONTHLY 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Avapi/DIGITAL_CURRENCY_MONTHLY/Int_DIGITAL_CURRENCY_MONTHLY.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiDIGITAL_CURRENCY_MONTHLY 4 | { 5 | public interface Int_DIGITAL_CURRENCY_MONTHLY 6 | { 7 | 8 | IAvapiResponse_DIGITAL_CURRENCY_MONTHLY QueryPrimitive( 9 | string symbol, 10 | string market); 11 | 12 | Task QueryPrimitiveAsync( 13 | string symbol, 14 | string market); 15 | 16 | } 17 | 18 | public interface IAvapiResponse_DIGITAL_CURRENCY_MONTHLY 19 | { 20 | string LastHttpRequest 21 | { 22 | get; 23 | } 24 | 25 | string RawData 26 | { 27 | get; 28 | } 29 | 30 | IAvapiResponse_DIGITAL_CURRENCY_MONTHLY_Content Data 31 | { 32 | get; 33 | } 34 | } 35 | 36 | public interface IAvapiResponse_DIGITAL_CURRENCY_MONTHLY_Content 37 | { 38 | bool Error 39 | { 40 | get; 41 | } 42 | 43 | string ErrorMessage 44 | { 45 | get; 46 | } 47 | 48 | MetaData_Type_DIGITAL_CURRENCY_MONTHLY MetaData 49 | { 50 | get; 51 | } 52 | 53 | IList TimeSeries 54 | { 55 | get; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Avapi/DIGITAL_CURRENCY_WEEKLY/Const_DIGITAL_CURRENCY_WEEKLY.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiDIGITAL_CURRENCY_WEEKLY 2 | { 3 | public static class Const_DIGITAL_CURRENCY_WEEKLY 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Avapi/DIGITAL_CURRENCY_WEEKLY/Int_DIGITAL_CURRENCY_WEEKLY.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiDIGITAL_CURRENCY_WEEKLY 4 | { 5 | public interface Int_DIGITAL_CURRENCY_WEEKLY 6 | { 7 | 8 | IAvapiResponse_DIGITAL_CURRENCY_WEEKLY QueryPrimitive( 9 | string symbol, 10 | string market); 11 | 12 | Task QueryPrimitiveAsync( 13 | string symbol, 14 | string market); 15 | 16 | } 17 | 18 | public interface IAvapiResponse_DIGITAL_CURRENCY_WEEKLY 19 | { 20 | string LastHttpRequest 21 | { 22 | get; 23 | } 24 | 25 | string RawData 26 | { 27 | get; 28 | } 29 | 30 | IAvapiResponse_DIGITAL_CURRENCY_WEEKLY_Content Data 31 | { 32 | get; 33 | } 34 | } 35 | 36 | public interface IAvapiResponse_DIGITAL_CURRENCY_WEEKLY_Content 37 | { 38 | bool Error 39 | { 40 | get; 41 | } 42 | 43 | string ErrorMessage 44 | { 45 | get; 46 | } 47 | 48 | MetaData_Type_DIGITAL_CURRENCY_WEEKLY MetaData 49 | { 50 | get; 51 | } 52 | 53 | IList TimeSeries 54 | { 55 | get; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Avapi/DX/Const_DX.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiDX 2 | { 3 | public static class Const_DX 4 | { 5 | public enum DX_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Avapi/DX/Int_DX.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiDX 4 | { 5 | public interface Int_DX 6 | { 7 | IAvapiResponse_DX Query( 8 | string symbol, 9 | Const_DX.DX_interval interval, 10 | int time_period); 11 | 12 | Task QueryAsync( 13 | string symbol, 14 | Const_DX.DX_interval interval, 15 | int time_period); 16 | 17 | 18 | IAvapiResponse_DX QueryPrimitive( 19 | string symbol, 20 | string interval, 21 | int time_period); 22 | 23 | Task QueryPrimitiveAsync( 24 | string symbol, 25 | string interval, 26 | int time_period); 27 | 28 | } 29 | 30 | public interface IAvapiResponse_DX 31 | { 32 | string LastHttpRequest 33 | { 34 | get; 35 | } 36 | 37 | string RawData 38 | { 39 | get; 40 | } 41 | 42 | IAvapiResponse_DX_Content Data 43 | { 44 | get; 45 | } 46 | } 47 | 48 | public interface IAvapiResponse_DX_Content 49 | { 50 | bool Error 51 | { 52 | get; 53 | } 54 | 55 | string ErrorMessage 56 | { 57 | get; 58 | } 59 | 60 | MetaData_Type_DX MetaData 61 | { 62 | get; 63 | } 64 | 65 | IList TechnicalIndicator 66 | { 67 | get; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Avapi/EMA/Const_EMA.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiEMA 2 | { 3 | public static class Const_EMA 4 | { 5 | public enum EMA_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum EMA_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Avapi/EMA/Int_EMA.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiEMA 4 | { 5 | public interface Int_EMA 6 | { 7 | IAvapiResponse_EMA Query( 8 | string symbol, 9 | Const_EMA.EMA_interval interval, 10 | int time_period, 11 | Const_EMA.EMA_series_type series_type); 12 | 13 | Task QueryAsync( 14 | string symbol, 15 | Const_EMA.EMA_interval interval, 16 | int time_period, 17 | Const_EMA.EMA_series_type series_type); 18 | 19 | 20 | IAvapiResponse_EMA QueryPrimitive( 21 | string symbol, 22 | string interval, 23 | int time_period, 24 | string series_type); 25 | 26 | Task QueryPrimitiveAsync( 27 | string symbol, 28 | string interval, 29 | int time_period, 30 | string series_type); 31 | 32 | } 33 | 34 | public interface IAvapiResponse_EMA 35 | { 36 | string LastHttpRequest 37 | { 38 | get; 39 | } 40 | 41 | string RawData 42 | { 43 | get; 44 | } 45 | 46 | IAvapiResponse_EMA_Content Data 47 | { 48 | get; 49 | } 50 | } 51 | 52 | public interface IAvapiResponse_EMA_Content 53 | { 54 | bool Error 55 | { 56 | get; 57 | } 58 | 59 | string ErrorMessage 60 | { 61 | get; 62 | } 63 | 64 | MetaData_Type_EMA MetaData 65 | { 66 | get; 67 | } 68 | 69 | IList TechnicalIndicator 70 | { 71 | get; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Avapi/HT_DCPERIOD/Const_HT_DCPERIOD.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiHT_DCPERIOD 2 | { 3 | public static class Const_HT_DCPERIOD 4 | { 5 | public enum HT_DCPERIOD_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum HT_DCPERIOD_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Avapi/HT_DCPERIOD/Int_HT_DCPERIOD.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiHT_DCPERIOD 4 | { 5 | public interface Int_HT_DCPERIOD 6 | { 7 | IAvapiResponse_HT_DCPERIOD Query( 8 | string symbol, 9 | Const_HT_DCPERIOD.HT_DCPERIOD_interval interval, 10 | Const_HT_DCPERIOD.HT_DCPERIOD_series_type series_type); 11 | 12 | Task QueryAsync( 13 | string symbol, 14 | Const_HT_DCPERIOD.HT_DCPERIOD_interval interval, 15 | Const_HT_DCPERIOD.HT_DCPERIOD_series_type series_type); 16 | 17 | 18 | IAvapiResponse_HT_DCPERIOD QueryPrimitive( 19 | string symbol, 20 | string interval, 21 | string series_type); 22 | 23 | Task QueryPrimitiveAsync( 24 | string symbol, 25 | string interval, 26 | string series_type); 27 | 28 | } 29 | 30 | public interface IAvapiResponse_HT_DCPERIOD 31 | { 32 | string LastHttpRequest 33 | { 34 | get; 35 | } 36 | 37 | string RawData 38 | { 39 | get; 40 | } 41 | 42 | IAvapiResponse_HT_DCPERIOD_Content Data 43 | { 44 | get; 45 | } 46 | } 47 | 48 | public interface IAvapiResponse_HT_DCPERIOD_Content 49 | { 50 | bool Error 51 | { 52 | get; 53 | } 54 | 55 | string ErrorMessage 56 | { 57 | get; 58 | } 59 | 60 | MetaData_Type_HT_DCPERIOD MetaData 61 | { 62 | get; 63 | } 64 | 65 | IList TechnicalIndicator 66 | { 67 | get; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Avapi/HT_DCPHASE/Const_HT_DCPHASE.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiHT_DCPHASE 2 | { 3 | public static class Const_HT_DCPHASE 4 | { 5 | public enum HT_DCPHASE_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum HT_DCPHASE_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Avapi/HT_DCPHASE/Int_HT_DCPHASE.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiHT_DCPHASE 4 | { 5 | public interface Int_HT_DCPHASE 6 | { 7 | IAvapiResponse_HT_DCPHASE Query( 8 | string symbol, 9 | Const_HT_DCPHASE.HT_DCPHASE_interval interval, 10 | Const_HT_DCPHASE.HT_DCPHASE_series_type series_type); 11 | 12 | Task QueryAsync( 13 | string symbol, 14 | Const_HT_DCPHASE.HT_DCPHASE_interval interval, 15 | Const_HT_DCPHASE.HT_DCPHASE_series_type series_type); 16 | 17 | 18 | IAvapiResponse_HT_DCPHASE QueryPrimitive( 19 | string symbol, 20 | string interval, 21 | string series_type); 22 | 23 | Task QueryPrimitiveAsync( 24 | string symbol, 25 | string interval, 26 | string series_type); 27 | 28 | } 29 | 30 | public interface IAvapiResponse_HT_DCPHASE 31 | { 32 | string LastHttpRequest 33 | { 34 | get; 35 | } 36 | 37 | string RawData 38 | { 39 | get; 40 | } 41 | 42 | IAvapiResponse_HT_DCPHASE_Content Data 43 | { 44 | get; 45 | } 46 | } 47 | 48 | public interface IAvapiResponse_HT_DCPHASE_Content 49 | { 50 | bool Error 51 | { 52 | get; 53 | } 54 | 55 | string ErrorMessage 56 | { 57 | get; 58 | } 59 | 60 | MetaData_Type_HT_DCPHASE MetaData 61 | { 62 | get; 63 | } 64 | 65 | IList TechnicalIndicator 66 | { 67 | get; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Avapi/HT_PHASOR/Const_HT_PHASOR.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiHT_PHASOR 2 | { 3 | public static class Const_HT_PHASOR 4 | { 5 | public enum HT_PHASOR_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum HT_PHASOR_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Avapi/HT_PHASOR/Int_HT_PHASOR.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiHT_PHASOR 4 | { 5 | public interface Int_HT_PHASOR 6 | { 7 | IAvapiResponse_HT_PHASOR Query( 8 | string symbol, 9 | Const_HT_PHASOR.HT_PHASOR_interval interval, 10 | Const_HT_PHASOR.HT_PHASOR_series_type series_type); 11 | 12 | Task QueryAsync( 13 | string symbol, 14 | Const_HT_PHASOR.HT_PHASOR_interval interval, 15 | Const_HT_PHASOR.HT_PHASOR_series_type series_type); 16 | 17 | 18 | IAvapiResponse_HT_PHASOR QueryPrimitive( 19 | string symbol, 20 | string interval, 21 | string series_type); 22 | 23 | Task QueryPrimitiveAsync( 24 | string symbol, 25 | string interval, 26 | string series_type); 27 | 28 | } 29 | 30 | public interface IAvapiResponse_HT_PHASOR 31 | { 32 | string LastHttpRequest 33 | { 34 | get; 35 | } 36 | 37 | string RawData 38 | { 39 | get; 40 | } 41 | 42 | IAvapiResponse_HT_PHASOR_Content Data 43 | { 44 | get; 45 | } 46 | } 47 | 48 | public interface IAvapiResponse_HT_PHASOR_Content 49 | { 50 | bool Error 51 | { 52 | get; 53 | } 54 | 55 | string ErrorMessage 56 | { 57 | get; 58 | } 59 | 60 | MetaData_Type_HT_PHASOR MetaData 61 | { 62 | get; 63 | } 64 | 65 | IList TechnicalIndicator 66 | { 67 | get; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Avapi/HT_SINE/Const_HT_SINE.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiHT_SINE 2 | { 3 | public static class Const_HT_SINE 4 | { 5 | public enum HT_SINE_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum HT_SINE_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Avapi/HT_SINE/Int_HT_SINE.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiHT_SINE 4 | { 5 | public interface Int_HT_SINE 6 | { 7 | IAvapiResponse_HT_SINE Query( 8 | string symbol, 9 | Const_HT_SINE.HT_SINE_interval interval, 10 | Const_HT_SINE.HT_SINE_series_type series_type); 11 | 12 | Task QueryAsync( 13 | string symbol, 14 | Const_HT_SINE.HT_SINE_interval interval, 15 | Const_HT_SINE.HT_SINE_series_type series_type); 16 | 17 | 18 | IAvapiResponse_HT_SINE QueryPrimitive( 19 | string symbol, 20 | string interval, 21 | string series_type); 22 | 23 | Task QueryPrimitiveAsync( 24 | string symbol, 25 | string interval, 26 | string series_type); 27 | 28 | } 29 | 30 | public interface IAvapiResponse_HT_SINE 31 | { 32 | string LastHttpRequest 33 | { 34 | get; 35 | } 36 | 37 | string RawData 38 | { 39 | get; 40 | } 41 | 42 | IAvapiResponse_HT_SINE_Content Data 43 | { 44 | get; 45 | } 46 | } 47 | 48 | public interface IAvapiResponse_HT_SINE_Content 49 | { 50 | bool Error 51 | { 52 | get; 53 | } 54 | 55 | string ErrorMessage 56 | { 57 | get; 58 | } 59 | 60 | MetaData_Type_HT_SINE MetaData 61 | { 62 | get; 63 | } 64 | 65 | IList TechnicalIndicator 66 | { 67 | get; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Avapi/HT_TRENDLINE/Const_HT_TRENDLINE.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiHT_TRENDLINE 2 | { 3 | public static class Const_HT_TRENDLINE 4 | { 5 | public enum HT_TRENDLINE_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum HT_TRENDLINE_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Avapi/HT_TRENDLINE/Int_HT_TRENDLINE.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiHT_TRENDLINE 4 | { 5 | public interface Int_HT_TRENDLINE 6 | { 7 | IAvapiResponse_HT_TRENDLINE Query( 8 | string symbol, 9 | Const_HT_TRENDLINE.HT_TRENDLINE_interval interval, 10 | Const_HT_TRENDLINE.HT_TRENDLINE_series_type series_type); 11 | 12 | Task QueryAsync( 13 | string symbol, 14 | Const_HT_TRENDLINE.HT_TRENDLINE_interval interval, 15 | Const_HT_TRENDLINE.HT_TRENDLINE_series_type series_type); 16 | 17 | 18 | IAvapiResponse_HT_TRENDLINE QueryPrimitive( 19 | string symbol, 20 | string interval, 21 | string series_type); 22 | 23 | Task QueryPrimitiveAsync( 24 | string symbol, 25 | string interval, 26 | string series_type); 27 | 28 | } 29 | 30 | public interface IAvapiResponse_HT_TRENDLINE 31 | { 32 | string LastHttpRequest 33 | { 34 | get; 35 | } 36 | 37 | string RawData 38 | { 39 | get; 40 | } 41 | 42 | IAvapiResponse_HT_TRENDLINE_Content Data 43 | { 44 | get; 45 | } 46 | } 47 | 48 | public interface IAvapiResponse_HT_TRENDLINE_Content 49 | { 50 | bool Error 51 | { 52 | get; 53 | } 54 | 55 | string ErrorMessage 56 | { 57 | get; 58 | } 59 | 60 | MetaData_Type_HT_TRENDLINE MetaData 61 | { 62 | get; 63 | } 64 | 65 | IList TechnicalIndicator 66 | { 67 | get; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Avapi/HT_TRENDMODE/Const_HT_TRENDMODE.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiHT_TRENDMODE 2 | { 3 | public static class Const_HT_TRENDMODE 4 | { 5 | public enum HT_TRENDMODE_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum HT_TRENDMODE_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Avapi/HT_TRENDMODE/Int_HT_TRENDMODE.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiHT_TRENDMODE 4 | { 5 | public interface Int_HT_TRENDMODE 6 | { 7 | IAvapiResponse_HT_TRENDMODE Query( 8 | string symbol, 9 | Const_HT_TRENDMODE.HT_TRENDMODE_interval interval, 10 | Const_HT_TRENDMODE.HT_TRENDMODE_series_type series_type); 11 | 12 | Task QueryAsync( 13 | string symbol, 14 | Const_HT_TRENDMODE.HT_TRENDMODE_interval interval, 15 | Const_HT_TRENDMODE.HT_TRENDMODE_series_type series_type); 16 | 17 | 18 | IAvapiResponse_HT_TRENDMODE QueryPrimitive( 19 | string symbol, 20 | string interval, 21 | string series_type); 22 | 23 | Task QueryPrimitiveAsync( 24 | string symbol, 25 | string interval, 26 | string series_type); 27 | 28 | } 29 | 30 | public interface IAvapiResponse_HT_TRENDMODE 31 | { 32 | string LastHttpRequest 33 | { 34 | get; 35 | } 36 | 37 | string RawData 38 | { 39 | get; 40 | } 41 | 42 | IAvapiResponse_HT_TRENDMODE_Content Data 43 | { 44 | get; 45 | } 46 | } 47 | 48 | public interface IAvapiResponse_HT_TRENDMODE_Content 49 | { 50 | bool Error 51 | { 52 | get; 53 | } 54 | 55 | string ErrorMessage 56 | { 57 | get; 58 | } 59 | 60 | MetaData_Type_HT_TRENDMODE MetaData 61 | { 62 | get; 63 | } 64 | 65 | IList TechnicalIndicator 66 | { 67 | get; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Avapi/IAvapiConnection.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi 2 | { 3 | public interface IAvapiConnection 4 | { 5 | void Connect(string apiKey); 6 | string AvapiUrl { get; set; } 7 | string AvapiUrlDefault { get; } 8 | string ApiKey { get; set; } 9 | AvapiTIME_SERIES_INTRADAY.Int_TIME_SERIES_INTRADAY GetQueryObject_TIME_SERIES_INTRADAY(); 10 | AvapiTIME_SERIES_DAILY.Int_TIME_SERIES_DAILY GetQueryObject_TIME_SERIES_DAILY(); 11 | AvapiTIME_SERIES_DAILY_ADJUSTED.Int_TIME_SERIES_DAILY_ADJUSTED GetQueryObject_TIME_SERIES_DAILY_ADJUSTED(); 12 | AvapiTIME_SERIES_WEEKLY.Int_TIME_SERIES_WEEKLY GetQueryObject_TIME_SERIES_WEEKLY(); 13 | AvapiTIME_SERIES_WEEKLY_ADJUSTED.Int_TIME_SERIES_WEEKLY_ADJUSTED GetQueryObject_TIME_SERIES_WEEKLY_ADJUSTED(); 14 | AvapiTIME_SERIES_MONTHLY.Int_TIME_SERIES_MONTHLY GetQueryObject_TIME_SERIES_MONTHLY(); 15 | AvapiBATCH_STOCK_QUOTES.Int_BATCH_STOCK_QUOTES GetQueryObject_BATCH_STOCK_QUOTES(); 16 | AvapiTIME_SERIES_MONTHLY_ADJUSTED.Int_TIME_SERIES_MONTHLY_ADJUSTED GetQueryObject_TIME_SERIES_MONTHLY_ADJUSTED(); 17 | AvapiSMA.Int_SMA GetQueryObject_SMA(); 18 | AvapiEMA.Int_EMA GetQueryObject_EMA(); 19 | AvapiWMA.Int_WMA GetQueryObject_WMA(); 20 | AvapiDEMA.Int_DEMA GetQueryObject_DEMA(); 21 | AvapiTEMA.Int_TEMA GetQueryObject_TEMA(); 22 | AvapiTRIMA.Int_TRIMA GetQueryObject_TRIMA(); 23 | AvapiKAMA.Int_KAMA GetQueryObject_KAMA(); 24 | AvapiMAMA.Int_MAMA GetQueryObject_MAMA(); 25 | AvapiT3.Int_T3 GetQueryObject_T3(); 26 | AvapiMACD.Int_MACD GetQueryObject_MACD(); 27 | AvapiMACDEXT.Int_MACDEXT GetQueryObject_MACDEXT(); 28 | AvapiSTOCH.Int_STOCH GetQueryObject_STOCH(); 29 | AvapiSTOCHF.Int_STOCHF GetQueryObject_STOCHF(); 30 | AvapiRSI.Int_RSI GetQueryObject_RSI(); 31 | AvapiSTOCHRSI.Int_STOCHRSI GetQueryObject_STOCHRSI(); 32 | AvapiWILLR.Int_WILLR GetQueryObject_WILLR(); 33 | AvapiADX.Int_ADX GetQueryObject_ADX(); 34 | AvapiADXR.Int_ADXR GetQueryObject_ADXR(); 35 | AvapiAPO.Int_APO GetQueryObject_APO(); 36 | AvapiPPO.Int_PPO GetQueryObject_PPO(); 37 | AvapiMOM.Int_MOM GetQueryObject_MOM(); 38 | AvapiBOP.Int_BOP GetQueryObject_BOP(); 39 | AvapiCCI.Int_CCI GetQueryObject_CCI(); 40 | AvapiCMO.Int_CMO GetQueryObject_CMO(); 41 | AvapiROC.Int_ROC GetQueryObject_ROC(); 42 | AvapiROCR.Int_ROCR GetQueryObject_ROCR(); 43 | AvapiAROON.Int_AROON GetQueryObject_AROON(); 44 | AvapiAROONOSC.Int_AROONOSC GetQueryObject_AROONOSC(); 45 | AvapiMFI.Int_MFI GetQueryObject_MFI(); 46 | AvapiTRIX.Int_TRIX GetQueryObject_TRIX(); 47 | AvapiULTOSC.Int_ULTOSC GetQueryObject_ULTOSC(); 48 | AvapiDX.Int_DX GetQueryObject_DX(); 49 | AvapiMINUS_DI.Int_MINUS_DI GetQueryObject_MINUS_DI(); 50 | AvapiPLUS_DI.Int_PLUS_DI GetQueryObject_PLUS_DI(); 51 | AvapiMINUS_DM.Int_MINUS_DM GetQueryObject_MINUS_DM(); 52 | AvapiPLUS_DM.Int_PLUS_DM GetQueryObject_PLUS_DM(); 53 | AvapiBBANDS.Int_BBANDS GetQueryObject_BBANDS(); 54 | AvapiMIDPOINT.Int_MIDPOINT GetQueryObject_MIDPOINT(); 55 | AvapiMIDPRICE.Int_MIDPRICE GetQueryObject_MIDPRICE(); 56 | AvapiSAR.Int_SAR GetQueryObject_SAR(); 57 | AvapiTRANGE.Int_TRANGE GetQueryObject_TRANGE(); 58 | AvapiATR.Int_ATR GetQueryObject_ATR(); 59 | AvapiNATR.Int_NATR GetQueryObject_NATR(); 60 | AvapiAD.Int_AD GetQueryObject_AD(); 61 | AvapiADOSC.Int_ADOSC GetQueryObject_ADOSC(); 62 | AvapiOBV.Int_OBV GetQueryObject_OBV(); 63 | AvapiHT_TRENDLINE.Int_HT_TRENDLINE GetQueryObject_HT_TRENDLINE(); 64 | AvapiHT_SINE.Int_HT_SINE GetQueryObject_HT_SINE(); 65 | AvapiHT_TRENDMODE.Int_HT_TRENDMODE GetQueryObject_HT_TRENDMODE(); 66 | AvapiHT_DCPERIOD.Int_HT_DCPERIOD GetQueryObject_HT_DCPERIOD(); 67 | AvapiHT_DCPHASE.Int_HT_DCPHASE GetQueryObject_HT_DCPHASE(); 68 | AvapiHT_PHASOR.Int_HT_PHASOR GetQueryObject_HT_PHASOR(); 69 | AvapiSECTOR.Int_SECTOR GetQueryObject_SECTOR(); 70 | AvapiCURRENCY_EXCHANGE_RATE.Int_CURRENCY_EXCHANGE_RATE GetQueryObject_CURRENCY_EXCHANGE_RATE(); 71 | AvapiDIGITAL_CURRENCY_INTRADAY.Int_DIGITAL_CURRENCY_INTRADAY GetQueryObject_DIGITAL_CURRENCY_INTRADAY(); 72 | AvapiDIGITAL_CURRENCY_DAILY.Int_DIGITAL_CURRENCY_DAILY GetQueryObject_DIGITAL_CURRENCY_DAILY(); 73 | AvapiDIGITAL_CURRENCY_WEEKLY.Int_DIGITAL_CURRENCY_WEEKLY GetQueryObject_DIGITAL_CURRENCY_WEEKLY(); 74 | AvapiDIGITAL_CURRENCY_MONTHLY.Int_DIGITAL_CURRENCY_MONTHLY GetQueryObject_DIGITAL_CURRENCY_MONTHLY(); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Avapi/KAMA/Const_KAMA.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiKAMA 2 | { 3 | public static class Const_KAMA 4 | { 5 | public enum KAMA_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum KAMA_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Avapi/KAMA/Int_KAMA.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiKAMA 4 | { 5 | public interface Int_KAMA 6 | { 7 | IAvapiResponse_KAMA Query( 8 | string symbol, 9 | Const_KAMA.KAMA_interval interval, 10 | int time_period, 11 | Const_KAMA.KAMA_series_type series_type); 12 | 13 | Task QueryAsync( 14 | string symbol, 15 | Const_KAMA.KAMA_interval interval, 16 | int time_period, 17 | Const_KAMA.KAMA_series_type series_type); 18 | 19 | 20 | IAvapiResponse_KAMA QueryPrimitive( 21 | string symbol, 22 | string interval, 23 | int time_period, 24 | string series_type); 25 | 26 | Task QueryPrimitiveAsync( 27 | string symbol, 28 | string interval, 29 | int time_period, 30 | string series_type); 31 | 32 | } 33 | 34 | public interface IAvapiResponse_KAMA 35 | { 36 | string LastHttpRequest 37 | { 38 | get; 39 | } 40 | 41 | string RawData 42 | { 43 | get; 44 | } 45 | 46 | IAvapiResponse_KAMA_Content Data 47 | { 48 | get; 49 | } 50 | } 51 | 52 | public interface IAvapiResponse_KAMA_Content 53 | { 54 | bool Error 55 | { 56 | get; 57 | } 58 | 59 | string ErrorMessage 60 | { 61 | get; 62 | } 63 | 64 | MetaData_Type_KAMA MetaData 65 | { 66 | get; 67 | } 68 | 69 | IList TechnicalIndicator 70 | { 71 | get; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Avapi/MACD/Const_MACD.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiMACD 2 | { 3 | public static class Const_MACD 4 | { 5 | public enum MACD_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum MACD_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Avapi/MACD/Int_MACD.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiMACD 4 | { 5 | public interface Int_MACD 6 | { 7 | IAvapiResponse_MACD Query( 8 | string symbol, 9 | Const_MACD.MACD_interval interval, 10 | Const_MACD.MACD_series_type series_type, 11 | int fastperiod = -1, 12 | int slowperiod = -1, 13 | int signalperiod = -1); 14 | 15 | Task QueryAsync( 16 | string symbol, 17 | Const_MACD.MACD_interval interval, 18 | Const_MACD.MACD_series_type series_type, 19 | int fastperiod = -1, 20 | int slowperiod = -1, 21 | int signalperiod = -1); 22 | 23 | 24 | IAvapiResponse_MACD QueryPrimitive( 25 | string symbol, 26 | string interval, 27 | string series_type, 28 | int fastperiod = -1, 29 | int slowperiod = -1, 30 | int signalperiod = -1); 31 | 32 | Task QueryPrimitiveAsync( 33 | string symbol, 34 | string interval, 35 | string series_type, 36 | int fastperiod = -1, 37 | int slowperiod = -1, 38 | int signalperiod = -1); 39 | 40 | } 41 | 42 | public interface IAvapiResponse_MACD 43 | { 44 | string LastHttpRequest 45 | { 46 | get; 47 | } 48 | 49 | string RawData 50 | { 51 | get; 52 | } 53 | 54 | IAvapiResponse_MACD_Content Data 55 | { 56 | get; 57 | } 58 | } 59 | 60 | public interface IAvapiResponse_MACD_Content 61 | { 62 | bool Error 63 | { 64 | get; 65 | } 66 | 67 | string ErrorMessage 68 | { 69 | get; 70 | } 71 | 72 | MetaData_Type_MACD MetaData 73 | { 74 | get; 75 | } 76 | 77 | IList TechnicalIndicator 78 | { 79 | get; 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /Avapi/MACDEXT/Const_MACDEXT.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiMACDEXT 2 | { 3 | public static class Const_MACDEXT 4 | { 5 | public enum MACDEXT_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum MACDEXT_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | public enum MACDEXT_fastmatype 26 | {none, 27 | n_0, 28 | n_1, 29 | n_2, 30 | n_3, 31 | n_4, 32 | n_5, 33 | n_6, 34 | n_7, 35 | n_8 36 | } 37 | public enum MACDEXT_slowmatype 38 | {none, 39 | n_0, 40 | n_1, 41 | n_2, 42 | n_3, 43 | n_4, 44 | n_5, 45 | n_6, 46 | n_7, 47 | n_8 48 | } 49 | public enum MACDEXT_signalmatype 50 | {none, 51 | n_0, 52 | n_1, 53 | n_2, 54 | n_3, 55 | n_4, 56 | n_5, 57 | n_6, 58 | n_7, 59 | n_8 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Avapi/MACDEXT/Int_MACDEXT.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiMACDEXT 4 | { 5 | public interface Int_MACDEXT 6 | { 7 | IAvapiResponse_MACDEXT Query( 8 | string symbol, 9 | Const_MACDEXT.MACDEXT_interval interval, 10 | Const_MACDEXT.MACDEXT_series_type series_type, 11 | int fastperiod = -1, 12 | int slowperiod = -1, 13 | int signalperiod = -1, 14 | Const_MACDEXT.MACDEXT_fastmatype fastmatype = Const_MACDEXT.MACDEXT_fastmatype.none, 15 | Const_MACDEXT.MACDEXT_slowmatype slowmatype = Const_MACDEXT.MACDEXT_slowmatype.none, 16 | Const_MACDEXT.MACDEXT_signalmatype signalmatype = Const_MACDEXT.MACDEXT_signalmatype.none); 17 | 18 | Task QueryAsync( 19 | string symbol, 20 | Const_MACDEXT.MACDEXT_interval interval, 21 | Const_MACDEXT.MACDEXT_series_type series_type, 22 | int fastperiod = -1, 23 | int slowperiod = -1, 24 | int signalperiod = -1, 25 | Const_MACDEXT.MACDEXT_fastmatype fastmatype = Const_MACDEXT.MACDEXT_fastmatype.none, 26 | Const_MACDEXT.MACDEXT_slowmatype slowmatype = Const_MACDEXT.MACDEXT_slowmatype.none, 27 | Const_MACDEXT.MACDEXT_signalmatype signalmatype = Const_MACDEXT.MACDEXT_signalmatype.none); 28 | 29 | 30 | IAvapiResponse_MACDEXT QueryPrimitive( 31 | string symbol, 32 | string interval, 33 | string series_type, 34 | int fastperiod = -1, 35 | int slowperiod = -1, 36 | int signalperiod = -1, 37 | int fastmatype = -1, 38 | int slowmatype = -1, 39 | int signalmatype = -1); 40 | 41 | Task QueryPrimitiveAsync( 42 | string symbol, 43 | string interval, 44 | string series_type, 45 | int fastperiod = -1, 46 | int slowperiod = -1, 47 | int signalperiod = -1, 48 | int fastmatype = -1, 49 | int slowmatype = -1, 50 | int signalmatype = -1); 51 | 52 | } 53 | 54 | public interface IAvapiResponse_MACDEXT 55 | { 56 | string LastHttpRequest 57 | { 58 | get; 59 | } 60 | 61 | string RawData 62 | { 63 | get; 64 | } 65 | 66 | IAvapiResponse_MACDEXT_Content Data 67 | { 68 | get; 69 | } 70 | } 71 | 72 | public interface IAvapiResponse_MACDEXT_Content 73 | { 74 | bool Error 75 | { 76 | get; 77 | } 78 | 79 | string ErrorMessage 80 | { 81 | get; 82 | } 83 | 84 | MetaData_Type_MACDEXT MetaData 85 | { 86 | get; 87 | } 88 | 89 | IList TechnicalIndicator 90 | { 91 | get; 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /Avapi/MAMA/Const_MAMA.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiMAMA 2 | { 3 | public static class Const_MAMA 4 | { 5 | public enum MAMA_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum MAMA_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Avapi/MAMA/Int_MAMA.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiMAMA 4 | { 5 | public interface Int_MAMA 6 | { 7 | IAvapiResponse_MAMA Query( 8 | string symbol, 9 | Const_MAMA.MAMA_interval interval, 10 | Const_MAMA.MAMA_series_type series_type, 11 | float fastlimit = -1, 12 | float slowlimit = -1); 13 | 14 | Task QueryAsync( 15 | string symbol, 16 | Const_MAMA.MAMA_interval interval, 17 | Const_MAMA.MAMA_series_type series_type, 18 | float fastlimit = -1, 19 | float slowlimit = -1); 20 | 21 | 22 | IAvapiResponse_MAMA QueryPrimitive( 23 | string symbol, 24 | string interval, 25 | string series_type, 26 | float fastlimit = -1, 27 | float slowlimit = -1); 28 | 29 | Task QueryPrimitiveAsync( 30 | string symbol, 31 | string interval, 32 | string series_type, 33 | float fastlimit = -1, 34 | float slowlimit = -1); 35 | 36 | } 37 | 38 | public interface IAvapiResponse_MAMA 39 | { 40 | string LastHttpRequest 41 | { 42 | get; 43 | } 44 | 45 | string RawData 46 | { 47 | get; 48 | } 49 | 50 | IAvapiResponse_MAMA_Content Data 51 | { 52 | get; 53 | } 54 | } 55 | 56 | public interface IAvapiResponse_MAMA_Content 57 | { 58 | bool Error 59 | { 60 | get; 61 | } 62 | 63 | string ErrorMessage 64 | { 65 | get; 66 | } 67 | 68 | MetaData_Type_MAMA MetaData 69 | { 70 | get; 71 | } 72 | 73 | IList TechnicalIndicator 74 | { 75 | get; 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Avapi/MFI/Const_MFI.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiMFI 2 | { 3 | public static class Const_MFI 4 | { 5 | public enum MFI_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Avapi/MFI/Int_MFI.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiMFI 4 | { 5 | public interface Int_MFI 6 | { 7 | IAvapiResponse_MFI Query( 8 | string symbol, 9 | Const_MFI.MFI_interval interval, 10 | int time_period); 11 | 12 | Task QueryAsync( 13 | string symbol, 14 | Const_MFI.MFI_interval interval, 15 | int time_period); 16 | 17 | 18 | IAvapiResponse_MFI QueryPrimitive( 19 | string symbol, 20 | string interval, 21 | int time_period); 22 | 23 | Task QueryPrimitiveAsync( 24 | string symbol, 25 | string interval, 26 | int time_period); 27 | 28 | } 29 | 30 | public interface IAvapiResponse_MFI 31 | { 32 | string LastHttpRequest 33 | { 34 | get; 35 | } 36 | 37 | string RawData 38 | { 39 | get; 40 | } 41 | 42 | IAvapiResponse_MFI_Content Data 43 | { 44 | get; 45 | } 46 | } 47 | 48 | public interface IAvapiResponse_MFI_Content 49 | { 50 | bool Error 51 | { 52 | get; 53 | } 54 | 55 | string ErrorMessage 56 | { 57 | get; 58 | } 59 | 60 | MetaData_Type_MFI MetaData 61 | { 62 | get; 63 | } 64 | 65 | IList TechnicalIndicator 66 | { 67 | get; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Avapi/MIDPOINT/Const_MIDPOINT.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiMIDPOINT 2 | { 3 | public static class Const_MIDPOINT 4 | { 5 | public enum MIDPOINT_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum MIDPOINT_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Avapi/MIDPOINT/Int_MIDPOINT.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiMIDPOINT 4 | { 5 | public interface Int_MIDPOINT 6 | { 7 | IAvapiResponse_MIDPOINT Query( 8 | string symbol, 9 | Const_MIDPOINT.MIDPOINT_interval interval, 10 | int time_period, 11 | Const_MIDPOINT.MIDPOINT_series_type series_type); 12 | 13 | Task QueryAsync( 14 | string symbol, 15 | Const_MIDPOINT.MIDPOINT_interval interval, 16 | int time_period, 17 | Const_MIDPOINT.MIDPOINT_series_type series_type); 18 | 19 | 20 | IAvapiResponse_MIDPOINT QueryPrimitive( 21 | string symbol, 22 | string interval, 23 | int time_period, 24 | string series_type); 25 | 26 | Task QueryPrimitiveAsync( 27 | string symbol, 28 | string interval, 29 | int time_period, 30 | string series_type); 31 | 32 | } 33 | 34 | public interface IAvapiResponse_MIDPOINT 35 | { 36 | string LastHttpRequest 37 | { 38 | get; 39 | } 40 | 41 | string RawData 42 | { 43 | get; 44 | } 45 | 46 | IAvapiResponse_MIDPOINT_Content Data 47 | { 48 | get; 49 | } 50 | } 51 | 52 | public interface IAvapiResponse_MIDPOINT_Content 53 | { 54 | bool Error 55 | { 56 | get; 57 | } 58 | 59 | string ErrorMessage 60 | { 61 | get; 62 | } 63 | 64 | MetaData_Type_MIDPOINT MetaData 65 | { 66 | get; 67 | } 68 | 69 | IList TechnicalIndicator 70 | { 71 | get; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Avapi/MIDPRICE/Const_MIDPRICE.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiMIDPRICE 2 | { 3 | public static class Const_MIDPRICE 4 | { 5 | public enum MIDPRICE_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Avapi/MIDPRICE/Int_MIDPRICE.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiMIDPRICE 4 | { 5 | public interface Int_MIDPRICE 6 | { 7 | IAvapiResponse_MIDPRICE Query( 8 | string symbol, 9 | Const_MIDPRICE.MIDPRICE_interval interval, 10 | int time_period); 11 | 12 | Task QueryAsync( 13 | string symbol, 14 | Const_MIDPRICE.MIDPRICE_interval interval, 15 | int time_period); 16 | 17 | 18 | IAvapiResponse_MIDPRICE QueryPrimitive( 19 | string symbol, 20 | string interval, 21 | int time_period); 22 | 23 | Task QueryPrimitiveAsync( 24 | string symbol, 25 | string interval, 26 | int time_period); 27 | 28 | } 29 | 30 | public interface IAvapiResponse_MIDPRICE 31 | { 32 | string LastHttpRequest 33 | { 34 | get; 35 | } 36 | 37 | string RawData 38 | { 39 | get; 40 | } 41 | 42 | IAvapiResponse_MIDPRICE_Content Data 43 | { 44 | get; 45 | } 46 | } 47 | 48 | public interface IAvapiResponse_MIDPRICE_Content 49 | { 50 | bool Error 51 | { 52 | get; 53 | } 54 | 55 | string ErrorMessage 56 | { 57 | get; 58 | } 59 | 60 | MetaData_Type_MIDPRICE MetaData 61 | { 62 | get; 63 | } 64 | 65 | IList TechnicalIndicator 66 | { 67 | get; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Avapi/MINUS_DI/Const_MINUS_DI.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiMINUS_DI 2 | { 3 | public static class Const_MINUS_DI 4 | { 5 | public enum MINUS_DI_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Avapi/MINUS_DI/Int_MINUS_DI.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiMINUS_DI 4 | { 5 | public interface Int_MINUS_DI 6 | { 7 | IAvapiResponse_MINUS_DI Query( 8 | string symbol, 9 | Const_MINUS_DI.MINUS_DI_interval interval, 10 | int time_period); 11 | 12 | Task QueryAsync( 13 | string symbol, 14 | Const_MINUS_DI.MINUS_DI_interval interval, 15 | int time_period); 16 | 17 | 18 | IAvapiResponse_MINUS_DI QueryPrimitive( 19 | string symbol, 20 | string interval, 21 | int time_period); 22 | 23 | Task QueryPrimitiveAsync( 24 | string symbol, 25 | string interval, 26 | int time_period); 27 | 28 | } 29 | 30 | public interface IAvapiResponse_MINUS_DI 31 | { 32 | string LastHttpRequest 33 | { 34 | get; 35 | } 36 | 37 | string RawData 38 | { 39 | get; 40 | } 41 | 42 | IAvapiResponse_MINUS_DI_Content Data 43 | { 44 | get; 45 | } 46 | } 47 | 48 | public interface IAvapiResponse_MINUS_DI_Content 49 | { 50 | bool Error 51 | { 52 | get; 53 | } 54 | 55 | string ErrorMessage 56 | { 57 | get; 58 | } 59 | 60 | MetaData_Type_MINUS_DI MetaData 61 | { 62 | get; 63 | } 64 | 65 | IList TechnicalIndicator 66 | { 67 | get; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Avapi/MINUS_DM/Const_MINUS_DM.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiMINUS_DM 2 | { 3 | public static class Const_MINUS_DM 4 | { 5 | public enum MINUS_DM_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Avapi/MINUS_DM/Int_MINUS_DM.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiMINUS_DM 4 | { 5 | public interface Int_MINUS_DM 6 | { 7 | IAvapiResponse_MINUS_DM Query( 8 | string symbol, 9 | Const_MINUS_DM.MINUS_DM_interval interval, 10 | int time_period); 11 | 12 | Task QueryAsync( 13 | string symbol, 14 | Const_MINUS_DM.MINUS_DM_interval interval, 15 | int time_period); 16 | 17 | 18 | IAvapiResponse_MINUS_DM QueryPrimitive( 19 | string symbol, 20 | string interval, 21 | int time_period); 22 | 23 | Task QueryPrimitiveAsync( 24 | string symbol, 25 | string interval, 26 | int time_period); 27 | 28 | } 29 | 30 | public interface IAvapiResponse_MINUS_DM 31 | { 32 | string LastHttpRequest 33 | { 34 | get; 35 | } 36 | 37 | string RawData 38 | { 39 | get; 40 | } 41 | 42 | IAvapiResponse_MINUS_DM_Content Data 43 | { 44 | get; 45 | } 46 | } 47 | 48 | public interface IAvapiResponse_MINUS_DM_Content 49 | { 50 | bool Error 51 | { 52 | get; 53 | } 54 | 55 | string ErrorMessage 56 | { 57 | get; 58 | } 59 | 60 | MetaData_Type_MINUS_DM MetaData 61 | { 62 | get; 63 | } 64 | 65 | IList TechnicalIndicator 66 | { 67 | get; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Avapi/MOM/Const_MOM.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiMOM 2 | { 3 | public static class Const_MOM 4 | { 5 | public enum MOM_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum MOM_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Avapi/MOM/Int_MOM.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiMOM 4 | { 5 | 6 | // Inteface 7 | public interface Int_MOM 8 | { 9 | IAvapiResponse_MOM Query( 10 | string symbol, 11 | Const_MOM.MOM_interval interval, 12 | int time_period, 13 | Const_MOM.MOM_series_type series_type); 14 | 15 | Task QueryAsync( 16 | string symbol, 17 | Const_MOM.MOM_interval interval, 18 | int time_period, 19 | Const_MOM.MOM_series_type series_type); 20 | 21 | 22 | IAvapiResponse_MOM QueryPrimitive( 23 | string symbol, 24 | string interval, 25 | int time_period, 26 | string series_type); 27 | 28 | Task QueryPrimitiveAsync( 29 | string symbol, 30 | string interval, 31 | int time_period, 32 | string series_type); 33 | 34 | } 35 | 36 | public interface IAvapiResponse_MOM 37 | { 38 | string LastHttpRequest 39 | { 40 | get; 41 | } 42 | 43 | string RawData 44 | { 45 | get; 46 | } 47 | 48 | IAvapiResponse_MOM_Content Data 49 | { 50 | get; 51 | } 52 | } 53 | 54 | public interface IAvapiResponse_MOM_Content 55 | { 56 | bool Error 57 | { 58 | get; 59 | } 60 | 61 | string ErrorMessage 62 | { 63 | get; 64 | } 65 | 66 | MetaData_Type_MOM MetaData 67 | { 68 | get; 69 | } 70 | 71 | IList TechnicalIndicator 72 | { 73 | get; 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Avapi/NATR/Const_NATR.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiNATR 2 | { 3 | public static class Const_NATR 4 | { 5 | public enum NATR_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Avapi/NATR/Int_NATR.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiNATR 4 | { 5 | public interface Int_NATR 6 | { 7 | IAvapiResponse_NATR Query( 8 | string symbol, 9 | Const_NATR.NATR_interval interval, 10 | int time_period); 11 | 12 | Task QueryAsync( 13 | string symbol, 14 | Const_NATR.NATR_interval interval, 15 | int time_period); 16 | 17 | 18 | IAvapiResponse_NATR QueryPrimitive( 19 | string symbol, 20 | string interval, 21 | int time_period); 22 | 23 | Task QueryPrimitiveAsync( 24 | string symbol, 25 | string interval, 26 | int time_period); 27 | 28 | } 29 | 30 | public interface IAvapiResponse_NATR 31 | { 32 | string LastHttpRequest 33 | { 34 | get; 35 | } 36 | 37 | string RawData 38 | { 39 | get; 40 | } 41 | 42 | IAvapiResponse_NATR_Content Data 43 | { 44 | get; 45 | } 46 | } 47 | 48 | public interface IAvapiResponse_NATR_Content 49 | { 50 | bool Error 51 | { 52 | get; 53 | } 54 | 55 | string ErrorMessage 56 | { 57 | get; 58 | } 59 | 60 | MetaData_Type_NATR MetaData 61 | { 62 | get; 63 | } 64 | 65 | IList TechnicalIndicator 66 | { 67 | get; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Avapi/OBV/Const_OBV.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiOBV 2 | { 3 | public static class Const_OBV 4 | { 5 | public enum OBV_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Avapi/OBV/Int_OBV.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiOBV 4 | { 5 | public interface Int_OBV 6 | { 7 | IAvapiResponse_OBV Query( 8 | string symbol, 9 | Const_OBV.OBV_interval interval); 10 | 11 | Task QueryAsync( 12 | string symbol, 13 | Const_OBV.OBV_interval interval); 14 | 15 | 16 | IAvapiResponse_OBV QueryPrimitive( 17 | string symbol, 18 | string interval); 19 | 20 | Task QueryPrimitiveAsync( 21 | string symbol, 22 | string interval); 23 | 24 | } 25 | 26 | public interface IAvapiResponse_OBV 27 | { 28 | string LastHttpRequest 29 | { 30 | get; 31 | } 32 | 33 | string RawData 34 | { 35 | get; 36 | } 37 | 38 | IAvapiResponse_OBV_Content Data 39 | { 40 | get; 41 | } 42 | } 43 | 44 | public interface IAvapiResponse_OBV_Content 45 | { 46 | bool Error 47 | { 48 | get; 49 | } 50 | 51 | string ErrorMessage 52 | { 53 | get; 54 | } 55 | 56 | MetaData_Type_OBV MetaData 57 | { 58 | get; 59 | } 60 | 61 | IList TechnicalIndicator 62 | { 63 | get; 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Avapi/PLUS_DI/Const_PLUS_DI.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiPLUS_DI 2 | { 3 | public static class Const_PLUS_DI 4 | { 5 | public enum PLUS_DI_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Avapi/PLUS_DI/Int_PLUS_DI.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiPLUS_DI 4 | { 5 | public interface Int_PLUS_DI 6 | { 7 | IAvapiResponse_PLUS_DI Query( 8 | string symbol, 9 | Const_PLUS_DI.PLUS_DI_interval interval, 10 | int time_period); 11 | 12 | Task QueryAsync( 13 | string symbol, 14 | Const_PLUS_DI.PLUS_DI_interval interval, 15 | int time_period); 16 | 17 | 18 | IAvapiResponse_PLUS_DI QueryPrimitive( 19 | string symbol, 20 | string interval, 21 | int time_period); 22 | 23 | Task QueryPrimitiveAsync( 24 | string symbol, 25 | string interval, 26 | int time_period); 27 | 28 | } 29 | 30 | public interface IAvapiResponse_PLUS_DI 31 | { 32 | string LastHttpRequest 33 | { 34 | get; 35 | } 36 | 37 | string RawData 38 | { 39 | get; 40 | } 41 | 42 | IAvapiResponse_PLUS_DI_Content Data 43 | { 44 | get; 45 | } 46 | } 47 | 48 | public interface IAvapiResponse_PLUS_DI_Content 49 | { 50 | bool Error 51 | { 52 | get; 53 | } 54 | 55 | string ErrorMessage 56 | { 57 | get; 58 | } 59 | 60 | MetaData_Type_PLUS_DI MetaData 61 | { 62 | get; 63 | } 64 | 65 | IList TechnicalIndicator 66 | { 67 | get; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Avapi/PLUS_DM/Const_PLUS_DM.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiPLUS_DM 2 | { 3 | public static class Const_PLUS_DM 4 | { 5 | public enum PLUS_DM_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Avapi/PLUS_DM/Int_PLUS_DM.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiPLUS_DM 4 | { 5 | public interface Int_PLUS_DM 6 | { 7 | IAvapiResponse_PLUS_DM Query( 8 | string symbol, 9 | Const_PLUS_DM.PLUS_DM_interval interval, 10 | int time_period); 11 | 12 | Task QueryAsync( 13 | string symbol, 14 | Const_PLUS_DM.PLUS_DM_interval interval, 15 | int time_period); 16 | 17 | 18 | IAvapiResponse_PLUS_DM QueryPrimitive( 19 | string symbol, 20 | string interval, 21 | int time_period); 22 | 23 | Task QueryPrimitiveAsync( 24 | string symbol, 25 | string interval, 26 | int time_period); 27 | 28 | } 29 | 30 | public interface IAvapiResponse_PLUS_DM 31 | { 32 | string LastHttpRequest 33 | { 34 | get; 35 | } 36 | 37 | string RawData 38 | { 39 | get; 40 | } 41 | 42 | IAvapiResponse_PLUS_DM_Content Data 43 | { 44 | get; 45 | } 46 | } 47 | 48 | public interface IAvapiResponse_PLUS_DM_Content 49 | { 50 | bool Error 51 | { 52 | get; 53 | } 54 | 55 | string ErrorMessage 56 | { 57 | get; 58 | } 59 | 60 | MetaData_Type_PLUS_DM MetaData 61 | { 62 | get; 63 | } 64 | 65 | IList TechnicalIndicator 66 | { 67 | get; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Avapi/PPO/Const_PPO.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiPPO 2 | { 3 | public static class Const_PPO 4 | { 5 | public enum PPO_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum PPO_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | public enum PPO_matype 26 | {none, 27 | n_0, 28 | n_1, 29 | n_2, 30 | n_3, 31 | n_4, 32 | n_5, 33 | n_6, 34 | n_7, 35 | n_8 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Avapi/PPO/Int_PPO.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiPPO 4 | { 5 | public interface Int_PPO 6 | { 7 | IAvapiResponse_PPO Query( 8 | string symbol, 9 | Const_PPO.PPO_interval interval, 10 | Const_PPO.PPO_series_type series_type, 11 | int fastperiod = -1, 12 | int slowperiod = -1, 13 | Const_PPO.PPO_matype matype = Const_PPO.PPO_matype.none); 14 | 15 | Task QueryAsync( 16 | string symbol, 17 | Const_PPO.PPO_interval interval, 18 | Const_PPO.PPO_series_type series_type, 19 | int fastperiod = -1, 20 | int slowperiod = -1, 21 | Const_PPO.PPO_matype matype = Const_PPO.PPO_matype.none); 22 | 23 | 24 | IAvapiResponse_PPO QueryPrimitive( 25 | string symbol, 26 | string interval, 27 | string series_type, 28 | int fastperiod = -1, 29 | int slowperiod = -1, 30 | int matype = -1); 31 | 32 | Task QueryPrimitiveAsync( 33 | string symbol, 34 | string interval, 35 | string series_type, 36 | int fastperiod = -1, 37 | int slowperiod = -1, 38 | int matype = -1); 39 | 40 | } 41 | 42 | public interface IAvapiResponse_PPO 43 | { 44 | string LastHttpRequest 45 | { 46 | get; 47 | } 48 | 49 | string RawData 50 | { 51 | get; 52 | } 53 | 54 | IAvapiResponse_PPO_Content Data 55 | { 56 | get; 57 | } 58 | } 59 | 60 | public interface IAvapiResponse_PPO_Content 61 | { 62 | bool Error 63 | { 64 | get; 65 | } 66 | 67 | string ErrorMessage 68 | { 69 | get; 70 | } 71 | 72 | MetaData_Type_PPO MetaData 73 | { 74 | get; 75 | } 76 | 77 | IList TechnicalIndicator 78 | { 79 | get; 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /Avapi/ROC/Const_ROC.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiROC 2 | { 3 | public static class Const_ROC 4 | { 5 | public enum ROC_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum ROC_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Avapi/ROC/Int_ROC.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiROC 4 | { 5 | public interface Int_ROC 6 | { 7 | IAvapiResponse_ROC Query( 8 | string symbol, 9 | Const_ROC.ROC_interval interval, 10 | int time_period, 11 | Const_ROC.ROC_series_type series_type); 12 | 13 | Task QueryAsync( 14 | string symbol, 15 | Const_ROC.ROC_interval interval, 16 | int time_period, 17 | Const_ROC.ROC_series_type series_type); 18 | 19 | 20 | IAvapiResponse_ROC QueryPrimitive( 21 | string symbol, 22 | string interval, 23 | int time_period, 24 | string series_type); 25 | 26 | Task QueryPrimitiveAsync( 27 | string symbol, 28 | string interval, 29 | int time_period, 30 | string series_type); 31 | 32 | } 33 | 34 | public interface IAvapiResponse_ROC 35 | { 36 | string LastHttpRequest 37 | { 38 | get; 39 | } 40 | 41 | string RawData 42 | { 43 | get; 44 | } 45 | 46 | IAvapiResponse_ROC_Content Data 47 | { 48 | get; 49 | } 50 | } 51 | 52 | public interface IAvapiResponse_ROC_Content 53 | { 54 | bool Error 55 | { 56 | get; 57 | } 58 | 59 | string ErrorMessage 60 | { 61 | get; 62 | } 63 | 64 | MetaData_Type_ROC MetaData 65 | { 66 | get; 67 | } 68 | 69 | IList TechnicalIndicator 70 | { 71 | get; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Avapi/ROCR/Const_ROCR.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiROCR 2 | { 3 | public static class Const_ROCR 4 | { 5 | public enum ROCR_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum ROCR_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Avapi/ROCR/Int_ROCR.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiROCR 4 | { 5 | public interface Int_ROCR 6 | { 7 | IAvapiResponse_ROCR Query( 8 | string symbol, 9 | Const_ROCR.ROCR_interval interval, 10 | int time_period, 11 | Const_ROCR.ROCR_series_type series_type); 12 | 13 | Task QueryAsync( 14 | string symbol, 15 | Const_ROCR.ROCR_interval interval, 16 | int time_period, 17 | Const_ROCR.ROCR_series_type series_type); 18 | 19 | 20 | IAvapiResponse_ROCR QueryPrimitive( 21 | string symbol, 22 | string interval, 23 | int time_period, 24 | string series_type); 25 | 26 | Task QueryPrimitiveAsync( 27 | string symbol, 28 | string interval, 29 | int time_period, 30 | string series_type); 31 | 32 | } 33 | 34 | public interface IAvapiResponse_ROCR 35 | { 36 | string LastHttpRequest 37 | { 38 | get; 39 | } 40 | 41 | string RawData 42 | { 43 | get; 44 | } 45 | 46 | IAvapiResponse_ROCR_Content Data 47 | { 48 | get; 49 | } 50 | } 51 | 52 | public interface IAvapiResponse_ROCR_Content 53 | { 54 | bool Error 55 | { 56 | get; 57 | } 58 | 59 | string ErrorMessage 60 | { 61 | get; 62 | } 63 | 64 | MetaData_Type_ROCR MetaData 65 | { 66 | get; 67 | } 68 | 69 | IList TechnicalIndicator 70 | { 71 | get; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Avapi/RSI/Const_RSI.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiRSI 2 | { 3 | public static class Const_RSI 4 | { 5 | public enum RSI_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum RSI_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Avapi/RSI/Int_RSI.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiRSI 4 | { 5 | public interface Int_RSI 6 | { 7 | IAvapiResponse_RSI Query( 8 | string symbol, 9 | Const_RSI.RSI_interval interval, 10 | int time_period, 11 | Const_RSI.RSI_series_type series_type); 12 | 13 | Task QueryAsync( 14 | string symbol, 15 | Const_RSI.RSI_interval interval, 16 | int time_period, 17 | Const_RSI.RSI_series_type series_type); 18 | 19 | 20 | IAvapiResponse_RSI QueryPrimitive( 21 | string symbol, 22 | string interval, 23 | int time_period, 24 | string series_type); 25 | 26 | Task QueryPrimitiveAsync( 27 | string symbol, 28 | string interval, 29 | int time_period, 30 | string series_type); 31 | 32 | } 33 | 34 | public interface IAvapiResponse_RSI 35 | { 36 | string LastHttpRequest 37 | { 38 | get; 39 | } 40 | 41 | string RawData 42 | { 43 | get; 44 | } 45 | 46 | IAvapiResponse_RSI_Content Data 47 | { 48 | get; 49 | } 50 | } 51 | 52 | public interface IAvapiResponse_RSI_Content 53 | { 54 | bool Error 55 | { 56 | get; 57 | } 58 | 59 | string ErrorMessage 60 | { 61 | get; 62 | } 63 | 64 | MetaData_Type_RSI MetaData 65 | { 66 | get; 67 | } 68 | 69 | IList TechnicalIndicator 70 | { 71 | get; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Avapi/SAR/Const_SAR.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiSAR 2 | { 3 | public static class Const_SAR 4 | { 5 | public enum SAR_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Avapi/SAR/Int_SAR.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiSAR 4 | { 5 | public interface Int_SAR 6 | { 7 | IAvapiResponse_SAR Query( 8 | string symbol, 9 | Const_SAR.SAR_interval interval, 10 | float acceleration = -1, 11 | float maximum = -1); 12 | 13 | Task QueryAsync( 14 | string symbol, 15 | Const_SAR.SAR_interval interval, 16 | float acceleration = -1, 17 | float maximum = -1); 18 | 19 | 20 | IAvapiResponse_SAR QueryPrimitive( 21 | string symbol, 22 | string interval, 23 | float acceleration = -1, 24 | float maximum = -1); 25 | 26 | Task QueryPrimitiveAsync( 27 | string symbol, 28 | string interval, 29 | float acceleration = -1, 30 | float maximum = -1); 31 | 32 | } 33 | 34 | public interface IAvapiResponse_SAR 35 | { 36 | string LastHttpRequest 37 | { 38 | get; 39 | } 40 | 41 | string RawData 42 | { 43 | get; 44 | } 45 | 46 | IAvapiResponse_SAR_Content Data 47 | { 48 | get; 49 | } 50 | } 51 | 52 | public interface IAvapiResponse_SAR_Content 53 | { 54 | bool Error 55 | { 56 | get; 57 | } 58 | 59 | string ErrorMessage 60 | { 61 | get; 62 | } 63 | 64 | MetaData_Type_SAR MetaData 65 | { 66 | get; 67 | } 68 | 69 | IList TechnicalIndicator 70 | { 71 | get; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Avapi/SECTOR/Int_SECTOR.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiSECTOR 4 | { 5 | public interface Int_SECTOR 6 | { 7 | IAvapiResponse_SECTOR QueryPrimitive(); 8 | Task QueryPrimitiveAsync(); 9 | } 10 | 11 | public interface IAvapiResponse_SECTOR 12 | { 13 | string LastHttpRequest 14 | { 15 | get; 16 | } 17 | 18 | string RawData 19 | { 20 | get; 21 | } 22 | 23 | IAvapiResponse_SECTOR_Content Data 24 | { 25 | get; 26 | } 27 | } 28 | 29 | public interface IAvapiResponse_SECTOR_Content 30 | { 31 | bool Error 32 | { 33 | get; 34 | } 35 | 36 | string ErrorMessage 37 | { 38 | get; 39 | } 40 | 41 | MetaData_Type_SECTOR MetaData 42 | { 43 | get; 44 | } 45 | 46 | RankA_Type_SECTOR RankA 47 | { 48 | get; 49 | } 50 | RankB_Type_SECTOR RankB 51 | { 52 | get; 53 | } 54 | RankC_Type_SECTOR RankC 55 | { 56 | get; 57 | } 58 | RankD_Type_SECTOR RankD 59 | { 60 | get; 61 | } 62 | RankE_Type_SECTOR RankE 63 | { 64 | get; 65 | } 66 | RankF_Type_SECTOR RankF 67 | { 68 | get; 69 | } 70 | RankG_Type_SECTOR RankG 71 | { 72 | get; 73 | } 74 | RankH_Type_SECTOR RankH 75 | { 76 | get; 77 | } 78 | RankI_Type_SECTOR RankI 79 | { 80 | get; 81 | } 82 | RankJ_Type_SECTOR RankJ 83 | { 84 | get; 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /Avapi/SMA/Const_SMA.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiSMA 2 | { 3 | public static class Const_SMA 4 | { 5 | public enum SMA_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum SMA_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Avapi/SMA/Int_SMA.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiSMA 4 | { 5 | public interface Int_SMA 6 | { 7 | IAvapiResponse_SMA Query( 8 | string symbol, 9 | Const_SMA.SMA_interval interval, 10 | int time_period, 11 | Const_SMA.SMA_series_type series_type); 12 | 13 | Task QueryAsync( 14 | string symbol, 15 | Const_SMA.SMA_interval interval, 16 | int time_period, 17 | Const_SMA.SMA_series_type series_type); 18 | 19 | 20 | IAvapiResponse_SMA QueryPrimitive( 21 | string symbol, 22 | string interval, 23 | int time_period, 24 | string series_type); 25 | 26 | Task QueryPrimitiveAsync( 27 | string symbol, 28 | string interval, 29 | int time_period, 30 | string series_type); 31 | 32 | } 33 | 34 | public interface IAvapiResponse_SMA 35 | { 36 | string LastHttpRequest 37 | { 38 | get; 39 | } 40 | 41 | string RawData 42 | { 43 | get; 44 | } 45 | 46 | IAvapiResponse_SMA_Content Data 47 | { 48 | get; 49 | } 50 | } 51 | 52 | public interface IAvapiResponse_SMA_Content 53 | { 54 | bool Error 55 | { 56 | get; 57 | } 58 | 59 | string ErrorMessage 60 | { 61 | get; 62 | } 63 | 64 | MetaData_Type_SMA MetaData 65 | { 66 | get; 67 | } 68 | 69 | IList TechnicalIndicator 70 | { 71 | get; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Avapi/STOCH/Const_STOCH.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiSTOCH 2 | { 3 | public static class Const_STOCH 4 | { 5 | public enum STOCH_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum STOCH_slowkmatype 18 | {none, 19 | n_0, 20 | n_1, 21 | n_2, 22 | n_3, 23 | n_4, 24 | n_5, 25 | n_6, 26 | n_7, 27 | n_8 28 | } 29 | public enum STOCH_slowdmatype 30 | {none, 31 | n_0, 32 | n_1, 33 | n_2, 34 | n_3, 35 | n_4, 36 | n_5, 37 | n_6, 38 | n_7, 39 | n_8 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Avapi/STOCH/Int_STOCH.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiSTOCH 4 | { 5 | public interface Int_STOCH 6 | { 7 | IAvapiResponse_STOCH Query( 8 | string symbol, 9 | Const_STOCH.STOCH_interval interval, 10 | int fastkperiod = -1, 11 | int slowkperiod = -1, 12 | int slowdperiod = -1, 13 | Const_STOCH.STOCH_slowkmatype slowkmatype = Const_STOCH.STOCH_slowkmatype.none, 14 | Const_STOCH.STOCH_slowdmatype slowdmatype = Const_STOCH.STOCH_slowdmatype.none); 15 | 16 | Task QueryAsync( 17 | string symbol, 18 | Const_STOCH.STOCH_interval interval, 19 | int fastkperiod = -1, 20 | int slowkperiod = -1, 21 | int slowdperiod = -1, 22 | Const_STOCH.STOCH_slowkmatype slowkmatype = Const_STOCH.STOCH_slowkmatype.none, 23 | Const_STOCH.STOCH_slowdmatype slowdmatype = Const_STOCH.STOCH_slowdmatype.none); 24 | 25 | 26 | IAvapiResponse_STOCH QueryPrimitive( 27 | string symbol, 28 | string interval, 29 | int fastkperiod = -1, 30 | int slowkperiod = -1, 31 | int slowdperiod = -1, 32 | int slowkmatype = -1, 33 | int slowdmatype = -1); 34 | 35 | Task QueryPrimitiveAsync( 36 | string symbol, 37 | string interval, 38 | int fastkperiod = -1, 39 | int slowkperiod = -1, 40 | int slowdperiod = -1, 41 | int slowkmatype = -1, 42 | int slowdmatype = -1); 43 | 44 | } 45 | 46 | public interface IAvapiResponse_STOCH 47 | { 48 | string LastHttpRequest 49 | { 50 | get; 51 | } 52 | 53 | string RawData 54 | { 55 | get; 56 | } 57 | 58 | IAvapiResponse_STOCH_Content Data 59 | { 60 | get; 61 | } 62 | } 63 | 64 | public interface IAvapiResponse_STOCH_Content 65 | { 66 | bool Error 67 | { 68 | get; 69 | } 70 | 71 | string ErrorMessage 72 | { 73 | get; 74 | } 75 | 76 | MetaData_Type_STOCH MetaData 77 | { 78 | get; 79 | } 80 | 81 | IList TechnicalIndicator 82 | { 83 | get; 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /Avapi/STOCHF/Const_STOCHF.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiSTOCHF 2 | { 3 | public static class Const_STOCHF 4 | { 5 | public enum STOCHF_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum STOCHF_fastdmatype 18 | {none, 19 | n_0, 20 | n_1, 21 | n_2, 22 | n_3, 23 | n_4, 24 | n_5, 25 | n_6, 26 | n_7, 27 | n_8 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Avapi/STOCHF/Int_STOCHF.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiSTOCHF 4 | { 5 | public interface Int_STOCHF 6 | { 7 | IAvapiResponse_STOCHF Query( 8 | string symbol, 9 | Const_STOCHF.STOCHF_interval interval, 10 | int fastkperiod = -1, 11 | int fastdperiod = -1, 12 | Const_STOCHF.STOCHF_fastdmatype fastdmatype = Const_STOCHF.STOCHF_fastdmatype.none); 13 | 14 | Task QueryAsync( 15 | string symbol, 16 | Const_STOCHF.STOCHF_interval interval, 17 | int fastkperiod = -1, 18 | int fastdperiod = -1, 19 | Const_STOCHF.STOCHF_fastdmatype fastdmatype = Const_STOCHF.STOCHF_fastdmatype.none); 20 | 21 | 22 | IAvapiResponse_STOCHF QueryPrimitive( 23 | string symbol, 24 | string interval, 25 | int fastkperiod = -1, 26 | int fastdperiod = -1, 27 | int fastdmatype = -1); 28 | 29 | Task QueryPrimitiveAsync( 30 | string symbol, 31 | string interval, 32 | int fastkperiod = -1, 33 | int fastdperiod = -1, 34 | int fastdmatype = -1); 35 | 36 | } 37 | 38 | public interface IAvapiResponse_STOCHF 39 | { 40 | string LastHttpRequest 41 | { 42 | get; 43 | } 44 | 45 | string RawData 46 | { 47 | get; 48 | } 49 | 50 | IAvapiResponse_STOCHF_Content Data 51 | { 52 | get; 53 | } 54 | } 55 | 56 | public interface IAvapiResponse_STOCHF_Content 57 | { 58 | bool Error 59 | { 60 | get; 61 | } 62 | 63 | string ErrorMessage 64 | { 65 | get; 66 | } 67 | 68 | MetaData_Type_STOCHF MetaData 69 | { 70 | get; 71 | } 72 | 73 | IList TechnicalIndicator 74 | { 75 | get; 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Avapi/STOCHRSI/Const_STOCHRSI.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiSTOCHRSI 2 | { 3 | public static class Const_STOCHRSI 4 | { 5 | public enum STOCHRSI_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum STOCHRSI_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | public enum STOCHRSI_fastdmatype 26 | {none, 27 | n_0, 28 | n_1, 29 | n_2, 30 | n_3, 31 | n_4, 32 | n_5, 33 | n_6, 34 | n_7, 35 | n_8 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Avapi/STOCHRSI/Int_STOCHRSI.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiSTOCHRSI 4 | { 5 | public interface Int_STOCHRSI 6 | { 7 | IAvapiResponse_STOCHRSI Query( 8 | string symbol, 9 | Const_STOCHRSI.STOCHRSI_interval interval, 10 | int time_period, 11 | Const_STOCHRSI.STOCHRSI_series_type series_type, 12 | int fastkperiod = -1, 13 | int fastdperiod = -1, 14 | Const_STOCHRSI.STOCHRSI_fastdmatype fastdmatype = Const_STOCHRSI.STOCHRSI_fastdmatype.none); 15 | 16 | Task QueryAsync( 17 | string symbol, 18 | Const_STOCHRSI.STOCHRSI_interval interval, 19 | int time_period, 20 | Const_STOCHRSI.STOCHRSI_series_type series_type, 21 | int fastkperiod = -1, 22 | int fastdperiod = -1, 23 | Const_STOCHRSI.STOCHRSI_fastdmatype fastdmatype = Const_STOCHRSI.STOCHRSI_fastdmatype.none); 24 | 25 | 26 | IAvapiResponse_STOCHRSI QueryPrimitive( 27 | string symbol, 28 | string interval, 29 | int time_period, 30 | string series_type, 31 | int fastkperiod = -1, 32 | int fastdperiod = -1, 33 | int fastdmatype = -1); 34 | 35 | Task QueryPrimitiveAsync( 36 | string symbol, 37 | string interval, 38 | int time_period, 39 | string series_type, 40 | int fastkperiod = -1, 41 | int fastdperiod = -1, 42 | int fastdmatype = -1); 43 | 44 | } 45 | 46 | public interface IAvapiResponse_STOCHRSI 47 | { 48 | string LastHttpRequest 49 | { 50 | get; 51 | } 52 | 53 | string RawData 54 | { 55 | get; 56 | } 57 | 58 | IAvapiResponse_STOCHRSI_Content Data 59 | { 60 | get; 61 | } 62 | } 63 | 64 | public interface IAvapiResponse_STOCHRSI_Content 65 | { 66 | bool Error 67 | { 68 | get; 69 | } 70 | 71 | string ErrorMessage 72 | { 73 | get; 74 | } 75 | 76 | MetaData_Type_STOCHRSI MetaData 77 | { 78 | get; 79 | } 80 | 81 | IList TechnicalIndicator 82 | { 83 | get; 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /Avapi/T3/Const_T3.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiT3 2 | { 3 | public static class Const_T3 4 | { 5 | public enum T3_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum T3_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Avapi/T3/Int_T3.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiT3 4 | { 5 | public interface Int_T3 6 | { 7 | IAvapiResponse_T3 Query( 8 | string symbol, 9 | Const_T3.T3_interval interval, 10 | int time_period, 11 | Const_T3.T3_series_type series_type); 12 | 13 | Task QueryAsync( 14 | string symbol, 15 | Const_T3.T3_interval interval, 16 | int time_period, 17 | Const_T3.T3_series_type series_type); 18 | 19 | 20 | IAvapiResponse_T3 QueryPrimitive( 21 | string symbol, 22 | string interval, 23 | int time_period, 24 | string series_type); 25 | 26 | Task QueryPrimitiveAsync( 27 | string symbol, 28 | string interval, 29 | int time_period, 30 | string series_type); 31 | 32 | } 33 | 34 | public interface IAvapiResponse_T3 35 | { 36 | string LastHttpRequest 37 | { 38 | get; 39 | } 40 | 41 | string RawData 42 | { 43 | get; 44 | } 45 | 46 | IAvapiResponse_T3_Content Data 47 | { 48 | get; 49 | } 50 | } 51 | 52 | public interface IAvapiResponse_T3_Content 53 | { 54 | bool Error 55 | { 56 | get; 57 | } 58 | 59 | string ErrorMessage 60 | { 61 | get; 62 | } 63 | 64 | MetaData_Type_T3 MetaData 65 | { 66 | get; 67 | } 68 | 69 | IList TechnicalIndicator 70 | { 71 | get; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Avapi/TEMA/Const_TEMA.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiTEMA 2 | { 3 | public static class Const_TEMA 4 | { 5 | public enum TEMA_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum TEMA_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Avapi/TEMA/Int_TEMA.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiTEMA 4 | { 5 | public interface Int_TEMA 6 | { 7 | IAvapiResponse_TEMA Query( 8 | string symbol, 9 | Const_TEMA.TEMA_interval interval, 10 | int time_period, 11 | Const_TEMA.TEMA_series_type series_type); 12 | 13 | Task QueryAsync( 14 | string symbol, 15 | Const_TEMA.TEMA_interval interval, 16 | int time_period, 17 | Const_TEMA.TEMA_series_type series_type); 18 | 19 | 20 | IAvapiResponse_TEMA QueryPrimitive( 21 | string symbol, 22 | string interval, 23 | int time_period, 24 | string series_type); 25 | 26 | Task QueryPrimitiveAsync( 27 | string symbol, 28 | string interval, 29 | int time_period, 30 | string series_type); 31 | 32 | } 33 | 34 | public interface IAvapiResponse_TEMA 35 | { 36 | string LastHttpRequest 37 | { 38 | get; 39 | } 40 | 41 | string RawData 42 | { 43 | get; 44 | } 45 | 46 | IAvapiResponse_TEMA_Content Data 47 | { 48 | get; 49 | } 50 | } 51 | 52 | public interface IAvapiResponse_TEMA_Content 53 | { 54 | bool Error 55 | { 56 | get; 57 | } 58 | 59 | string ErrorMessage 60 | { 61 | get; 62 | } 63 | 64 | MetaData_Type_TEMA MetaData 65 | { 66 | get; 67 | } 68 | 69 | IList TechnicalIndicator 70 | { 71 | get; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Avapi/TIME_SERIES_DAILY/Const_TIME_SERIES_DAILY.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiTIME_SERIES_DAILY 2 | { 3 | public static class Const_TIME_SERIES_DAILY 4 | { 5 | public enum TIME_SERIES_DAILY_outputsize 6 | { 7 | none, 8 | compact, 9 | full 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Avapi/TIME_SERIES_DAILY/Int_TIME_SERIES_DAILY.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiTIME_SERIES_DAILY 4 | { 5 | public interface Int_TIME_SERIES_DAILY 6 | { 7 | IAvapiResponse_TIME_SERIES_DAILY Query( 8 | string symbol, 9 | Const_TIME_SERIES_DAILY.TIME_SERIES_DAILY_outputsize outputsize = Const_TIME_SERIES_DAILY.TIME_SERIES_DAILY_outputsize.none); 10 | 11 | Task QueryAsync( 12 | string symbol, 13 | Const_TIME_SERIES_DAILY.TIME_SERIES_DAILY_outputsize outputsize = Const_TIME_SERIES_DAILY.TIME_SERIES_DAILY_outputsize.none); 14 | 15 | 16 | IAvapiResponse_TIME_SERIES_DAILY QueryPrimitive( 17 | string symbol, 18 | string outputsize = null); 19 | 20 | Task QueryPrimitiveAsync( 21 | string symbol, 22 | string outputsize = null); 23 | 24 | } 25 | 26 | public interface IAvapiResponse_TIME_SERIES_DAILY 27 | { 28 | string LastHttpRequest 29 | { 30 | get; 31 | } 32 | 33 | string RawData 34 | { 35 | get; 36 | } 37 | 38 | IAvapiResponse_TIME_SERIES_DAILY_Content Data 39 | { 40 | get; 41 | } 42 | } 43 | 44 | public interface IAvapiResponse_TIME_SERIES_DAILY_Content 45 | { 46 | bool Error 47 | { 48 | get; 49 | } 50 | 51 | string ErrorMessage 52 | { 53 | get; 54 | } 55 | 56 | MetaData_Type_TIME_SERIES_DAILY MetaData 57 | { 58 | get; 59 | } 60 | 61 | IList TimeSeries 62 | { 63 | get; 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Avapi/TIME_SERIES_DAILY_ADJUSTED/Const_TIME_SERIES_DAILY_ADJUSTED.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiTIME_SERIES_DAILY_ADJUSTED 2 | { 3 | public static class Const_TIME_SERIES_DAILY_ADJUSTED 4 | { 5 | public enum TIME_SERIES_DAILY_ADJUSTED_outputsize 6 | { 7 | none, 8 | compact, 9 | full 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Avapi/TIME_SERIES_DAILY_ADJUSTED/Int_TIME_SERIES_DAILY_ADJUSTED.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiTIME_SERIES_DAILY_ADJUSTED 4 | { 5 | public interface Int_TIME_SERIES_DAILY_ADJUSTED 6 | { 7 | IAvapiResponse_TIME_SERIES_DAILY_ADJUSTED Query( 8 | string symbol, 9 | Const_TIME_SERIES_DAILY_ADJUSTED.TIME_SERIES_DAILY_ADJUSTED_outputsize outputsize = Const_TIME_SERIES_DAILY_ADJUSTED.TIME_SERIES_DAILY_ADJUSTED_outputsize.none); 10 | 11 | Task QueryAsync( 12 | string symbol, 13 | Const_TIME_SERIES_DAILY_ADJUSTED.TIME_SERIES_DAILY_ADJUSTED_outputsize outputsize = Const_TIME_SERIES_DAILY_ADJUSTED.TIME_SERIES_DAILY_ADJUSTED_outputsize.none); 14 | 15 | 16 | IAvapiResponse_TIME_SERIES_DAILY_ADJUSTED QueryPrimitive( 17 | string symbol, 18 | string outputsize = null); 19 | 20 | Task QueryPrimitiveAsync( 21 | string symbol, 22 | string outputsize = null); 23 | 24 | } 25 | 26 | public interface IAvapiResponse_TIME_SERIES_DAILY_ADJUSTED 27 | { 28 | string LastHttpRequest 29 | { 30 | get; 31 | } 32 | 33 | string RawData 34 | { 35 | get; 36 | } 37 | 38 | IAvapiResponse_TIME_SERIES_DAILY_ADJUSTED_Content Data 39 | { 40 | get; 41 | } 42 | } 43 | 44 | public interface IAvapiResponse_TIME_SERIES_DAILY_ADJUSTED_Content 45 | { 46 | bool Error 47 | { 48 | get; 49 | } 50 | 51 | string ErrorMessage 52 | { 53 | get; 54 | } 55 | 56 | MetaData_Type_TIME_SERIES_DAILY_ADJUSTED MetaData 57 | { 58 | get; 59 | } 60 | 61 | IList TimeSeries 62 | { 63 | get; 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Avapi/TIME_SERIES_INTRADAY/Const_TIME_SERIES_INTRADAY.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiTIME_SERIES_INTRADAY 2 | { 3 | public static class Const_TIME_SERIES_INTRADAY 4 | { 5 | public enum TIME_SERIES_INTRADAY_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min 13 | } 14 | public enum TIME_SERIES_INTRADAY_outputsize 15 | { 16 | none, 17 | compact, 18 | full 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Avapi/TIME_SERIES_INTRADAY/Int_TIME_SERIES_INTRADAY.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiTIME_SERIES_INTRADAY 4 | { 5 | public interface Int_TIME_SERIES_INTRADAY 6 | { 7 | IAvapiResponse_TIME_SERIES_INTRADAY Query( 8 | string symbol, 9 | Const_TIME_SERIES_INTRADAY.TIME_SERIES_INTRADAY_interval interval, 10 | Const_TIME_SERIES_INTRADAY.TIME_SERIES_INTRADAY_outputsize outputsize = Const_TIME_SERIES_INTRADAY.TIME_SERIES_INTRADAY_outputsize.none); 11 | 12 | Task QueryAsync( 13 | string symbol, 14 | Const_TIME_SERIES_INTRADAY.TIME_SERIES_INTRADAY_interval interval, 15 | Const_TIME_SERIES_INTRADAY.TIME_SERIES_INTRADAY_outputsize outputsize = Const_TIME_SERIES_INTRADAY.TIME_SERIES_INTRADAY_outputsize.none); 16 | 17 | 18 | IAvapiResponse_TIME_SERIES_INTRADAY QueryPrimitive( 19 | string symbol, 20 | string interval, 21 | string outputsize = null); 22 | 23 | Task QueryPrimitiveAsync( 24 | string symbol, 25 | string interval, 26 | string outputsize = null); 27 | 28 | } 29 | 30 | public interface IAvapiResponse_TIME_SERIES_INTRADAY 31 | { 32 | string LastHttpRequest 33 | { 34 | get; 35 | } 36 | 37 | string RawData 38 | { 39 | get; 40 | } 41 | 42 | IAvapiResponse_TIME_SERIES_INTRADAY_Content Data 43 | { 44 | get; 45 | } 46 | } 47 | 48 | public interface IAvapiResponse_TIME_SERIES_INTRADAY_Content 49 | { 50 | bool Error 51 | { 52 | get; 53 | } 54 | 55 | string ErrorMessage 56 | { 57 | get; 58 | } 59 | 60 | MetaData_Type_TIME_SERIES_INTRADAY MetaData 61 | { 62 | get; 63 | } 64 | 65 | IList TimeSeries 66 | { 67 | get; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Avapi/TIME_SERIES_MONTHLY/Const_TIME_SERIES_MONTHLY.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiTIME_SERIES_MONTHLY 2 | { 3 | public static class Const_TIME_SERIES_MONTHLY 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Avapi/TIME_SERIES_MONTHLY/Impl_TIME_SERIES_MONTHLY.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Net.Http; 5 | using Newtonsoft.Json; 6 | using System.Threading.Tasks; 7 | using Newtonsoft.Json.Linq; 8 | 9 | namespace Avapi.AvapiTIME_SERIES_MONTHLY 10 | { 11 | internal class AvapiResponse_TIME_SERIES_MONTHLY : IAvapiResponse_TIME_SERIES_MONTHLY 12 | { 13 | public string LastHttpRequest 14 | { 15 | get; 16 | internal set; 17 | 18 | } 19 | public string RawData 20 | { 21 | get; 22 | internal set; 23 | } 24 | 25 | public IAvapiResponse_TIME_SERIES_MONTHLY_Content Data 26 | { 27 | get; 28 | internal set; 29 | } 30 | } 31 | 32 | public class MetaData_Type_TIME_SERIES_MONTHLY 33 | { 34 | public string Information 35 | { 36 | internal set; 37 | get; 38 | } 39 | 40 | public string Symbol 41 | { 42 | internal set; 43 | get; 44 | } 45 | 46 | public string LastRefreshed 47 | { 48 | internal set; 49 | get; 50 | } 51 | 52 | public string TimeZone 53 | { 54 | internal set; 55 | get; 56 | } 57 | 58 | } 59 | 60 | public class TimeSeries_Type_TIME_SERIES_MONTHLY 61 | { 62 | public string open 63 | { 64 | internal set; 65 | get; 66 | } 67 | 68 | public string high 69 | { 70 | internal set; 71 | get; 72 | } 73 | 74 | public string low 75 | { 76 | internal set; 77 | get; 78 | } 79 | 80 | public string close 81 | { 82 | internal set; 83 | get; 84 | } 85 | 86 | public string volume 87 | { 88 | internal set; 89 | get; 90 | } 91 | 92 | public string DateTime 93 | { 94 | internal set; 95 | get; 96 | } 97 | 98 | } 99 | 100 | internal class AvapiResponse_TIME_SERIES_MONTHLY_Content : IAvapiResponse_TIME_SERIES_MONTHLY_Content 101 | { 102 | internal AvapiResponse_TIME_SERIES_MONTHLY_Content() 103 | { 104 | MetaData = new MetaData_Type_TIME_SERIES_MONTHLY(); 105 | TimeSeries = new List(); 106 | } 107 | 108 | public MetaData_Type_TIME_SERIES_MONTHLY MetaData 109 | { 110 | internal set; 111 | get; 112 | } 113 | 114 | public IList TimeSeries 115 | { 116 | internal set; 117 | get; 118 | } 119 | 120 | public bool Error 121 | { 122 | internal set; 123 | get; 124 | } 125 | 126 | public string ErrorMessage 127 | { 128 | internal set; 129 | get; 130 | } 131 | } 132 | 133 | public class Impl_TIME_SERIES_MONTHLY : Int_TIME_SERIES_MONTHLY 134 | { 135 | const string s_function = "TIME_SERIES_MONTHLY"; 136 | 137 | internal static string ApiKey 138 | { 139 | get; 140 | set; 141 | } 142 | 143 | internal static HttpClient RestClient 144 | { 145 | get; 146 | set; 147 | } 148 | 149 | internal static string AvapiUrl 150 | { 151 | get; 152 | set; 153 | } 154 | 155 | private static readonly Lazy s_Impl_TIME_SERIES_MONTHLY = 156 | new Lazy(() => new Impl_TIME_SERIES_MONTHLY()); 157 | public static Impl_TIME_SERIES_MONTHLY Instance 158 | { 159 | get 160 | { 161 | return s_Impl_TIME_SERIES_MONTHLY.Value; 162 | } 163 | } 164 | private Impl_TIME_SERIES_MONTHLY() 165 | { 166 | } 167 | 168 | 169 | public IAvapiResponse_TIME_SERIES_MONTHLY QueryPrimitive( 170 | string symbol) 171 | { 172 | // Build Base Uri 173 | string queryString = AvapiUrl + "/query"; 174 | 175 | // Build query parameters 176 | IDictionary getParameters = new Dictionary(); 177 | getParameters.Add(new KeyValuePair("function", s_function)); 178 | getParameters.Add(new KeyValuePair("apikey", ApiKey)); 179 | getParameters.Add(new KeyValuePair("symbol",symbol)); 180 | queryString += UrlUtility.AsQueryString(getParameters); 181 | 182 | // Sent the Request and get the raw data from the Response 183 | string response = RestClient?. 184 | GetAsync(queryString)?. 185 | Result?. 186 | Content?. 187 | ReadAsStringAsync()?. 188 | Result; 189 | 190 | IAvapiResponse_TIME_SERIES_MONTHLY ret = new AvapiResponse_TIME_SERIES_MONTHLY 191 | { 192 | RawData = response, 193 | Data = ParseInternal(response), 194 | LastHttpRequest = queryString 195 | }; 196 | 197 | return ret; 198 | } 199 | 200 | public async Task QueryPrimitiveAsync( 201 | string symbol) 202 | { 203 | // Build Base Uri 204 | string queryString = AvapiUrl + "/query"; 205 | 206 | // Build query parameters 207 | IDictionary getParameters = new Dictionary(); 208 | getParameters.Add(new KeyValuePair("function", s_function)); 209 | getParameters.Add(new KeyValuePair("apikey", ApiKey)); 210 | getParameters.Add(new KeyValuePair("symbol",symbol)); 211 | queryString += UrlUtility.AsQueryString(getParameters); 212 | 213 | string response; 214 | using (var result = await RestClient.GetAsync(queryString)) 215 | { 216 | response = await result.Content.ReadAsStringAsync(); 217 | } 218 | IAvapiResponse_TIME_SERIES_MONTHLY ret = new AvapiResponse_TIME_SERIES_MONTHLY 219 | { 220 | RawData = response, 221 | Data = ParseInternal(response), 222 | LastHttpRequest = queryString 223 | }; 224 | 225 | return ret; 226 | } 227 | 228 | static internal IAvapiResponse_TIME_SERIES_MONTHLY_Content ParseInternal(string jsonInput) 229 | { 230 | if (string.IsNullOrEmpty(jsonInput)) 231 | { 232 | return null; 233 | } 234 | if(jsonInput == "{}") 235 | { 236 | return null; 237 | } 238 | 239 | AvapiResponse_TIME_SERIES_MONTHLY_Content ret = new AvapiResponse_TIME_SERIES_MONTHLY_Content(); 240 | JObject jsonInputParsed = JObject.Parse(jsonInput); 241 | string errorMessage = (string)jsonInputParsed["Error Message"]; 242 | if (!string.IsNullOrEmpty(errorMessage)) 243 | { 244 | ret.Error = true; 245 | ret.ErrorMessage = errorMessage; 246 | } 247 | else 248 | { 249 | JToken metaData = jsonInputParsed["Meta Data"]; 250 | ret.MetaData.Information = (string)metaData["1. Information"]; 251 | ret.MetaData.Symbol = (string)metaData["2. Symbol"]; 252 | ret.MetaData.LastRefreshed = (string)metaData["3. Last Refreshed"]; 253 | ret.MetaData.TimeZone = (string)metaData["4. Time Zone"]; 254 | string timeSeries = "Monthly Time Series"; 255 | JEnumerable results = jsonInputParsed[timeSeries].Children(); 256 | foreach (JToken result in results) 257 | { 258 | TimeSeries_Type_TIME_SERIES_MONTHLY timeseries = new TimeSeries_Type_TIME_SERIES_MONTHLY 259 | { 260 | DateTime = ((JProperty)result).Name, 261 | open = (string)result.First["1. open"], 262 | high = (string)result.First["2. high"], 263 | low = (string)result.First["3. low"], 264 | close = (string)result.First["4. close"], 265 | volume = (string)result.First["5. volume"] 266 | }; 267 | ret.TimeSeries.Add(timeseries); 268 | } 269 | } 270 | return ret; 271 | } 272 | } 273 | } -------------------------------------------------------------------------------- /Avapi/TIME_SERIES_MONTHLY/Int_TIME_SERIES_MONTHLY.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiTIME_SERIES_MONTHLY 4 | { 5 | public interface Int_TIME_SERIES_MONTHLY 6 | { 7 | 8 | IAvapiResponse_TIME_SERIES_MONTHLY QueryPrimitive( 9 | string symbol); 10 | 11 | Task QueryPrimitiveAsync( 12 | string symbol); 13 | 14 | } 15 | 16 | public interface IAvapiResponse_TIME_SERIES_MONTHLY 17 | { 18 | string LastHttpRequest 19 | { 20 | get; 21 | } 22 | 23 | string RawData 24 | { 25 | get; 26 | } 27 | 28 | IAvapiResponse_TIME_SERIES_MONTHLY_Content Data 29 | { 30 | get; 31 | } 32 | } 33 | 34 | public interface IAvapiResponse_TIME_SERIES_MONTHLY_Content 35 | { 36 | bool Error 37 | { 38 | get; 39 | } 40 | 41 | string ErrorMessage 42 | { 43 | get; 44 | } 45 | 46 | MetaData_Type_TIME_SERIES_MONTHLY MetaData 47 | { 48 | get; 49 | } 50 | 51 | IList TimeSeries 52 | { 53 | get; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Avapi/TIME_SERIES_MONTHLY_ADJUSTED/Const_TIME_SERIES_MONTHLY_ADJUSTED.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiTIME_SERIES_MONTHLY_ADJUSTED 2 | { 3 | public static class Const_TIME_SERIES_MONTHLY_ADJUSTED 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Avapi/TIME_SERIES_MONTHLY_ADJUSTED/Int_TIME_SERIES_MONTHLY_ADJUSTED.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiTIME_SERIES_MONTHLY_ADJUSTED 4 | { 5 | public interface Int_TIME_SERIES_MONTHLY_ADJUSTED 6 | { 7 | 8 | IAvapiResponse_TIME_SERIES_MONTHLY_ADJUSTED QueryPrimitive( 9 | string symbol); 10 | 11 | Task QueryPrimitiveAsync( 12 | string symbol); 13 | 14 | } 15 | 16 | public interface IAvapiResponse_TIME_SERIES_MONTHLY_ADJUSTED 17 | { 18 | string LastHttpRequest 19 | { 20 | get; 21 | } 22 | 23 | string RawData 24 | { 25 | get; 26 | } 27 | 28 | IAvapiResponse_TIME_SERIES_MONTHLY_ADJUSTED_Content Data 29 | { 30 | get; 31 | } 32 | } 33 | 34 | public interface IAvapiResponse_TIME_SERIES_MONTHLY_ADJUSTED_Content 35 | { 36 | bool Error 37 | { 38 | get; 39 | } 40 | 41 | string ErrorMessage 42 | { 43 | get; 44 | } 45 | 46 | MetaData_Type_TIME_SERIES_MONTHLY_ADJUSTED MetaData 47 | { 48 | get; 49 | } 50 | 51 | IList TimeSeries 52 | { 53 | get; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Avapi/TIME_SERIES_WEEKLY/Const_TIME_SERIES_WEEKLY.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiTIME_SERIES_WEEKLY 2 | { 3 | public static class Const_TIME_SERIES_WEEKLY 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Avapi/TIME_SERIES_WEEKLY/Impl_TIME_SERIES_WEEKLY.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Net.Http; 5 | using Newtonsoft.Json; 6 | using System.Threading.Tasks; 7 | using Newtonsoft.Json.Linq; 8 | 9 | namespace Avapi.AvapiTIME_SERIES_WEEKLY 10 | { 11 | internal class AvapiResponse_TIME_SERIES_WEEKLY : IAvapiResponse_TIME_SERIES_WEEKLY 12 | { 13 | public string LastHttpRequest 14 | { 15 | get; 16 | internal set; 17 | 18 | } 19 | public string RawData 20 | { 21 | get; 22 | internal set; 23 | } 24 | 25 | public IAvapiResponse_TIME_SERIES_WEEKLY_Content Data 26 | { 27 | get; 28 | internal set; 29 | } 30 | } 31 | 32 | public class MetaData_Type_TIME_SERIES_WEEKLY 33 | { 34 | public string Information 35 | { 36 | internal set; 37 | get; 38 | } 39 | 40 | public string Symbol 41 | { 42 | internal set; 43 | get; 44 | } 45 | 46 | public string LastRefreshed 47 | { 48 | internal set; 49 | get; 50 | } 51 | 52 | public string TimeZone 53 | { 54 | internal set; 55 | get; 56 | } 57 | 58 | } 59 | 60 | public class TimeSeries_Type_TIME_SERIES_WEEKLY 61 | { 62 | public string open 63 | { 64 | internal set; 65 | get; 66 | } 67 | 68 | public string high 69 | { 70 | internal set; 71 | get; 72 | } 73 | 74 | public string low 75 | { 76 | internal set; 77 | get; 78 | } 79 | 80 | public string close 81 | { 82 | internal set; 83 | get; 84 | } 85 | 86 | public string volume 87 | { 88 | internal set; 89 | get; 90 | } 91 | 92 | public string DateTime 93 | { 94 | internal set; 95 | get; 96 | } 97 | 98 | } 99 | 100 | internal class AvapiResponse_TIME_SERIES_WEEKLY_Content : IAvapiResponse_TIME_SERIES_WEEKLY_Content 101 | { 102 | internal AvapiResponse_TIME_SERIES_WEEKLY_Content() 103 | { 104 | MetaData = new MetaData_Type_TIME_SERIES_WEEKLY(); 105 | TimeSeries = new List(); 106 | } 107 | 108 | public MetaData_Type_TIME_SERIES_WEEKLY MetaData 109 | { 110 | internal set; 111 | get; 112 | } 113 | 114 | public IList TimeSeries 115 | { 116 | internal set; 117 | get; 118 | } 119 | 120 | public bool Error 121 | { 122 | internal set; 123 | get; 124 | } 125 | 126 | public string ErrorMessage 127 | { 128 | internal set; 129 | get; 130 | } 131 | } 132 | 133 | public class Impl_TIME_SERIES_WEEKLY : Int_TIME_SERIES_WEEKLY 134 | { 135 | const string s_function = "TIME_SERIES_WEEKLY"; 136 | 137 | internal static string ApiKey 138 | { 139 | get; 140 | set; 141 | } 142 | 143 | internal static HttpClient RestClient 144 | { 145 | get; 146 | set; 147 | } 148 | 149 | internal static string AvapiUrl 150 | { 151 | get; 152 | set; 153 | } 154 | 155 | private static readonly Lazy s_Impl_TIME_SERIES_WEEKLY = 156 | new Lazy(() => new Impl_TIME_SERIES_WEEKLY()); 157 | public static Impl_TIME_SERIES_WEEKLY Instance 158 | { 159 | get 160 | { 161 | return s_Impl_TIME_SERIES_WEEKLY.Value; 162 | } 163 | } 164 | private Impl_TIME_SERIES_WEEKLY() 165 | { 166 | } 167 | 168 | 169 | public IAvapiResponse_TIME_SERIES_WEEKLY QueryPrimitive( 170 | string symbol) 171 | { 172 | // Build Base Uri 173 | string queryString = AvapiUrl + "/query"; 174 | 175 | // Build query parameters 176 | IDictionary getParameters = new Dictionary(); 177 | getParameters.Add(new KeyValuePair("function", s_function)); 178 | getParameters.Add(new KeyValuePair("apikey", ApiKey)); 179 | getParameters.Add(new KeyValuePair("symbol",symbol)); 180 | queryString += UrlUtility.AsQueryString(getParameters); 181 | 182 | // Sent the Request and get the raw data from the Response 183 | string response = RestClient?. 184 | GetAsync(queryString)?. 185 | Result?. 186 | Content?. 187 | ReadAsStringAsync()?. 188 | Result; 189 | 190 | IAvapiResponse_TIME_SERIES_WEEKLY ret = new AvapiResponse_TIME_SERIES_WEEKLY 191 | { 192 | RawData = response, 193 | Data = ParseInternal(response), 194 | LastHttpRequest = queryString 195 | }; 196 | 197 | return ret; 198 | } 199 | 200 | public async Task QueryPrimitiveAsync( 201 | string symbol) 202 | { 203 | // Build Base Uri 204 | string queryString = AvapiUrl + "/query"; 205 | 206 | // Build query parameters 207 | IDictionary getParameters = new Dictionary(); 208 | getParameters.Add(new KeyValuePair("function", s_function)); 209 | getParameters.Add(new KeyValuePair("apikey", ApiKey)); 210 | getParameters.Add(new KeyValuePair("symbol",symbol)); 211 | queryString += UrlUtility.AsQueryString(getParameters); 212 | 213 | string response; 214 | using (var result = await RestClient.GetAsync(queryString)) 215 | { 216 | response = await result.Content.ReadAsStringAsync(); 217 | } 218 | IAvapiResponse_TIME_SERIES_WEEKLY ret = new AvapiResponse_TIME_SERIES_WEEKLY 219 | { 220 | RawData = response, 221 | Data = ParseInternal(response), 222 | LastHttpRequest = queryString 223 | }; 224 | 225 | return ret; 226 | } 227 | 228 | static internal IAvapiResponse_TIME_SERIES_WEEKLY_Content ParseInternal(string jsonInput) 229 | { 230 | if (string.IsNullOrEmpty(jsonInput)) 231 | { 232 | return null; 233 | } 234 | if(jsonInput == "{}") 235 | { 236 | return null; 237 | } 238 | 239 | AvapiResponse_TIME_SERIES_WEEKLY_Content ret = new AvapiResponse_TIME_SERIES_WEEKLY_Content(); 240 | JObject jsonInputParsed = JObject.Parse(jsonInput); 241 | string errorMessage = (string)jsonInputParsed["Error Message"]; 242 | if (!string.IsNullOrEmpty(errorMessage)) 243 | { 244 | ret.Error = true; 245 | ret.ErrorMessage = errorMessage; 246 | } 247 | else 248 | { 249 | JToken metaData = jsonInputParsed["Meta Data"]; 250 | ret.MetaData.Information = (string)metaData["1. Information"]; 251 | ret.MetaData.Symbol = (string)metaData["2. Symbol"]; 252 | ret.MetaData.LastRefreshed = (string)metaData["3. Last Refreshed"]; 253 | ret.MetaData.TimeZone = (string)metaData["4. Time Zone"]; 254 | string timeSeries = "Weekly Time Series"; 255 | JEnumerable results = jsonInputParsed[timeSeries].Children(); 256 | foreach (JToken result in results) 257 | { 258 | TimeSeries_Type_TIME_SERIES_WEEKLY timeseries = new TimeSeries_Type_TIME_SERIES_WEEKLY 259 | { 260 | DateTime = ((JProperty)result).Name, 261 | open = (string)result.First["1. open"], 262 | high = (string)result.First["2. high"], 263 | low = (string)result.First["3. low"], 264 | close = (string)result.First["4. close"], 265 | volume = (string)result.First["5. volume"] 266 | }; 267 | ret.TimeSeries.Add(timeseries); 268 | } 269 | } 270 | return ret; 271 | } 272 | } 273 | } -------------------------------------------------------------------------------- /Avapi/TIME_SERIES_WEEKLY/Int_TIME_SERIES_WEEKLY.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiTIME_SERIES_WEEKLY 4 | { 5 | public interface Int_TIME_SERIES_WEEKLY 6 | { 7 | 8 | IAvapiResponse_TIME_SERIES_WEEKLY QueryPrimitive( 9 | string symbol); 10 | 11 | Task QueryPrimitiveAsync( 12 | string symbol); 13 | 14 | } 15 | 16 | public interface IAvapiResponse_TIME_SERIES_WEEKLY 17 | { 18 | string LastHttpRequest 19 | { 20 | get; 21 | } 22 | 23 | string RawData 24 | { 25 | get; 26 | } 27 | 28 | IAvapiResponse_TIME_SERIES_WEEKLY_Content Data 29 | { 30 | get; 31 | } 32 | } 33 | 34 | public interface IAvapiResponse_TIME_SERIES_WEEKLY_Content 35 | { 36 | bool Error 37 | { 38 | get; 39 | } 40 | 41 | string ErrorMessage 42 | { 43 | get; 44 | } 45 | 46 | MetaData_Type_TIME_SERIES_WEEKLY MetaData 47 | { 48 | get; 49 | } 50 | 51 | IList TimeSeries 52 | { 53 | get; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Avapi/TIME_SERIES_WEEKLY_ADJUSTED/Const_TIME_SERIES_WEEKLY_ADJUSTED.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiTIME_SERIES_WEEKLY_ADJUSTED 2 | { 3 | public static class Const_TIME_SERIES_WEEKLY_ADJUSTED 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Avapi/TIME_SERIES_WEEKLY_ADJUSTED/Int_TIME_SERIES_WEEKLY_ADJUSTED.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiTIME_SERIES_WEEKLY_ADJUSTED 4 | { 5 | public interface Int_TIME_SERIES_WEEKLY_ADJUSTED 6 | { 7 | 8 | IAvapiResponse_TIME_SERIES_WEEKLY_ADJUSTED QueryPrimitive( 9 | string symbol); 10 | 11 | Task QueryPrimitiveAsync( 12 | string symbol); 13 | 14 | } 15 | 16 | public interface IAvapiResponse_TIME_SERIES_WEEKLY_ADJUSTED 17 | { 18 | string LastHttpRequest 19 | { 20 | get; 21 | } 22 | 23 | string RawData 24 | { 25 | get; 26 | } 27 | 28 | IAvapiResponse_TIME_SERIES_WEEKLY_ADJUSTED_Content Data 29 | { 30 | get; 31 | } 32 | } 33 | 34 | public interface IAvapiResponse_TIME_SERIES_WEEKLY_ADJUSTED_Content 35 | { 36 | bool Error 37 | { 38 | get; 39 | } 40 | 41 | string ErrorMessage 42 | { 43 | get; 44 | } 45 | 46 | MetaData_Type_TIME_SERIES_WEEKLY_ADJUSTED MetaData 47 | { 48 | get; 49 | } 50 | 51 | IList TimeSeries 52 | { 53 | get; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Avapi/TRANGE/Const_TRANGE.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiTRANGE 2 | { 3 | public static class Const_TRANGE 4 | { 5 | public enum TRANGE_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Avapi/TRANGE/Int_TRANGE.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiTRANGE 4 | { 5 | public interface Int_TRANGE 6 | { 7 | IAvapiResponse_TRANGE Query( 8 | string symbol, 9 | Const_TRANGE.TRANGE_interval interval); 10 | 11 | Task QueryAsync( 12 | string symbol, 13 | Const_TRANGE.TRANGE_interval interval); 14 | 15 | 16 | IAvapiResponse_TRANGE QueryPrimitive( 17 | string symbol, 18 | string interval); 19 | 20 | Task QueryPrimitiveAsync( 21 | string symbol, 22 | string interval); 23 | 24 | } 25 | 26 | public interface IAvapiResponse_TRANGE 27 | { 28 | string LastHttpRequest 29 | { 30 | get; 31 | } 32 | 33 | string RawData 34 | { 35 | get; 36 | } 37 | 38 | IAvapiResponse_TRANGE_Content Data 39 | { 40 | get; 41 | } 42 | } 43 | 44 | public interface IAvapiResponse_TRANGE_Content 45 | { 46 | bool Error 47 | { 48 | get; 49 | } 50 | 51 | string ErrorMessage 52 | { 53 | get; 54 | } 55 | 56 | MetaData_Type_TRANGE MetaData 57 | { 58 | get; 59 | } 60 | 61 | IList TechnicalIndicator 62 | { 63 | get; 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Avapi/TRIMA/Const_TRIMA.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiTRIMA 2 | { 3 | public static class Const_TRIMA 4 | { 5 | public enum TRIMA_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum TRIMA_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Avapi/TRIMA/Int_TRIMA.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiTRIMA 4 | { 5 | public interface Int_TRIMA 6 | { 7 | IAvapiResponse_TRIMA Query( 8 | string symbol, 9 | Const_TRIMA.TRIMA_interval interval, 10 | int time_period, 11 | Const_TRIMA.TRIMA_series_type series_type); 12 | 13 | Task QueryAsync( 14 | string symbol, 15 | Const_TRIMA.TRIMA_interval interval, 16 | int time_period, 17 | Const_TRIMA.TRIMA_series_type series_type); 18 | 19 | 20 | IAvapiResponse_TRIMA QueryPrimitive( 21 | string symbol, 22 | string interval, 23 | int time_period, 24 | string series_type); 25 | 26 | Task QueryPrimitiveAsync( 27 | string symbol, 28 | string interval, 29 | int time_period, 30 | string series_type); 31 | 32 | } 33 | 34 | public interface IAvapiResponse_TRIMA 35 | { 36 | string LastHttpRequest 37 | { 38 | get; 39 | } 40 | 41 | string RawData 42 | { 43 | get; 44 | } 45 | 46 | IAvapiResponse_TRIMA_Content Data 47 | { 48 | get; 49 | } 50 | } 51 | 52 | public interface IAvapiResponse_TRIMA_Content 53 | { 54 | bool Error 55 | { 56 | get; 57 | } 58 | 59 | string ErrorMessage 60 | { 61 | get; 62 | } 63 | 64 | MetaData_Type_TRIMA MetaData 65 | { 66 | get; 67 | } 68 | 69 | IList TechnicalIndicator 70 | { 71 | get; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Avapi/TRIX/Const_TRIX.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiTRIX 2 | { 3 | public static class Const_TRIX 4 | { 5 | public enum TRIX_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum TRIX_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Avapi/TRIX/Int_TRIX.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiTRIX 4 | { 5 | public interface Int_TRIX 6 | { 7 | IAvapiResponse_TRIX Query( 8 | string symbol, 9 | Const_TRIX.TRIX_interval interval, 10 | int time_period, 11 | Const_TRIX.TRIX_series_type series_type); 12 | 13 | Task QueryAsync( 14 | string symbol, 15 | Const_TRIX.TRIX_interval interval, 16 | int time_period, 17 | Const_TRIX.TRIX_series_type series_type); 18 | 19 | 20 | IAvapiResponse_TRIX QueryPrimitive( 21 | string symbol, 22 | string interval, 23 | int time_period, 24 | string series_type); 25 | 26 | Task QueryPrimitiveAsync( 27 | string symbol, 28 | string interval, 29 | int time_period, 30 | string series_type); 31 | 32 | } 33 | 34 | public interface IAvapiResponse_TRIX 35 | { 36 | string LastHttpRequest 37 | { 38 | get; 39 | } 40 | 41 | string RawData 42 | { 43 | get; 44 | } 45 | 46 | IAvapiResponse_TRIX_Content Data 47 | { 48 | get; 49 | } 50 | } 51 | 52 | public interface IAvapiResponse_TRIX_Content 53 | { 54 | bool Error 55 | { 56 | get; 57 | } 58 | 59 | string ErrorMessage 60 | { 61 | get; 62 | } 63 | 64 | MetaData_Type_TRIX MetaData 65 | { 66 | get; 67 | } 68 | 69 | IList TechnicalIndicator 70 | { 71 | get; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Avapi/ULTOSC/Const_ULTOSC.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiULTOSC 2 | { 3 | public static class Const_ULTOSC 4 | { 5 | public enum ULTOSC_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Avapi/ULTOSC/Int_ULTOSC.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiULTOSC 4 | { 5 | public interface Int_ULTOSC 6 | { 7 | IAvapiResponse_ULTOSC Query( 8 | string symbol, 9 | Const_ULTOSC.ULTOSC_interval interval, 10 | int timeperiod1 = -1, 11 | int timeperiod2 = -1, 12 | int timeperiod3 = -1); 13 | 14 | Task QueryAsync( 15 | string symbol, 16 | Const_ULTOSC.ULTOSC_interval interval, 17 | int timeperiod1 = -1, 18 | int timeperiod2 = -1, 19 | int timeperiod3 = -1); 20 | 21 | 22 | IAvapiResponse_ULTOSC QueryPrimitive( 23 | string symbol, 24 | string interval, 25 | int timeperiod1 = -1, 26 | int timeperiod2 = -1, 27 | int timeperiod3 = -1); 28 | 29 | Task QueryPrimitiveAsync( 30 | string symbol, 31 | string interval, 32 | int timeperiod1 = -1, 33 | int timeperiod2 = -1, 34 | int timeperiod3 = -1); 35 | 36 | } 37 | 38 | public interface IAvapiResponse_ULTOSC 39 | { 40 | string LastHttpRequest 41 | { 42 | get; 43 | } 44 | 45 | string RawData 46 | { 47 | get; 48 | } 49 | 50 | IAvapiResponse_ULTOSC_Content Data 51 | { 52 | get; 53 | } 54 | } 55 | 56 | public interface IAvapiResponse_ULTOSC_Content 57 | { 58 | bool Error 59 | { 60 | get; 61 | } 62 | 63 | string ErrorMessage 64 | { 65 | get; 66 | } 67 | 68 | MetaData_Type_ULTOSC MetaData 69 | { 70 | get; 71 | } 72 | 73 | IList TechnicalIndicator 74 | { 75 | get; 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Avapi/Utility.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Net; 4 | using System.Text; 5 | 6 | namespace Avapi 7 | { 8 | internal static class UrlUtility 9 | { 10 | internal static string AsQueryString(IDictionary parameters) 11 | { 12 | if (!parameters.Any()) 13 | return ""; 14 | 15 | var builder = new StringBuilder("?"); 16 | 17 | var separator = ""; 18 | foreach (var kvp in parameters.Where(kvp => kvp.Value != null)) 19 | { 20 | builder.AppendFormat("{0}{1}={2}", separator, WebUtility.UrlEncode(kvp.Key), WebUtility.UrlEncode(kvp.Value.ToString())); 21 | 22 | separator = "&"; 23 | } 24 | return builder.ToString(); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Avapi/WILLR/Const_WILLR.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiWILLR 2 | { 3 | public static class Const_WILLR 4 | { 5 | public enum WILLR_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Avapi/WILLR/Int_WILLR.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiWILLR 4 | { 5 | public interface Int_WILLR 6 | { 7 | IAvapiResponse_WILLR Query( 8 | string symbol, 9 | Const_WILLR.WILLR_interval interval, 10 | int time_period); 11 | 12 | Task QueryAsync( 13 | string symbol, 14 | Const_WILLR.WILLR_interval interval, 15 | int time_period); 16 | 17 | 18 | IAvapiResponse_WILLR QueryPrimitive( 19 | string symbol, 20 | string interval, 21 | int time_period); 22 | 23 | Task QueryPrimitiveAsync( 24 | string symbol, 25 | string interval, 26 | int time_period); 27 | 28 | } 29 | 30 | public interface IAvapiResponse_WILLR 31 | { 32 | string LastHttpRequest 33 | { 34 | get; 35 | } 36 | 37 | string RawData 38 | { 39 | get; 40 | } 41 | 42 | IAvapiResponse_WILLR_Content Data 43 | { 44 | get; 45 | } 46 | } 47 | 48 | public interface IAvapiResponse_WILLR_Content 49 | { 50 | bool Error 51 | { 52 | get; 53 | } 54 | 55 | string ErrorMessage 56 | { 57 | get; 58 | } 59 | 60 | MetaData_Type_WILLR MetaData 61 | { 62 | get; 63 | } 64 | 65 | IList TechnicalIndicator 66 | { 67 | get; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Avapi/WMA/Const_WMA.cs: -------------------------------------------------------------------------------- 1 | namespace Avapi.AvapiWMA 2 | { 3 | public static class Const_WMA 4 | { 5 | public enum WMA_interval 6 | { 7 | none, 8 | n_1min, 9 | n_5min, 10 | n_15min, 11 | n_30min, 12 | n_60min, 13 | daily, 14 | weekly, 15 | monthly 16 | } 17 | public enum WMA_series_type 18 | { 19 | none, 20 | close, 21 | open, 22 | high, 23 | low 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Avapi/WMA/Int_WMA.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | namespace Avapi.AvapiWMA 4 | { 5 | public interface Int_WMA 6 | { 7 | IAvapiResponse_WMA Query( 8 | string symbol, 9 | Const_WMA.WMA_interval interval, 10 | int time_period, 11 | Const_WMA.WMA_series_type series_type); 12 | 13 | Task QueryAsync( 14 | string symbol, 15 | Const_WMA.WMA_interval interval, 16 | int time_period, 17 | Const_WMA.WMA_series_type series_type); 18 | 19 | 20 | IAvapiResponse_WMA QueryPrimitive( 21 | string symbol, 22 | string interval, 23 | int time_period, 24 | string series_type); 25 | 26 | Task QueryPrimitiveAsync( 27 | string symbol, 28 | string interval, 29 | int time_period, 30 | string series_type); 31 | 32 | } 33 | 34 | public interface IAvapiResponse_WMA 35 | { 36 | string LastHttpRequest 37 | { 38 | get; 39 | } 40 | 41 | string RawData 42 | { 43 | get; 44 | } 45 | 46 | IAvapiResponse_WMA_Content Data 47 | { 48 | get; 49 | } 50 | } 51 | 52 | public interface IAvapiResponse_WMA_Content 53 | { 54 | bool Error 55 | { 56 | get; 57 | } 58 | 59 | string ErrorMessage 60 | { 61 | get; 62 | } 63 | 64 | MetaData_Type_WMA MetaData 65 | { 66 | get; 67 | } 68 | 69 | IList TechnicalIndicator 70 | { 71 | get; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Avapi/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0-*", 3 | 4 | "dependencies": { 5 | "NETStandard.Library": "1.6.0" 6 | }, 7 | 8 | "frameworks": { 9 | "netstandard1.6": { 10 | "imports": "dnxcore50" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Simone Giuliani and Antonio Papa 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Avapi (.NET CORE) 2 | Avapi is a .NET CORE API Wrapper allowing to retrieve data from Alpha Vantage endpoint (https://www.alphavantage.co/). 3 | 4 | To start using Avapi you just need to: 5 | * Register to Alpha Vantage web site and get your personal api key (https://www.alphavantage.co/support/#api-key). It's for free! 6 | * Install Avapi package on your project 7 | * Consume the Avapi library 8 | 9 | To see the complete documentation of Avapi .NET CORE click [here](https://github.com/sgiulians/AvapiDotNetCore/wiki) 10 | 11 | ## Register to Alpha Vantage 12 | To Claim the Alpha Vantage free API key, you should register [here](https://www.alphavantage.co/support/#api-key) 13 | 14 | 15 | ## Install AVAPI .NET CORE 16 | You can manually download the official package [here](https://www.nuget.org/packages/Avapi/). 17 | 18 | ... or you can get it from the .NET CLI or from the Package Manager. 19 | 20 | ### from the .NET CLI 21 | ``` 22 | dotnet add package Avapi 23 | ``` 24 | ### from the Package Manager 25 | ``` 26 | Install-Package Avapi 27 | ``` 28 | 29 | ## Guided Example on how to consume Avapi library 30 | There are a number of steps you need to follow to use Avapi on .NET CORE environment: 31 | 32 | 1. Create an empty folder. Get into that folder and run the following command: 33 | ``` 34 | dotnet new console 35 | ``` 36 | 37 | 2. Add the package to your project 38 | ``` 39 | dotnet add package Avapi 40 | ``` 41 | 42 | 3. Restore the project 43 | ``` 44 | dotnet restore 45 | ``` 46 | 47 | 4. Replace the content of Program.cs created automatically by 1. with the following code: 48 | ```csharp 49 | 50 | using System; 51 | using System.IO; 52 | using Avapi.AvapiTIME_SERIES_DAILY; 53 | 54 | namespace Avapi 55 | { 56 | public class Example 57 | { 58 | static void Main() 59 | { 60 | // Creating the connection object 61 | IAvapiConnection connection = AvapiConnection.Instance; 62 | 63 | // Set up the connection and pass the API_KEY provided by alphavantage.co 64 | connection.Connect("Your Alpha Vantage API Key !!!!"); 65 | 66 | // Get the TIME_SERIES_DAILY query object 67 | Int_TIME_SERIES_DAILY time_series_daily = 68 | connection.GetQueryObject_TIME_SERIES_DAILY(); 69 | 70 | // Perform the TIME_SERIES_DAILY request and get the result 71 | IAvapiResponse_TIME_SERIES_DAILY time_series_dailyResponse = 72 | time_series_daily.Query( 73 | "MSFT", 74 | Const_TIME_SERIES_DAILY.TIME_SERIES_DAILY_outputsize.compact); 75 | 76 | // Printout the results 77 | Console.WriteLine("******** RAW DATA TIME_SERIES_DAILY ********"); 78 | Console.WriteLine(time_series_dailyResponse.RawData); 79 | 80 | Console.WriteLine("******** STRUCTURED DATA TIME_SERIES_DAILY ********"); 81 | var data = time_series_dailyResponse.Data; 82 | if (data.Error) 83 | { 84 | Console.WriteLine(data.ErrorMessage); 85 | } 86 | else 87 | { 88 | Console.WriteLine("Information: " + data.MetaData.Information); 89 | Console.WriteLine("Symbol: " + data.MetaData.Symbol); 90 | Console.WriteLine("LastRefreshed: " + data.MetaData.LastRefreshed); 91 | Console.WriteLine("OutputSize: " + data.MetaData.OutputSize); 92 | Console.WriteLine("TimeZone: " + data.MetaData.TimeZone); 93 | Console.WriteLine("========================"); 94 | Console.WriteLine("========================"); 95 | foreach (var timeseries in data.TimeSeries) 96 | { 97 | Console.WriteLine("open: " + timeseries.open); 98 | Console.WriteLine("high: " + timeseries.high); 99 | Console.WriteLine("low: " + timeseries.low); 100 | Console.WriteLine("close: " + timeseries.close); 101 | Console.WriteLine("volume: " + timeseries.volume); 102 | Console.WriteLine("DateTime: " + timeseries.DateTime); 103 | Console.WriteLine("========================"); 104 | } 105 | } 106 | } 107 | } 108 | } 109 | 110 | ``` 111 | and replace the parameter in **connection.Connect(""Your Alpha Vantage API Key !!!!")** , with your Alpha Vantage API key (to claim it see above). 112 | 113 | 5. Run the following commands: 114 | ``` 115 | dotnet run 116 | ``` 117 | 118 | 6. You can enjoy your _MSFT Daily time series_ displayed on your console :) 119 | *** 120 | 121 | **Authors**: Simone Giuliani and Antonio Papa 122 | 123 | **Email**: if you have any queries or suggestions please send us an email: sgiuliani.apapa at gmail.com 124 | -------------------------------------------------------------------------------- /tools/AvapiGenerator/AvapiConnection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace AvapiGenerator 5 | { 6 | public class AvapiConnection 7 | { 8 | static string str_prefix; 9 | static string str_postfix; 10 | static string str_content; 11 | static string basePath; 12 | 13 | public static void init(string path) 14 | { 15 | str_content = ""; 16 | basePath = path; 17 | init_prefix(); 18 | init_postfix(); 19 | } 20 | 21 | internal static void init_prefix() 22 | { 23 | str_prefix = "using System; \n"+ 24 | "using System.Net.Http;\n"+ 25 | "namespace Avapi\n"+ 26 | "{\n"+ 27 | "\tpublic class AvapiConnection : IAvapiConnection\n"+ 28 | "\t{\n"+ 29 | "\t\tprivate const string m_avapiUrlDefault = \"https://www.alphavantage.co\";\n"+ 30 | "\t\tprivate string m_avapiUrl;\n"+ 31 | "\t\tprivate HttpClient m_restClient;\n"+ 32 | "\t\tprivate static readonly Lazy s_avapiConnection =\n"+ 33 | "\t\t\tnew Lazy(() => new AvapiConnection());\n"+ 34 | "\t\tpublic static AvapiConnection Instance\n"+ 35 | "\t\t{\n"+ 36 | "\t\t\tget\n"+ 37 | "\t\t\t{\n"+ 38 | "\t\t\t\treturn s_avapiConnection.Value;\n"+ 39 | "\t\t\t}\n"+ 40 | "\t\t}\n"+ 41 | "\t\tprivate AvapiConnection()\n"+ 42 | "\t\t{\n"+ 43 | "\t\t}\n"+ 44 | "\t\tpublic string AvapiUrl\n"+ 45 | "\t\t{\n"+ 46 | "\t\t\tget\n"+ 47 | "\t\t\t{\n"+ 48 | "\t\t\t\tif (!string.IsNullOrEmpty(m_avapiUrl))\n"+ 49 | "\t\t\t\t{\n"+ 50 | "\t\t\t\t\treturn m_avapiUrl;\n"+ 51 | "\t\t\t\t}\n"+ 52 | "\t\t\t\treturn m_avapiUrlDefault;\n"+ 53 | "\t\t\t}\n"+ 54 | "\t\t\tset\n"+ 55 | "\t\t\t{\n"+ 56 | "\t\t\t\tm_avapiUrl = value;\n"+ 57 | "\t\t\t}\n"+ 58 | "\t\t}\n"+ 59 | "\t\tpublic string AvapiUrlDefault\n"+ 60 | "\t\t{\n"+ 61 | "\t\t\tget\n"+ 62 | "\t\t\t{\n"+ 63 | "\t\t\t\treturn m_avapiUrlDefault;\n"+ 64 | "\t\t\t}\n"+ 65 | "\t\t}\n"+ 66 | "\t\tpublic string ApiKey\n"+ 67 | "\t\t{\n"+ 68 | "\t\t\tget;\n"+ 69 | "\t\t\tset;\n"+ 70 | "\t\t}\n"+ 71 | "\t\tpublic void Connect(string apiKey)\n"+ 72 | "\t\t{\n"+ 73 | "\t\t\tm_restClient = new HttpClient();\n"+ 74 | "\t\t\tApiKey = apiKey;\n"+ 75 | "\t\t}\n"; 76 | } 77 | 78 | internal static void init_postfix() 79 | { 80 | str_postfix = "\t}\n" +"}\n"; 81 | } 82 | 83 | // Add an entry 84 | public static void add_str(string str) 85 | { 86 | str_content += str; 87 | } 88 | 89 | // Add an entry related with the operation.Name 90 | public static void add_entry(Operation operation) 91 | { 92 | str_content += "\t\tpublic Avapi" + operation.Name + ".Int_" + operation.Name + " GetQueryObject_" + operation.Name + "()" + "\n"; 93 | str_content += "\t\t{" + "\n"; 94 | str_content += "\t\t\tAvapi" + operation.Name + ".Impl_" + operation.Name + ".ApiKey = ApiKey;" + "\n"; 95 | str_content += "\t\t\tAvapi" + operation.Name + ".Impl_" + operation.Name + ".AvapiUrl = AvapiUrl;" + "\n"; 96 | str_content += "\t\t\tAvapi" + operation.Name + ".Impl_" + operation.Name + ".RestClient = m_restClient;" + "\n"; 97 | str_content += "\t\t\treturn Avapi" + operation.Name + ".Impl_" + operation.Name + ".Instance;" + "\n"; 98 | str_content += "\t\t}" + "\n"; 99 | } 100 | 101 | // create the AvapiConnection.cs file 102 | public static int create() 103 | { 104 | string projectPath = Path.Combine(basePath, "AvapiConnection.cs"); 105 | using (var fileStream = new FileStream(String.Format(projectPath), FileMode.Create)) 106 | using (StreamWriter writer = new StreamWriter(fileStream)) 107 | { 108 | writer.Write(str_prefix); 109 | writer.Write(str_content); 110 | writer.Write(str_postfix); 111 | } 112 | return 0; 113 | } 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /tools/AvapiGenerator/AvapiGenerator.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | netcoreapp1.1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /tools/AvapiGenerator/CodeGenerator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | 6 | namespace AvapiGenerator 7 | { 8 | public class CodeGenerator 9 | { 10 | private static string avapi_path; 11 | private static IList operations; 12 | private static string version; 13 | private static string releaseNotes; 14 | 15 | public static void initCodeGenerator(string destinationPath , IList list_operations 16 | ,string path_version) 17 | { 18 | avapi_path = destinationPath; 19 | Directory.CreateDirectory(destinationPath); 20 | operations = list_operations; 21 | 22 | try 23 | { 24 | version = File.ReadLines(path_version).First(); 25 | } 26 | catch(Exception ex) 27 | { 28 | Console.WriteLine($"Error: File.ReadLines({path_version}):{ex.Message}"); 29 | version = "0.0.0"; 30 | } 31 | 32 | try 33 | { 34 | releaseNotes = File.ReadLines(path_version).Skip(1).First(); 35 | } 36 | catch (Exception ex) 37 | { 38 | Console.WriteLine($"Error: File.ReadLines({path_version}):{ex.Message}"); 39 | releaseNotes = "No Release Notes"; 40 | } 41 | 42 | Csproj.init(avapi_path, version, releaseNotes); 43 | Utility.init(avapi_path); 44 | IAvapiConnection.init(avapi_path); 45 | AvapiConnection.init(avapi_path); 46 | } 47 | 48 | internal static string GenerateFolder(string basePath, string relativePath) 49 | { 50 | string pathFolder = Path.Combine(basePath, relativePath ); 51 | Directory.CreateDirectory(pathFolder); 52 | return pathFolder; 53 | } 54 | 55 | public static bool GenerateCode() 56 | { 57 | foreach (Operation operation in operations) 58 | { 59 | // Create a folder for the operation 60 | string pathFolder = GenerateFolder(avapi_path , operation.Name); 61 | if(string.IsNullOrEmpty(pathFolder)) 62 | { 63 | Console.WriteLine("Error: GenerateFolder("+ avapi_path + " , " + 64 | operation.Name + ")" ); 65 | return false; 66 | } 67 | 68 | // Create an Interface for the operation 69 | var file_interface = new InterfaceAvApi( pathFolder , operation); 70 | if(!file_interface.generate_interface(operation.Response)) 71 | { 72 | Console.WriteLine("Error: "+operation.Name+"generate_interface() "); 73 | return false; 74 | } 75 | 76 | // Create the constants for the operation 77 | var file_const = new Constant( pathFolder , operation); 78 | if(!file_const.generate_constant()) 79 | { 80 | Console.WriteLine("Error: "+operation.Name+"generate_constant() "); 81 | return false; 82 | } 83 | 84 | // Create the implementation for the operation 85 | var file_implement = new Implementation( pathFolder , operation); 86 | if(!file_implement.generate_implementation()) 87 | { 88 | Console.WriteLine("Error: "+operation.Name+"generate_implementation() "); 89 | return false; 90 | } 91 | 92 | AvapiConnection.add_entry(operation); 93 | IAvapiConnection.add_entry(operation); 94 | } 95 | 96 | // Create AvapiConnection.cs 97 | AvapiConnection.create(); 98 | 99 | // Create IAvapiConnection.cs 100 | IAvapiConnection.create(); 101 | 102 | // Create Utility.cs 103 | Utility.create(); 104 | 105 | // Create main project 106 | Csproj.create(); 107 | 108 | return true; 109 | } 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /tools/AvapiGenerator/Constant.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace AvapiGenerator 5 | { 6 | public class Constant 7 | { 8 | private string str_prefix; 9 | private string str_postfix; 10 | private string str_content; 11 | private string path; 12 | private string FileName; 13 | private Operation operation; 14 | 15 | public Constant(string pathFolder , Operation operation) 16 | { 17 | 18 | str_content = ""; 19 | FileName = "Const_" + operation.Name + ".cs"; 20 | path = Path.Combine(pathFolder, FileName); 21 | this.operation = operation; 22 | init_prefix(); 23 | init_postfix(); 24 | } 25 | 26 | private void init_prefix() 27 | { 28 | str_prefix = "namespace Avapi.Avapi" + operation.Name + "\n" + 29 | "{" + "\n" + 30 | "\t" + "public static class Const_" + operation.Name + "\n" + 31 | "\t" + "{" + "\n"; 32 | } 33 | 34 | private void init_postfix() 35 | { 36 | str_postfix = "\t" + "}" + "\n" +"}\n"; 37 | } 38 | 39 | /* Generate a constant cs file related to an operation, we have 2 cases: 40 | 41 | 1) operation.Parameters.Count <= 0: 42 | 2) operation.Parameters.Count> 0, param_1.Items.Count > 0, param_2.Items.Count = 0 43 | 44 | For more details see above. 45 | */ 46 | public bool generate_constant() 47 | { 48 | if (operation.Parameters.Count > 0) 49 | { 50 | foreach (Parameter parameter in operation.Parameters) 51 | { 52 | if (parameter.Items.Count > 0) 53 | { 54 | str_content += "\t\tpublic enum " + operation.Name + 55 | "_" + parameter.Name + "\n" + "\t\t{"; 56 | 57 | int i = 0; 58 | foreach (string item in parameter.Items) 59 | { 60 | // If the const name starts with number then prepend n_ 61 | string strItem = "\n\t\t\t" ; 62 | if (Char.IsDigit(item[0])) 63 | { 64 | strItem += "n_"; 65 | strItem = string.Concat(strItem , item); 66 | } 67 | else if(item =="-1") 68 | { 69 | strItem = "none"; 70 | } 71 | else{ 72 | strItem = string.Concat(strItem , item); 73 | } 74 | 75 | str_content += strItem; 76 | 77 | if (i != (parameter.Items.Count - 1)) 78 | { 79 | str_content += ","; 80 | } 81 | ++i; 82 | } 83 | str_content += "\n\t\t" + "}" + "\n"; 84 | } 85 | } 86 | create(); 87 | } 88 | return true; 89 | } 90 | 91 | // create the Constant .cs file 92 | private int create() 93 | { 94 | using (var fileStream = new FileStream(String.Format(path), FileMode.Create)) 95 | using (StreamWriter writer = new StreamWriter(fileStream)) 96 | { 97 | writer.Write(str_prefix); 98 | writer.Write(str_content); 99 | writer.Write(str_postfix); 100 | } 101 | return 0; 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /tools/AvapiGenerator/Csproj.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace AvapiGenerator 5 | { 6 | public class Csproj 7 | { 8 | static string str_prefix; 9 | static string str_postfix; 10 | static string str_content; 11 | static string basePath; 12 | static string version; 13 | static string releaseNotes; 14 | 15 | public static void init(string path , string str_version, string str_releaseNotes) 16 | { 17 | str_content = ""; 18 | version = str_version; 19 | releaseNotes = str_releaseNotes; 20 | basePath = path; 21 | init_prefix(); 22 | } 23 | 24 | internal static void init_prefix() 25 | { 26 | str_content = "\n" + 27 | "\n" + 28 | "\t\n" + 29 | "\t\tnetcoreapp1.1;netstandard2.0\n" + 30 | "\t\t" + version + "\n"+ 31 | "\t\tAvapi\n" + 32 | "\t\t" + version + "\n" + 33 | "\t\tSimone Giuliani, Antonio Papa\n" + 34 | "\t\tAlpha Vantage .NET API Wrapper\n" + 35 | "\t\t\n" + 36 | "This library allows to retrieve financial data using Alpha Vantage API.\n\n" + 37 | "The official page of Avapi.NET CORE is available at this link: https://github.com/AvapiDotNet/Avapi/ \n\n" + 38 | "The complete documentation of Avapi.NET CORE is available at this link: https://github.com/AvapiDotNet/Avapi/wiki \n\n" + 39 | "To start using Avapi you just need to:\n\n" + 40 | "1. Register to Alpha Vantage web site and get your personal api key(https://www.alphavantage.co/support/#api-key). It's for free!\n\n" + 41 | "2. Install Avapi package on your project\n\n" + 42 | "3. Consume the Avapi library\n\n"+ 43 | "\t\t\n" + 44 | "\t\thttps://github.com/AvapiDotNet/Avapi\n" + 45 | "\t\tfalse\n" + 46 | "\t\t" + releaseNotes + "\n" + 47 | "\t\tAlphaVantage Alpha Vantage API Wrapper Financial Data Finance .NET Core Avapi\n" + 48 | "\t\t\n" + 49 | "\t\t\n" + 50 | "\t\t\n" + 51 | "\t\t\n" + 52 | "\t\t\n" + 53 | "\t\tCopyright (c) 2018 Simone Giuliani and Antonio Papa\n" + 54 | "\t\tPermission is hereby granted, free of charge, to any person obtaining a copy\n" + 55 | "\t\tof this software and associated documentation files(the \"Software\"), to deal\n" + 56 | "\t\tin the Software without restriction, including without limitation the rights\n" + 57 | "\t\tto use, copy, modify, merge, publish, distribute, sublicense, and/ or sell\n" + 58 | "\t\tcopies of the Software, and to permit persons to whom the Software is\n" + 59 | "\t\tfurnished to do so, subject to the following conditions:\n" + 60 | "\t\tThe above copyright notice and this permission notice shall be included in all\n" + 61 | "\t\tcopies or substantial portions of the Software.\n" + 62 | "\t\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n" + 63 | "\t\tIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n" + 64 | "\t\tFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE\n" + 65 | "\t\tAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n" + 66 | "\t\tLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n" + 67 | "\t\tOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n" + 68 | "\t\tSOFTWARE.\n" + 69 | "\t\t" + version + "\n" + 70 | "\t\t" + version + "\n" + 71 | "\t\ten-GB\n" + 72 | "\t\tfalse\n" + 73 | "\t\t\n" + 74 | "\t\tLibrary\n" + 75 | "\t\t\n" + 76 | "\t\ttrue\n" + 77 | "\t\n" + 78 | "\t\n" + 79 | "\t\n" + 80 | "\t\n" + 81 | ""; 82 | } 83 | 84 | // Add a string 85 | public static void add_str(string str) 86 | { 87 | str_content += str; 88 | } 89 | 90 | // create the project file 91 | public static int create() 92 | { 93 | string projectPath = Path.Combine(basePath, "Avapi.csproj"); 94 | using (var fileStream = new FileStream(string.Format(projectPath), FileMode.Create)) 95 | using (StreamWriter writer = new StreamWriter(fileStream)) 96 | { 97 | writer.Write(str_content); 98 | } 99 | return 0; 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /tools/AvapiGenerator/DocGenerator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | 6 | namespace AvapiGenerator 7 | { 8 | public class DocGenerator 9 | { 10 | private static string docPath; 11 | private static IList operations; 12 | 13 | public static void initDocGenerator(IList list_operations ,string destinationPath) 14 | { 15 | docPath = destinationPath; 16 | operations = list_operations; 17 | } 18 | 19 | internal static void create_home() 20 | { 21 | string str_home = string.Empty; 22 | str_home += "# ALPHA VANTAGE API .NET CORE WRAPPER" + "\n"; 23 | str_home += "\n"; 24 | str_home += "## Intro" + "\n"; 25 | str_home += "[[Introduction]] " + "\n"; 26 | str_home += "[[Getting Started]] " + "\n"; 27 | 28 | HashSet types = new HashSet(); 29 | foreach(Operation operation in operations) 30 | { 31 | types.Add(operation.Type); 32 | } 33 | foreach(string currentType in types) 34 | { 35 | str_home += $"## {currentType}" + "\n"; 36 | foreach(Operation operation in operations.Where(o => o.Type == currentType)) 37 | { 38 | str_home += $"[[{operation.Name}]] " + "\n"; 39 | } 40 | } 41 | 42 | Directory.CreateDirectory(docPath); 43 | using (var fileStream = new FileStream($"{docPath}/Home.md", FileMode.Create)) 44 | { 45 | using (StreamWriter writer = new StreamWriter(fileStream)) 46 | { 47 | writer.WriteLine(str_home); 48 | } 49 | } 50 | } 51 | 52 | public static bool GenerateDocumentation() 53 | { 54 | create_home(); 55 | 56 | foreach (Operation operation in operations) 57 | { 58 | // Create a documentation file for the operation 59 | var file_doc = new Documentation(docPath , operation); 60 | if(!file_doc.generate_documentation()) 61 | { 62 | Console.WriteLine("Error: "+operation.Name+"generate_documentation()"); 63 | return false; 64 | } 65 | } 66 | 67 | return true; 68 | } 69 | } 70 | } 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /tools/AvapiGenerator/ExampleGenerator.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace AvapiGenerator 4 | { 5 | public class ExampleGenerator 6 | { 7 | private static string examplePath; 8 | private static IList operations; 9 | 10 | public static void initExampleGenerator(IList list_operations ,string destinationPath) 11 | { 12 | examplePath = destinationPath; 13 | operations = list_operations; 14 | string list_key ="{\n" 15 | +"\t\t\t\"\",\n" 16 | + "\t\t\t\"\",\n" 17 | + "\t\t\t\"\",\n" 18 | + "\t\t\t\"\",\n" 19 | + "\t\t\t\"\",\n" 20 | + "\t\t\t\"\",\n" 21 | + "\t\t\t\"\",\n" 22 | + "\t\t\t\"\",\n" 23 | + "\t\t\t\"\",\n" 24 | + "\t\t\t\"\",\n" 25 | + "\t\t\t};\n"; 26 | 27 | Example.init(examplePath , list_key); 28 | } 29 | 30 | public static bool GenerateExample() 31 | { 32 | 33 | foreach (Operation operation in operations) 34 | { 35 | Example.add_entry(operation); 36 | Example.create(); 37 | } 38 | 39 | return true; 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /tools/AvapiGenerator/IAvapiConnection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace AvapiGenerator 5 | { 6 | public class IAvapiConnection 7 | { 8 | static string str_prefix; 9 | static string str_postfix; 10 | static string str_content; 11 | static string basePath; 12 | 13 | public static void init(string path) 14 | { 15 | init_prefix(); 16 | init_postfix(); 17 | str_content = ""; 18 | basePath = path; 19 | } 20 | 21 | internal static void init_prefix() 22 | { 23 | str_prefix = "namespace Avapi\n" + 24 | "{\n" + 25 | "\tpublic interface IAvapiConnection\n" + 26 | "\t{\n" + 27 | "\t\tvoid Connect(string apiKey);\n" + 28 | "\t\tstring AvapiUrl { get; set; }\n" + 29 | "\t\tstring AvapiUrlDefault { get; }\n" + 30 | "\t\tstring ApiKey { get; set; }\n"; 31 | } 32 | 33 | internal static void init_postfix() 34 | { 35 | str_postfix = "\t}\n" +"}\n"; 36 | } 37 | 38 | // Add an entry 39 | public static void add_str(string str) 40 | { 41 | str_content += str; 42 | } 43 | 44 | // Add an entry related with the operation.Name 45 | public static void add_entry(Operation operation) 46 | { 47 | str_content += "\t\tAvapi" + operation.Name + ".Int_" + operation.Name + 48 | " GetQueryObject_" + operation.Name + "();" + "\n"; 49 | } 50 | 51 | // create the IAvapiConnection.cs file 52 | public static int create() 53 | { 54 | string projectPath = Path.Combine(basePath, "IAvapiConnection.cs"); 55 | using (var fileStream = new FileStream(String.Format(projectPath), FileMode.Create)) 56 | using (StreamWriter writer = new StreamWriter(fileStream)) 57 | { 58 | writer.Write(str_prefix); 59 | writer.Write(str_content); 60 | writer.Write(str_postfix); 61 | } 62 | return 0; 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /tools/AvapiGenerator/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Xml.Linq; 5 | 6 | namespace AvapiGenerator 7 | { 8 | public class Parameter 9 | { 10 | public string Name { get; set; } 11 | public string Description { get; set; } 12 | public bool? Mandatory { get; set; } 13 | public string DataType { get; set; } 14 | public IList Items { get; set; } 15 | 16 | } 17 | 18 | public class Operation 19 | { 20 | public string Name { get; set; } 21 | public string Description { get; set; } 22 | public string Type { get; set; } 23 | public IList Parameters { get; set; } 24 | public Response Response { get; set; } 25 | } 26 | 27 | public class Response 28 | { 29 | public string TypeResponse { get; set; } 30 | public string MetaData { get; set; } 31 | public string TimeSeries { get; set; } 32 | public string TechnicalIndicator { get; set; } 33 | public string SectorP { get; set; } 34 | public string CurrencyExchange { get; set; } 35 | public string StockQuotes { get; set; } 36 | } 37 | 38 | public class Node 39 | { 40 | internal string Name { get; set; } 41 | internal string Text { get; set; } 42 | } 43 | 44 | public class Rank 45 | { 46 | internal string Name { get; set; } 47 | internal string Text { get; set; } 48 | public IList ListNode { get; set; } 49 | } 50 | 51 | class Program 52 | { 53 | static string xmlInputFile = "avapi.xml"; 54 | static string path_version = "version.txt"; 55 | static string destinationPath = @"C:\Avapi"; 56 | static string examplePath = @"C:\AvapiIntegrationTest"; 57 | static string documentationPath = @"C:\Avapi.wiki"; 58 | 59 | 60 | static IList operations {get;set;} 61 | 62 | internal static IList ParseOperations(string path) 63 | { 64 | XDocument doc = null; 65 | 66 | try 67 | { 68 | doc = XDocument.Load(path); 69 | } 70 | catch(Exception ex) 71 | { 72 | Console.WriteLine(ex.Message); 73 | Environment.Exit(-1); 74 | } 75 | 76 | return doc.Root 77 | .Elements("operation") 78 | .Select(x => new Operation 79 | { 80 | Name = (string)x.Element("name"), 81 | Description = (string)x.Element("description"), 82 | Type = (string)x.Element("type"), 83 | Parameters = x.Elements("parameter") 84 | .Select(y => new Parameter 85 | { 86 | Name = (string)y.Attribute("name"), 87 | Description = (string)y.Element("description"), 88 | Mandatory = ToNullableBool((string)y.Element("mandatory")), 89 | DataType = (string)y.Element("datatype"), 90 | Items = y.Elements("items") 91 | .Elements("item") 92 | .Select(z => z.Value) 93 | .ToList() 94 | }).ToList(), 95 | Response = x.Elements("response") 96 | .Select(c => new Response 97 | { 98 | TypeResponse = (string)c.Element("typeresponse"), 99 | MetaData = GetInnerXml(c.Element("metadata")), 100 | TimeSeries = GetInnerXml(c.Element("timeseries")), 101 | TechnicalIndicator = GetInnerXml(c.Element("technicalindicator")), 102 | SectorP = GetInnerXml(c.Element("sectorperformances")), 103 | CurrencyExchange = GetInnerXml(c.Element("currencyexchange")), 104 | StockQuotes = GetInnerXml(c.Element("stockquotes")) 105 | }).ToList()[0], 106 | }).ToList(); 107 | } 108 | 109 | 110 | internal static string GetInnerXml(XElement element) 111 | { 112 | if(element == null) 113 | { 114 | return null; 115 | } 116 | var reader = element.CreateReader(); 117 | reader.MoveToContent(); 118 | return reader.ReadOuterXml(); 119 | } 120 | internal static bool? ToNullableBool(string str) 121 | { 122 | bool i; 123 | if (bool.TryParse(str, out i)) return i; 124 | return null; 125 | } 126 | 127 | static void Main(string[] args) 128 | { 129 | if(args.Length > 0) 130 | { 131 | xmlInputFile = args[0]; 132 | path_version = args[1]; 133 | destinationPath = args[2]; 134 | examplePath = args[3]; 135 | documentationPath = args[4]; 136 | } 137 | 138 | try 139 | { 140 | operations = ParseOperations(xmlInputFile); 141 | 142 | if(operations == null) 143 | { 144 | return; 145 | } 146 | } 147 | catch(Exception ex) 148 | { 149 | Console.WriteLine(ex.Message); 150 | return; 151 | } 152 | 153 | CodeGenerator.initCodeGenerator(destinationPath, operations, path_version); 154 | if (!CodeGenerator.GenerateCode()) 155 | { 156 | // Delete folder destinationPath/AVAPI 157 | } 158 | 159 | DocGenerator.initDocGenerator(operations , documentationPath); 160 | if (!DocGenerator.GenerateDocumentation()) 161 | { 162 | // todo the error handler 163 | } 164 | 165 | ExampleGenerator.initExampleGenerator(operations , examplePath); 166 | if (!ExampleGenerator.GenerateExample()) 167 | { 168 | // todo the error handler 169 | } 170 | } 171 | } 172 | } 173 | -------------------------------------------------------------------------------- /tools/AvapiGenerator/Utility.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | namespace AvapiGenerator 4 | { 5 | public class Utility 6 | { 7 | static string str_prefix; 8 | static string str_postfix; 9 | static string str_content; 10 | static string basePath; 11 | 12 | public static void init(string path) 13 | { 14 | str_content = ""; 15 | basePath = path; 16 | init_prefix(); 17 | init_postfix(); 18 | } 19 | 20 | internal static void init_prefix() 21 | { 22 | str_prefix = "using System.Collections.Generic;\n"+ 23 | "using System.Linq;\n"+ 24 | "using System.Net;\n"+ 25 | "using System.Text;\n\n"+ 26 | "namespace Avapi\n"+ 27 | "{\n"+ 28 | "\t"+"internal static class UrlUtility\n"+ 29 | "\t"+"{\n"+ 30 | "\t\t"+"internal static string AsQueryString(IDictionary parameters)\n"+ 31 | "\t\t"+"{\n"+ 32 | "\t\t\t"+"if (!parameters.Any())\n"+ 33 | "\t\t\t\t"+"return \"\";\n\n"+ 34 | "\t\t\t"+"var builder = new StringBuilder(\"?\");\n\n"+ 35 | "\t\t\t"+"var separator = \"\";\n"+ 36 | "\t\t\t"+"foreach (var kvp in parameters.Where(kvp => kvp.Value != null))\n"+ 37 | "\t\t\t"+"{\n"+ 38 | "\t\t\t\t"+"builder.AppendFormat(\"{0}{1}={2}\", separator, WebUtility.UrlEncode(kvp.Key),"+ 39 | " WebUtility.UrlEncode(kvp.Value.ToString()));\n\n"+ 40 | "\t\t\t\t"+"separator = \"&\";\n"+ 41 | "\t\t\t"+"}\n"+ 42 | "\t\t\t"+"return builder.ToString();\n"+ 43 | "\t\t"+"}\n"+ 44 | "\t"+"}\n"+"}"; 45 | } 46 | 47 | internal static void init_postfix() 48 | { 49 | str_postfix = ""; 50 | } 51 | 52 | // Add a string 53 | public static void add_str(string str) 54 | { 55 | str_content += str; 56 | } 57 | 58 | // create the project file 59 | public static int create() 60 | { 61 | string projectPath = Path.Combine(basePath, "Utility.cs"); 62 | using (var fileStream = new FileStream(string.Format(projectPath), FileMode.Create)) 63 | using (StreamWriter writer = new StreamWriter(fileStream)) 64 | { 65 | writer.Write(str_prefix); 66 | writer.Write(str_content); 67 | writer.Write(str_postfix); 68 | } 69 | return 0; 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /tools/AvapiGenerator/project.json: -------------------------------------------------------------------------------- 1 | // { 2 | // "version": "1.0.0-*", 3 | 4 | // "dependencies": { 5 | // "NETStandard.Library": "1.6.0" 6 | // }, 7 | 8 | // "frameworks": { 9 | // "netstandard1.6": { 10 | // "imports": "dnxcore50" 11 | // } 12 | // }, 13 | // "runtimes": { 14 | // "win10-x64": {}, 15 | // "osx.10.10-x64": {} 16 | // } 17 | // } 18 | 19 | { 20 | "version": "1.0.0-*", 21 | "buildOptions": { 22 | "emitEntryPoint": true 23 | }, 24 | "dependencies": { 25 | "Microsoft.NETCore.App": { 26 | //"type": "platform", 27 | "version": "1.0.0-rc2-3002702" 28 | } 29 | }, 30 | "frameworks": { 31 | "netcoreapp1.0": { 32 | "imports": "dnxcore50" 33 | } 34 | }, 35 | "runtimes":{ 36 | "win10-x64": { }, 37 | "ubuntu.14.04-x64": { } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tools/AvapiGenerator/version.txt: -------------------------------------------------------------------------------- 1 | 1.4.8.3 2 | Internal change --------------------------------------------------------------------------------