以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  [求助]提醒文字  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=183490)

--  作者:vvwh
--  发布时间:2020/12/16 16:06:18
--  [求助]提醒文字
在30分钟K线和日K线图中,参数: MACD(14、24、10)
1.上涨MA5orMA5上穿MA10,或者MACD金叉,显示红色箭头;
2.跌破MA5orMA5下穿MA10,或者MACD死叉,显示绿色箭头;
3.MACD绿柱缩短(锐化)显示红点;
4.MACD红柱缩短(钝化)显示绿点;
跳出提醒文字。


--  作者:FireScript
--  发布时间:2020/12/16 16:29:01
--  
input:p(26,20,100,8),s(12,5,40,4),m(9,2,60,6);
DIFF :EMA(CLOSE,S) - EMA(CLOSE,P);
DEA  :EMA(DIFF,M);
MACD1 :2*(DIFF-DEA), COLORSTICK;
macdjc:cross(diff,dea),NODRAW;//macd金叉
macdsc:cross(dea,diff),NODRAW;


ma5:ma(c,5);
ma10:ma(c,10);

cd1:ma5>ref(ma5,1) or cross(ma5,ma10) or macdjc;
cd2:ma5<ref(ma5,1) or cross(ma10,ma5) or macdsc;
DRAWICON(cd1,h,4);
DRAWICON(cd2,l,5);

cd3:macd1<0 and macd1>ref(macd1,1);
cd4:macd1>0 and macd1<ref(macd1,1);

DRAWICON(cd3,l,10);
DRAWICON(cd4,l,11);

“跳出提醒文字。”没有这种弹窗形式的。最多是输出在图表某个位置。

后台预警可以在满足条件时候 弹窗整个个预警窗口。

--  作者:vvwh
--  发布时间:2020/12/16 21:25:14
--  
这种源码能实行吗?
while 1:
            
            try:
                self.get_position()
                self.deal_data()
                print(\'........当前中点价格:\',self.df[\'midpoint\'].iloc[-1], \'.........当前下轨价格:\',self.lowerband.iloc[-1])
                if self.df[\'midpoint\'].iloc[-1] < self.lowerband.iloc[-1] and int(self.long_holding) == 0:
                    print(\'符合开仓条件\')
                    price = self.df[\'close\'].iloc[-1] * 1.01
                    self.okex_api.take_order(instrument_id=\'ru2105\', type=?\', size=?\', order_type=?\',
                                             price=price)

                if self.df[\'midpoint\'].iloc[-1] > self.upperband.iloc[-1] and int(self.long_holding) != 0:
                    print(\'平仓\')
                    price = self.df[\'close\'].iloc[-1] * 0.99
                    self.okex_api.take_order(instrument_id=\'ru2105\', type=?\', size=?\', order_type=?\',
                                             price=price)
            except:


--  作者:vvwh
--  发布时间:2020/12/16 22:12:43
--  
上个帖显示出来的有点复杂了,辛苦老师帮我改改,谢谢!
在30分钟K线和日K线图中, MACD(12、26、9)
1.上涨MA5或者MACD金叉,显示红色箭头;
2.跌破MA5或者MACD死叉,显示绿色箭头;