days

聚宽源码43

戏子无情 提交于 2019-12-11 14:56:35
原文策略源码如下: Get API 新技能,研究中写策略并回测 def initialize(context): set_params() #1设置策参数 set_variables() #2设置中间变量 set_backtest() #3设置回测条件 g.long_day = 60 # 长均线天数 g.short_day = 120 # 短均线天数 #1 #设置策略参数 def set_params(): g.tc=15 # 调仓频率 g.N=4 # 持仓数目 g.security = [“000001.XSHE”,“000002.XSHE”,“000006.XSHE”,“000007.XSHE”,“000009.XSHE”]#设置股票池 #2 #设置中间变量 def set_variables(): return #3 #设置回测条件 def set_backtest(): set_option(‘use_real_price’, True) #用真实价格交易 log.set_level(‘order’, ‘error’) ‘’’ 每天开盘前 ‘’’ #每天开盘前要做的事情 def before_trading_start(context): set_slip_fee(context) #4 根据不同的时间段设置滑点与手续费 def set_slip_fee(context):

聚宽源码08

拈花ヽ惹草 提交于 2019-12-11 14:04:20
原文策略源码如下: #MACD多因子选股 from kuanke.wizard import * from jqdata import * import numpy as np import pandas as pd import talib import datetime 初始化函数,设定要操作的股票、基准等等 def initialize(context): # 设定基准 set_benchmark(‘000905.XSHG’) # 设定滑点 set_slippage(FixedSlippage(0.02)) # True为开启动态复权模式,使用真实价格交易 set_option(‘use_real_price’, True) # 设定成交量比例 set_option(‘order_volume_ratio’, 1) # 股票类交易手续费是:买入时佣金万分之三,卖出时佣金万分之三加千分之一印花税, 每笔交易佣金最低扣5块钱 set_order_cost(OrderCost(open_tax=0, close_tax=0.001, open_commission=0.0003, close_commission=0.0003, min_commission=5), type=‘stock’) # 个股最大持仓比重 g.security_max_proportion = 1 #

聚宽源码34

一个人想着一个人 提交于 2019-12-11 14:02:11
原文策略源码如下: #多因子选股策略 from kuanke.wizard import * from jqdata import * import numpy as np import pandas as pd import talib import datetime 初始化函数,设定要操作的股票、基准等等 def initialize(context): # 设定基准 set_benchmark(‘000300.XSHG’) # 设定滑点 set_slippage(FixedSlippage(0.02)) # True为开启动态复权模式,使用真实价格交易 set_option(‘use_real_price’, True) # 设定成交量比例 set_option(‘order_volume_ratio’, 1) # 股票类交易手续费是:买入时佣金万分之三,卖出时佣金万分之三加千分之一印花税, 每笔交易佣金最低扣5块钱 set_order_cost(OrderCost(open_tax=0, close_tax=0.001, open_commission=0.0003, close_commission=0.0003, min_commission=5), type=‘stock’) # 个股最大持仓比重 g.security_max_proportion = 1 #

聚宽源码44

有些话、适合烂在心里 提交于 2019-12-11 13:43:09
原文策略源码如下: #小盘次新股策略 from kuanke.wizard import * from jqdata import * import numpy as np import pandas as pd import talib import datetime 初始化函数,设定要操作的股票、基准等等 def initialize(context): # 设定基准 set_benchmark(‘000300.XSHG’) # 设定滑点 set_slippage(FixedSlippage(0.02)) # True为开启动态复权模式,使用真实价格交易 set_option(‘use_real_price’, True) # 设定成交量比例 set_option(‘order_volume_ratio’, 1) # 股票类交易手续费是:买入时佣金万分之三,卖出时佣金万分之三加千分之一印花税, 每笔交易佣金最低扣5块钱 set_order_cost(OrderCost(open_tax=0, close_tax=0.001, open_commission=0.0003, close_commission=0.0003, min_commission=5), type=‘stock’) # 个股最大持仓比重 g.security_max_proportion = 1 #

聚宽源码32

橙三吉。 提交于 2019-12-11 12:51:43
原文策略源码如下: #个股止损策略 from kuanke.wizard import * from jqdata import * import numpy as np import pandas as pd import talib import datetime 初始化函数,设定要操作的股票、基准等等 def initialize(context): # 设定基准 set_benchmark(‘000300.XSHG’) # 设定滑点 set_slippage(FixedSlippage(0.02)) # True为开启动态复权模式,使用真实价格交易 set_option(‘use_real_price’, True) # 设定成交量比例 set_option(‘order_volume_ratio’, 1) # 股票类交易手续费是:买入时佣金万分之三,卖出时佣金万分之三加千分之一印花税, 每笔交易佣金最低扣5块钱 set_order_cost(OrderCost(open_tax=0, close_tax=0.001, open_commission=0.0003, close_commission=0.0003, min_commission=5), type=‘stock’) # 个股最大持仓比重 g.security_max_proportion = 1 # 选股频率

聚宽源码35

十年热恋 提交于 2019-12-11 12:40:25
原文策略源码如下: #多因子选股改进型 from kuanke.wizard import * from jqdata import * import numpy as np import pandas as pd import talib import datetime 初始化函数,设定要操作的股票、基准等等 def initialize(context): # 设定基准 set_benchmark(‘000300.XSHG’) # 设定滑点 set_slippage(FixedSlippage(0.02)) # True为开启动态复权模式,使用真实价格交易 set_option(‘use_real_price’, True) # 设定成交量比例 set_option(‘order_volume_ratio’, 1) # 股票类交易手续费是:买入时佣金万分之三,卖出时佣金万分之三加千分之一印花税, 每笔交易佣金最低扣5块钱 set_order_cost(OrderCost(open_tax=0, close_tax=0.001, open_commission=0.0003, close_commission=0.0003, min_commission=5), type=‘stock’) # 个股最大持仓比重 g.security_max_proportion = 1 #

聚宽源码33

和自甴很熟 提交于 2019-12-11 12:02:56
原文策略源码如下: #潜力股选股策略 from kuanke.wizard import * from jqdata import * import numpy as np import pandas as pd import talib import datetime 初始化函数,设定要操作的股票、基准等等 def initialize(context): # 设定基准 set_benchmark(‘000300.XSHG’) # 设定滑点 set_slippage(FixedSlippage(0.02)) # True为开启动态复权模式,使用真实价格交易 set_option(‘use_real_price’, True) # 设定成交量比例 set_option(‘order_volume_ratio’, 1) # 股票类交易手续费是:买入时佣金万分之三,卖出时佣金万分之三加千分之一印花税, 每笔交易佣金最低扣5块钱 set_order_cost(OrderCost(open_tax=0, close_tax=0.001, open_commission=0.0003, close_commission=0.0003, min_commission=5), type=‘stock’) # 个股最大持仓比重 g.security_max_proportion = 1 #

Display days in TimeSeriesChart

♀尐吖头ヾ 提交于 2019-12-11 06:57:51
问题 How can I display the names of the days ("Sunday, Monday....") on the time axis, instead of just the date ? 回答1: You can use setDateFormatOverride(), as shown here. Addendum: isn't there a way to change only the top level? ChartPanel has methods related to the zoom state. You should be able to set the date format as desired either by overriding the chartChanged() method or in response to user input, as suggested in this example. 回答2: Yes: DateAxis xAxis = (DateAxis) plot.getDomainAxis();

Count days between two dates excluding weekends

守給你的承諾、 提交于 2019-12-11 04:50:00
问题 How can I find the difference between two dates in DB2 (excluding weekends)? Are there any functions that will do this in DB2? Or do I need to write a query myself? 回答1: There is AFAIK no such function. It is however easy to write a query that calculates this: with cal(d) as ( values date('2015-01-01') -- start_date union all select d + 1 day from cal where d < '2015-01-15' -- end_date ) select count(case when dayofweek(d) between 2 and 6 then 1 end) from cal; If you do a lot of these kind of

Name of day in string format with days to furure

五迷三道 提交于 2019-12-10 23:08:07
问题 I need name of day in week but dependent o actual date and date to future. For example I need name of day today, then name of day tomorrow, name of date +2 days etc I make this code but not working good. So is there any better way how I can in android get name of day? public String getDay3Name() { Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); String[] days = new String[] { "SUNDAY","SUNDAY","SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY