|
本帖最後由 abc889900 於 17-8-23 13:14 編輯
本人是新手,第一次寫程式的,可以幫忙看看以下程式碼為何在測試時出現錯誤訊息
varX(1) 是否指 varX 的前一數值?
------ Compiled with error(s): ------
Unknown Function
line 24, column 0
- variables:
- var0( 0 ),
- var1( 0 ),
- var2( 0 ),
- var3( 0 ),
- var4( 0 ),
- var5( 0 ),
- var6( 0 ),
- var7( 0 ),
- var8( 0 ),
- var9( 0 ),
- var10( 0 ),
- var11( 0 ),
- var12( 0 ),
- var13( 0 ),
- var14( 0 ),
- var15( 0 );
- var1=(HIGHD(9)-CLOSE)/(HIGHD(9)-LOWD(9))*100-80;
- var2=SMA(var1,9,1)+50;
- var3=(CLOSE-LOWD(9))/(HIGHD(9)-LOWD(9))*100;
- var4=SMA(value3,3,1);
- var5=SMA(value4,3,1)+100;
- var6=var5-var2;
- If var6>30 then var7 = (value6-30) else var7=0;
- var8=var7(1)-var7
- Plot1(var8);
- If var8> 0 then SetPlotColor(1,red)
- else
- SetPlotColor(1,green);
- var9=SMA((CLOSE-LOWD(5))/(HIGHD(5)-LOWD(5))*100,3,1);
- var10=3*var9-2*var9;
- var11=(HIGHD(12)-C)/(HIGHD(12)-LOWD(12));
- var12=(C-LOWD(12))/(HIGHD(12)-LOWD(12));
- var13=SMA(SMA(value21,3,1),3,1);
- var14=(var13-SMA(var13,12,1))-0.5;
- if var14>0.00 then var14=var13 else var14=0.00;
- var15=value24(1)
- Condition1=var10 crosses over 25;
- if Condition1 then
- Print("Buy")
- else
- begin
- Condition1=var10(1) crosses over var10(0);
- if Condition1 then
- Print("Sell");
- End;
複製代碼
|
|