MathArctan(MathTan(
((price1-price2)/(WindowPriceMax()- WindowPriceMin()))
/
((shift2-shift1)/WindowBarsPerChart())
))
*180/3.14
shift2 shift1 price1 price2 这两个变量没有搞懂 呵呵
谢谢你们 本人很笨 呵呵
非常感谢。 我自己在研究研究 谢谢你!
shift2 shift1 price1 price2 这两个变量没有搞懂 这4个变量不知道代表什么
是2个点的价格吗? 还是均线的价格?
我按这个做了一段计算均线角度的代码,却得不到任何显示结果。如果把第12行换成第13行的内容能得到显示结果,但明显是错误的。不知道问题出在了哪里,请指教。
int start() { int counted_bars=IndicatorCounted(); //---- int shift1 = 20; int shift2 = 31; double price1 = iMA(NULL,15,20,0,MODE_SMA,PRICE_CLOSE,shift1); double price2 = iMA(NULL,15,20,0,MODE_SMA,PRICE_CLOSE,shift2); double X = MathArctan(MathTan(((price1-price2)/(WindowPriceMax()- WindowPriceMin()))/((shift2-shift1)/WindowBarsPerChart())))*180/3.14; //---- 第12行 //double X = MathArctan(MathTan(((price1-price2)/(WindowPriceMax()- WindowPriceMin()))/((Time[shift2]-Time[shift1])/WindowBarsPerChart())))*180/3.14; //---- 第13行 ObjectDelete("tAngle"); ObjectCreate("tAngle", OBJ_LABEL, 0, 0, 0); ObjectSetText("tAngle","" + X + " A", 10, "Arial", White); ObjectSet("tAngle", OBJPROP_CORNER, 1); ObjectSet("tAngle", OBJPROP_XDISTANCE, 5); ObjectSet("tAngle", OBJPROP_YDISTANCE, 360); //---- return(0); }
double X = MathArctan(MathTan(((price1-price2)/(WindowPriceMax()- WindowPriceMin()))/((shift2-shift1)/WindowBarsPerChart())))*180/3.14; //---- 第12行
Print(X," ",price1," ",price2,shift2," ",shift1); ///检查输出结果
标记一下 留作参考
double X = MathArctan(MathTan(((price1-price2)/(WindowPriceMax()- WindowPriceMin()))/((shift2-shift1)/WindowBarsPerChart())))*180/3.14; //---- 第12行
Print(X," ",price1," ",price2,shift2," ",shift1); ///检查输出结果
非常奇怪,打印出来的是这样的结果:
全是:zero divide。如果把第12行换成第13行的内容,打印出来的是五个参数的数值(31与前面的值没放空格):
不知道问题在哪里,理论上看(shift2-shiift1)应该有正确的输出结果。
求判断均线角度代码
求判断均线角度代码
求判断均线角度代码
求判断均线角度代码
QQ:9810826