EXP
real = EXP(close)
Plot
Working Example
from cloudquant.interfaces import Strategy
from collections import OrderedDict
import ktgfunc
import talib
class WE_EXP(Strategy):
def on_start(self, md, order, service, account):
# symbol and timestamp
print(self.symbol + ": " + service.time_to_string(service.system_time))
daily_bars = md.bar.daily(start=-100)
close = daily_bars.close
real = talib.EXP(close)
# get the date values
dates = service._context.market._storage.market_hours.keys()
dateList = []
for date in dates:
dateList.append(str(date.strftime('%Y-%m-%d')))
dates = sorted(dateList, reverse=True)[1:101]
dates.sort()
dict = OrderedDict()
dict['date'] = dates
dict['close'] = close
dict['real'] = real
symbol = 'EXP: ' + self.symbol
print ktgfunc.talib_table(symbol, 1, dict)
Console
MSFT: 2017-02-09 09:30:00.000000
EXP: MSFT | ||
---|---|---|
Input | Output | |
date | close | real |
2016-09-16 | 56.87 | 4971674566848224079904768.00 |
2016-09-19 | 56.55 | 3618132844049704595488768.00 |
2016-09-20 | 56.43 | 3211558854373638347423744.00 |
2016-09-21 | 57.37 | 8251179374444947542376448.00 |
2016-09-22 | 57.43 | 8757907220925215395545088.00 |
2016-09-23 | 57.04 | 5945051593489308538896384.00 |
2016-09-26 | 56.52 | 3511901711116858365575168.00 |
2016-09-27 | 57.56 | 9964788949331227623555072.00 |
2016-09-28 | 57.64 | 10789312547754090977820672.00 |
2016-09-29 | 57.01 | 5770500355781378286026752.00 |
2016-09-30 | 57.21 | 7038948123320124373467136.00 |
2016-10-03 | 57.03 | 5886468571677271575756800.00 |
2016-10-04 | 56.86 | 4922702059987153971052544.00 |
2016-10-05 | 57.25 | 7324012248202758385041408.00 |
2016-10-06 | 57.35 | 8089426720268665634160640.00 |
2016-10-07 | 57.41 | 8586220886920439355408384.00 |
2016-10-10 | 57.65 | 10896689411254760132050944.00 |
2016-10-11 | 56.81 | 4684016124813075999096832.00 |
2016-10-12 | 56.73 | 4326490820512397299548160.00 |
2016-10-13 | 56.54 | 3582124168482849996931072.00 |
2016-10-14 | 57.03 | 5886468571677271575756800.00 |
2016-10-17 | 56.84 | 4825702419175901279289344.00 |
2016-10-18 | 57.27 | 7471229481190407362576384.00 |
2016-10-19 | 57.14 | 6566354285596607917326336.00 |
2016-10-20 | 56.87 | 4971674566848224079904768.00 |
2016-10-21 | 59.26 | 54470460376601074314772480.00 |
2016-10-24 | 60.59 | 206160710013437007294889984.00 |
2016-10-25 | 60.58 | 204109719265512957449076736.00 |
2016-10-26 | 60.22 | 142759232128849680086859776.00 |
2016-10-27 | 59.70 | 84323350366150585204342784.00 |
2016-10-28 | 59.47 | 67104938063173209768853504.00 |
2016-10-31 | 59.52 | 70517177153843094196584448.00 |
2016-11-01 | 59.40 | 62593314936650870265217024.00 |
2016-11-02 | 59.03 | 43343561869607040018546688.00 |
2016-11-03 | 58.81 | 34836167128557190503202816.00 |
2016-11-04 | 58.32 | 21199119763635817588719616.00 |
2016-11-07 | 60.01 | 115880167061686043472297984.00 |
2016-11-08 | 60.06 | 121773056904284134417891328.00 |
2016-11-09 | 59.77 | 90392272941141231293956096.00 |
2016-11-10 | 58.31 | 20990221913721585979621376.00 |
2016-11-11 | 58.62 | 28845624493811977389342720.00 |
2016-11-14 | 57.73 | 11798321910442523369668608.00 |
2016-11-15 | 58.87 | 36890597195613856126205952.00 |
2016-11-16 | 59.65 | 80476023393959739429748736.00 |
2016-11-17 | 60.64 | 216579385691433328426614784.00 |
2016-11-18 | 60.35 | 162058315432558992790913024.00 |
2016-11-21 | 60.86 | 269874862271891281746591744.00 |
2016-11-22 | 61.12 | 350008241037492927074402304.00 |
2016-11-23 | 60.40 | 170367742861934763446370304.00 |
2016-11-25 | 60.53 | 194019088284048636772352000.00 |
2016-11-28 | 60.61 | 210178754068636438345285632.00 |
2016-11-29 | 61.09 | 339664348849083710452006912.00 |
2016-11-30 | 60.26 | 148110125706523806091182080.00 |
2016-12-01 | 59.20 | 51313738897270307282747392.00 |
2016-12-02 | 59.25 | 53944609393199898840530944.00 |
2016-12-05 | 60.22 | 142303057170496208335011840.00 |
2016-12-06 | 59.95 | 108631186097979683277635584.00 |
2016-12-07 | 61.37 | 449419477542310326378168320.00 |
2016-12-08 | 61.01 | 313549138581216240991207424.00 |
2016-12-09 | 61.97 | 818897553597133829661786112.00 |
2016-12-12 | 62.17 | 1000200678239263350262333440.00 |
2016-12-13 | 62.98 | 2248362180546726056840658944.00 |
2016-12-14 | 62.68 | 1665628940814241322068082688.00 |
2016-12-15 | 62.58 | 1507125689901873046963093504.00 |
2016-12-16 | 62.30 | 1139058138044110963411517440.00 |
2016-12-19 | 63.62 | 4263973282635702947471687680.00 |
2016-12-20 | 63.54 | 3936151245666361011068731392.00 |
2016-12-21 | 63.54 | 3936151245666361011068731392.00 |
2016-12-22 | 63.55 | 3975703550261860690514935808.00 |
2016-12-23 | 63.24 | 2915974786860041580591448064.00 |
2016-12-27 | 63.28 | 3034969176533178748290203648.00 |
2016-12-28 | 62.99 | 2270963447423073248025247744.00 |
2016-12-29 | 62.90 | 2075503998514202560090341376.00 |
2016-12-30 | 62.14 | 970641465713829021262807040.00 |
2017-01-03 | 62.58 | 1507125689901873046963093504.00 |
2017-01-04 | 62.30 | 1139058138044110963411517440.00 |
2017-01-05 | 62.30 | 1139058138044110963411517440.00 |
2017-01-06 | 62.84 | 1954633370830681093670174720.00 |
2017-01-09 | 62.64 | 1600317230745939082425139200.00 |
2017-01-10 | 62.62 | 1568628108385982823050248192.00 |
2017-01-11 | 63.19 | 2773752553529527739808219136.00 |
2017-01-12 | 62.61 | 1553022604616503394857648128.00 |
2017-01-13 | 62.70 | 1699277655273436074897047552.00 |
2017-01-17 | 62.53 | 1433617927594213901177192448.00 |
2017-01-18 | 62.50 | 1391249812950831017075146752.00 |
2017-01-19 | 62.30 | 1139058138044110963411517440.00 |
2017-01-20 | 62.74 | 1768628111179626477558693888.00 |
2017-01-23 | 62.96 | 2203840617646580004380737536.00 |
2017-01-24 | 63.52 | 3858208462788822484132036608.00 |
2017-01-25 | 63.68 | 4527648882770839065220612096.00 |
2017-01-26 | 64.27 | 8167796222089755373309263872.00 |
2017-01-27 | 65.78 | 36973493664036644775012597760.00 |
2017-01-30 | 65.13 | 19301826767137728544429309952.00 |
2017-01-31 | 64.65 | 11943700863910423527660978176.00 |
2017-02-01 | 63.58 | 4096792376064063497677307904.00 |
2017-02-02 | 63.17 | 2718827328470201921286701056.00 |
2017-02-03 | 63.68 | 4527648882770839065220612096.00 |
2017-02-06 | 63.64 | 4350113248106586969999409152.00 |
2017-02-07 | 63.43 | 3526136495374300737110540288.00 |
2017-02-08 | 63.34 | 3222645614908835190062186496.00 |