求判断均线角度代码

24
2008.11.22 17:59

QQ:9810826

1631
2008.11.24 11:59

MathArctan(MathTan(
((price1-price2)/(WindowPriceMax()- WindowPriceMin()))
/
((shift2-shift1)/WindowBarsPerChart())
))
*180/3.14

https://www.mql5.com/en/search

24
2008.11.25 17:11

24
2008.11.25 17:14

shift2 shift1 price1 price2 这两个变量没有搞懂 呵呵

1631
2008.11.26 04:17

24
2008.11.26 10:27

24
2008.11.26 10:29

shift2 shift1 price1 price2 这两个变量没有搞懂 这4个变量不知道代表什么

166
2010.04.14 21:08

```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);
}```
1631
2010.04.15 03:50

double X = MathArctan(MathTan(((price1-price2)/(WindowPriceMax()- WindowPriceMin()))/((shift2-shift1)/WindowBarsPerChart())))*180/3.14; //---- 第12行
Print(X," ",price1," ",price2,shift2," ",shift1); ///检查输出结果

208
2010.04.15 04:26

166
2010.04.15 08:44
DxdCn 写道 >>

double X = MathArctan(MathTan(((price1-price2)/(WindowPriceMax()- WindowPriceMin()))/((shift2-shift1)/WindowBarsPerChart())))*180/3.14; //---- 第12行
Print(X," ",price1," ",price2,shift2," ",shift1); ///检查输出结果

/ /12