很容易的修改万能指标代码 !
改变红色代码 您的买入卖出条件
#property copyright \”SH Lim\”
#property link \”singhooilim@yahoo.com\”
#property indicator_chart_window
#property indicator_color1 White
#property indicator_color2 Yellow
extern bool Alertbuy = false;
extern bool Alertsell = false;
extern int distance = 5;
extern int Symbol_1_Kod=181; // 可以改 100 至 255
extern string NameFileSound = \”alert.wav\”;
#property indicator_buffers 2
//—- input parameters
//—- buffers
double UpBuffer[];
double DnBuffer[];
//+——————————————————————+
//| Custom indicator initialization function |
//+——————————————————————+
int init()
{
//—- indicators
// IndicatorBuffers(2);
SetIndexStyle(0,DRAW_ARROW,0,0);
SetIndexArrow(0,Symbol_1_Kod);
SetIndexBuffer(0,UpBuffer);
SetIndexEmptyValue(0,0.0);
SetIndexStyle(1,DRAW_ARROW,0,0);
SetIndexArrow(1,Symbol_1_Kod);
SetIndexBuffer(1,DnBuffer);
SetIndexEmptyValue(1,0.0);
SetIndexLabel(0,\”Up Signal\”);
SetIndexLabel(1,\”Down Signal\”);
//—-
return(0);
}
//+——————————————————————+
//| Custor indicator deinitialization function |
//+——————————————————————+
int deinit()
{
//—-
//—-
return(0);
}
//+——————————————————————+
//| Custom indicator iteration function |
//+——————————————————————+
int start()
{
int limit;
int counted_bars=IndicatorCounted();
if(counted_bars0) counted_bars–;
limit=Bars-counted_bars;
for(int i = 0 ;i < limit ;i++)
{
//indicators
double m1 = iCustom(NULL,0, \”MTF_MACD_inColor\”, 15, 12, 26, 9, 0, 0, i);
double m1a = iCustom(NULL,0, \”MTF_MACD_inColor\”, 15, 12, 26, 9, 0, 1, i);
double m2 = iCustom(NULL,0, \”MTF_MACD_inColor\”, 30, 12, 26, 9, 0, 0, i);
double m2a = iCustom(NULL,0, \”MTF_MACD_inColor\”, 30, 12, 26, 9, 0, 1, i);
double m3 = iCustom(NULL,0, \”MTF_MACD_inColor\”, 240, 12, 26, 9, 0, 0, i);
double m3a = iCustom(NULL,0, \”MTF_MACD_inColor\”, 240, 12, 26, 9, 0, 1, i);
//end of indicators
if((m1>m1a)&&(m2>m2a)&&(m3>m3a)) // Up Trend Condition 上升趋势条件
{
UpBuffer = iLow(Symbol(),0,i)-(distance*Point); // Signal Location 信号位置
DnBuffer = EMPTY_VALUE;
if (Alertbuy==1) Alert(\”H4 Buy at Ask=\”,Ask,\”, Bid=\”,Bid,\” Symbol=\”,Symbol());
}
else if((m1
万能指标代码
请登录之后再进行评论
登录