我这里有个德马克指标编译不通过 但我不会修改 谁会修改帮忙修改下,指标只是作为辅助 如果你认为也不错 拿去用,别忘了修改后发我一份
///////////
TD序列源码:
- int start()
- {
- int counted_bars=IndicatorCounted();
- int bSetup, sSetup, bCountdown, sCountdown;
- int x;
- double tfm=Space*Point;
- double CountTest;
- bool bSetupInd, sSetupInd, bPerfect, sPerfect;
- //----
- for(int i=NumBars; i>=0; i--)
- {
- ObjectDelete(""+i);
- ObjectDelete("cd"+i);
- //+------------------------------------------------------------------+
- //| Buy Setup |
- //+------------------------------------------------------------------+
- if(Close<=Close[i+4] && Close[i+1]>=Close[i+5] && bSetup==0)//start setup
- {
- bSetup++;
- ObjectCreate(""+i,OBJ_TEXT,0,Time,Low-tfm);
- ObjectSetText(""+i,""+bSetup,8,"Arial",Setup);
- }
- if(Close<Close[i+4] && bSetup!=0 && ObjectFind(""+i)==-1)
- {
- bSetup++;
- if(bSetup==9)
- {
- ObjectCreate(""+i,OBJ_TEXT,0,Time,Low-tfm);
- ObjectSetText(""+i,""+bSetup,10,"Arial Black",Setup);
- bSetup=0;
- bSetupInd=true;
- sSetupInd=false;
- sCountdown=0;
- }
- else
- {
- ObjectCreate(""+i,OBJ_TEXT,0,Time,Low-tfm);
- ObjectSetText(""+i,""+bSetup,8,"Arial",Setup);
- }
- }
- //if setup is completed look for criteria for perfect setup
- if(bSetupInd==true)
- {
- if(Low[i+1]<=Low[i+3] || Low<=Low[i+2])
- {
- bSetupInd=false;
- bPerfect=true;
- bPerfected=Low-tfm*2;
- bCountdown=1;
- }
- if(Alerts==True && last_alert!=Time[0])
- {
- last_alert = Time[0];
- Alert("TD Sequential - ", Symbol(), " Buy Signal Perfected");
- }
- }
- //Deletes numbers that were created if there is a break in sequence before 9 is reached
- else if(Close>=Close[i+4] && bSetup!=0)
- {
- for(x=i+1; x<=i+bSetup+1; x++) ObjectDelete(""+x);
- bSetup=0;
- }
- //+------------------------------------------------------------------+
- //| Buy Countdown Setup |
- //+------------------------------------------------------------------+
- if(bCountdown==13 && Close<=Close[i+1] && Close>CountTest)
- {
- ObjectCreate("cd"+i,OBJ_TEXT,0,Time,Low-tfm*2.5);
- ObjectSetText("cd"+i,"+",8,"Arial",Countdown);
- }
- if(bCountdown==13 && Close<=Close[i+1] && Close<=CountTest)
- {
- ObjectCreate("cd"+i,OBJ_TEXT,0,Time,Low-tfm*2.5);
- ObjectSetText("cd"+i,""+bCountdown,8,"Arial",Countdown);
- bCountdown=0;
- if(Alerts==True && last_alert!=Time[0])
- {
- last_alert = Time[0];
- Alert("TD Sequential - ", Symbol(), " Buy Countdown Completed");
- }
- Buy=Low-tfm*4;
- }
- if(bCountdown>=1 && bCountdown<13 && Close<=Close[i+2])
- {
- if(bCountdown==8)CountTest=Close;
- ObjectCreate("cd"+i,OBJ_TEXT,0,Time,Low-tfm*2.5);
- ObjectSetText("cd"+i,""+bCountdown,8,"Arial",Countdown);
- bCountdown++;
- }
- //+------------------------------------------------------------------+
- //| Sell Setup |
- //+------------------------------------------------------------------+
- if(Close>=Close[i+4] && Close[i+1]<=Close[i+5] && bSetup==0)//start setup
- {
- sSetup++;
- ObjectCreate(""+i,OBJ_TEXT,0,Time,High+tfm);
- ObjectSetText(""+i,""+sSetup,8,"Arial",Setup);
- }
- if(Close>=Close[i+4] && sSetup!=0 && ObjectFind(""+i)==-1)
- {
- sSetup++;
- if(sSetup==9)
- {
- ObjectCreate(""+i,OBJ_TEXT,0,Time,High+tfm);
- ObjectSetText(""+i,""+sSetup,10,"Arial Black",Setup);
- sSetup=0;
- sSetupInd=true;
- bSetupInd=false;
- bCountdown=0;
- }
- else
- {
- ObjectCreate(""+i,OBJ_TEXT,0,Time,High+tfm);
- ObjectSetText(""+i,""+sSetup,8,"Arial",Setup);
- }
- }
- //Perfected Setup
- if(sSetupInd==true)
- {
- if(Low[i+1]>=Low[i+3] || Low>=Low[i+2])
- {
- sSetupInd=false;
- sPerfect=true;
- sPerfected=High+tfm*2;
- sCountdown=1;
- }
- if(Alerts==True && last_alert!=Time[0])
- {
- last_alert = Time[0];
- Alert("TD Sequential - ", Symbol(), " Sell Signal Perfected");
- }
- }
- //Deletes numbers that were created if there is a break in sequence before 9 is reached
- else if(Close<=Close[i+4] && sSetup!=0)
- {
- for(x=i+1; x<=i+sSetup; x++) ObjectDelete(""+x);
- sSetup=0;
- }
- //+------------------------------------------------------------------+
- //| Sell Countdown Setup |
- //+------------------------------------------------------------------+
- if(sCountdown==13 && Close>=Close[i+2] && Close>=CountTest)
- {
- ObjectCreate("cd"+i,OBJ_TEXT,0,Time,High+tfm*2.5);
- ObjectSetText("cd"+i,""+sCountdown,8,"Arial",Countdown);
- sCountdown=0;
- Sell=High+tfm*4;
- if(Alerts==True && last_alert!=Time[0])
- {
- last_alert = Time[0];
- Alert("TD Sequential - ", Symbol(), " Sell Countdown Completed");
- }
- }
- if(sCountdown==13 && Close>=Close[i+2] && Close<CountTest)
- {
- ObjectCreate("cd"+i,OBJ_TEXT,0,Time,High+tfm*2.5);
- ObjectSetText("cd"+i,"+",8,"Arial",Countdown);
- }
- if(sCountdown>=1 && sCountdown<13 && Close>=Close[i+2])
- {
- if(sCountdown==8)CountTest=Close;
- ObjectCreate("cd"+i,OBJ_TEXT,0,Time,High+tfm*2.5);
- ObjectSetText("cd"+i,""+sCountdown,8,"Arial",Countdown);
- sCountdown++;
- }
- }
- //+------------------------------------------------------------------+
- //| TDST Support and Resistance lines |
- //+------------------------------------------------------------------+
- for(int j=Bars-counted_bars+10; j>=0; j--)
- {
- //TDST Support
- if(Close[j]<=Close[j+4]&& Close[j+1]>=Close[j+5] && Close[j-1]<=Close[j+3] && Close[j-2]<=Close[j+2] &&
- Close[j-3]<=Close[j+1] && Close[j-4]<=Close[j] && Close[j-5]<=Close[j-1] && Close[j-6]<=Close[j-2] &&
- Close[j-7]<=Close[j-3] && Close[j-8]<=Close[j-4])
- {
- Support[j]=High[j];
- Support[j+1]=EMPTY_VALUE;
- }
- else Support[j]=Support[j+1];
- //TDST Resistance
- if(Close[j]>=Close[j+4]&& Close[j+1]<=Close[j+5] && Close[j-1]>=Close[j+3] && Close[j-2]>=Close[j+2] &&
- Close[j-3]>=Close[j+1] && Close[j-4]>=Close[j] && Close[j-5]>=Close[j-1] && Close[j-6]>=Close[j-2] &&
- Close[j-7]>=Close[j-3] && Close[j-8]>=Close[j-4])
- {
- Resistance[j]=Low[j];
- Resistance[j+1]=EMPTY_VALUE;
- }
- else Resistance[j]=Resistance[j+1];
- }
- //----
- return(0);
- }
- //+------------------------------------------------------------------
复制代码
|