經修正iff後,
Variables:TXT_onChart(0),TXT_Content("0"),
Value99=MarketPosition (Value99的定義) if Value99<>Value99[1] then TXT_Content = NumToStr( iffstring( Value99=0, ExitPrice(0), EntryPrice(0) ),0 ) TXT_onChart = TexT_New(Date , Time, iffstring(Value99>Value99[1], L, H) Points,"") TexT_SetString(TXT_onChart,iffstring(Value99>Value99[1],"|n"+"|n"+"|n"+"|n"+"|n"+"|n"+"|n"+TXT_Content,TXT_Content+"|n"+"|n"+"|n"+"|n"+"|n"+"|n")) TexT_SetStyle(TXT_onChart,12,2) TexT_SetColor(TXT_onChart, White) ENd If
編輯後訊息
Incorrect argument type. 編譯錯誤: (函數)
iffstring( Value99=0, ExitPrice(0), EntryPrice(0) ),0
iffstring(Value99>Value99[1], L, H) Points,"")的第二個參數錯誤
once value1=text_new(d,t,h,text(h)); text_setlocation(value1,d,t,h); text_setstring(value1,text(H));
這是範例程式~你可以依照這範例改成你要的...^^