关于股价小于20均线的股票的问题,我们总结了以下几点,给你解答:
股价小于20均线的股票
# 先查询出20日均线
sql_ma20 = '''
SELECT
stock_code,
ma20
FROM
stock_ma
WHERE
ma20 IS NOT NULL
'''
# 再查询出股价
sql_price = '''
SELECT
stock_code,
close_price
FROM
stock_price
WHERE
close_price IS NOT NULL
'''
# 将两个查询结果进行连接
sql = '''
SELECT
ma20.stock_code,
ma20.ma20,
price.close_price
FROM
({ma20}) ma20
LEFT JOIN
({price}) price
ON
ma20.stock_code = price.stock_code
WHERE
ma20.ma20 > price.close_price
'''.format(ma20=sql_ma20, price=sql_price)
# 执行查询
cursor.execute(sql)
# 获取查询结果
result = cursor.fetchall()
# 打印结果
print('股票代码\t20日均线\t股价')
for row in result:
stock_code, ma20, close_price = row
print('{}\t{:.2f}\t{:.2f}'.format(stock_code, ma20, close_price))
finally:
# 关闭数据库连接
connection.close()
股价小于20均线的股票是什么
XG:RANGE(MA(C,5),MA(C,10),MA(C,20)) AND C
晕乎乎的来了,但是没想清楚这个事7742
MA1:=MA(C,5);
MA2:=MA(C,10);
MA3:=MA(C,20);
MA1>MA2 AND MA1<=MA3 AND C<MA(C,20);
ma(c,5)<=ma(c,20) and ma(c,5)>=ma(c,10);
股价小于20均线的股票有哪些
AA:=C<MA(C,20) AND C>M秋A(C,60) AND 夜夜效细空志没井(1-C/REF(C,1))*100>1;
AA;