- 精华
- 0
- 在线时间
- 24 小时
- UID
- 204532
- 积分
- 14
- 帖子
- 9
- 阅读权限
- 10
- 注册时间
- 2015-3-4
- 最后登录
- 2023-3-29
- 精华
- 0
- UID
- 204532
- 积分
- 14
- 帖子
- 9
- 主题
- 5
- 阅读权限
- 10
- 注册时间
- 2015-3-4
- 最后登录
- 2023-3-29
|
请问小米老师:这么写对吗?
Params
Numeric Length1(5);
Numeric Length2(10);
Numeric Length3(15);
Numeric Length4(20);
Numeric Length5(25);
Numeric Length6(30);
Numeric Length7(35);
Numeric Length8(40);
Numeric Length9(45);
Numeric Length10(50);
Numeric Length11(55);
Numeric Length12(60);
Vars
NumericSeries EMA5;
NumericSeries EMA10;
NumericSeries EMA15;
NumericSeries EMA20;
NumericSeries EMA25;
NumericSeries EMA30;
NumericSeries EMA35;
NumericSeries EMA40;
NumericSeries EMA45;
NumericSeries EMA50;
NumericSeries EMA55;
NumericSeries EMA60;
Begin
EMA5 = XAverage(Close, Length1);
EMA10 = XAverage(Close, Length1);
EMA15 = XAverage(Close, Length1);
EMA20 = XAverage(Close, Length1);
EMA25 = XAverage(Close, Length1);
EMA30 = XAverage(Close, Length1);
EMA35 = XAverage(Close, Length1);
EMA40 = XAverage(Close, Length1);
EMA45 = XAverage(Close, Length1);
EMA50 = XAverage(Close, Length1);
EMA55 = XAverage(Close, Length1);
EMA60 = XAverage(Close, Length1);
PlotNumeric("EMA1",EMA5);
PlotNumeric("EMA2",EMA10);
PlotNumeric("EMA3",EMA15);
PlotNumeric("EMA4",EMA20);
PlotNumeric("EMA5",EMA25);
PlotNumeric("EMA6",EMA30);
PlotNumeric("EMA7",EMA35);
PlotNumeric("EMA8",EMA40);
PlotNumeric("EMA9",EMA45);
PlotNumeric("EMA10",EMA50);
PlotNumeric("EMA11",EMA55);
PlotNumeric("EMA12",EMA60);
If(MarketPosition!=1)
{
If(EMA5[1] >EMA10[1] && EMA10[1]>EMA15[1] && EMA15[1]>EMA20[1]&& EMA20[1]>EMA25[1] && EMA25[1]>EMA30[1] && EMA30[1]>EMA35[1] && EMA35[1]>EMA40[1] && EMA40[1]>EMA45[1] && EMA45[1]>EMA50[1] && EMA50[1]>EMA55[1] && EMA55[1]>EMA60[1])
{
Buy(1,OPEN);
}
}
If(MarketPosition==1)
{
If(EMA5[1]<EMA10[1] && EMA10[1]<EMA15[1] && EMA15[1]<EMA20[1] &&EMA20[1]<EMA25[1] && EMA25[1]<EMA30[1] && EMA30[1]<EMA35[1] && EMA35[1]<EMA40[1] && EMA40[1]<EMA45[1]&& EMA45[1]<EMA50[1] && EMA50[1]<EMA55[1] && EMA55[1]<EMA60[1])
{
Sell(1,open);
}
}
If(MarketPosition!=1)
{
If(EMA5[1]<EMA10[1] && EMA10[1]<EMA15[1] && EMA15[1]<EMA20[1] &&EMA20[1]<EMA25[1] && EMA25[1]<EMA30[1] && EMA30[1]<EMA35[1] && EMA35[1]<EMA40[1] && EMA40[1]<EMA45[1]&& EMA45[1]<EMA50[1] && EMA50[1]<EMA55[1] && EMA55[1]<EMA60[1])
{
Sell(1,OPEN);
}
}
If(MarketPosition==1)
{
If(EMA5[1] >EMA10[1] && EMA10[1]>EMA15[1] && EMA15[1]>EMA20[1]&& EMA20[1]>EMA25[1] && EMA25[1]>EMA30[1] && EMA30[1]>EMA35[1] && EMA35[1]>EMA40[1] && EMA40[1]>EMA45[1] && EMA45[1]>EMA50[1] && EMA50[1]>EMA55[1] && EMA55[1]>EMA60[1])
{
Sell(1,open);
}
}
End
|
|