COCO研究院

 找回密碼
 註冊
搜索
查看: 18310|回復: 3

[範例程式碼] 這個很神奇的趨勢轉折程式碼,有愿意帮忙轉換成mc的嗎?

[複製鏈接]
發表於 22-9-25 18:10 | 顯示全部樓層 |閱讀模式
這個程式碼很複雜,是用thinkscript編寫的.效果很不錯.哪位兄弟姐妹出手,把它轉成MC上面用.不勝感激.
  1. def price = close;
  2. def superfast_length = 9;
  3. def fast_length = 14;
  4. def slow_length = 21;
  5. def displace = 0;

  6. def mov_avg9 = ExpAverage(price[-displace], superfast_length);
  7. def mov_avg14 = ExpAverage(price[-displace], fast_length);
  8. def mov_avg21 = ExpAverage(price[-displace], slow_length);

  9. #moving averages
  10. def Superfast = mov_avg9;
  11. def Fast = mov_avg14;
  12. def Slow = mov_avg21;

  13. def buy = mov_avg9 > mov_avg14 and mov_avg14 > mov_avg21 and low > mov_avg9;
  14. def stopbuy = mov_avg9 <= mov_avg14;
  15. def buynow = !buy[1] and buy;
  16. def buysignal = CompoundValue(1, if buynow and !stopbuy then 1 else if buysignal[1] == 1 and stopbuy then 0 else buysignal[1], 0);

  17. def Buy_Signal = buysignal[1] == 0 and buysignal == 1;

  18. #Alert(condition = buysignal[1] == 0 and buysignal == 1, text = "Buy Signal", sound = Sound.Bell, "alert type" = Alert.BAR);

  19. def Momentum_Down = buysignal[1] == 1 and buysignal == 0;

  20. #Alert(condition = buysignal[1] == 1 and buysignal == 0, text = "Momentum_Down", sound = Sound.Bell, "alert type" = Alert.BAR);

  21. def sell = mov_avg9 < mov_avg14 and mov_avg14 < mov_avg21 and high < mov_avg9;
  22. def stopsell = mov_avg9 >= mov_avg14;
  23. def sellnow = !sell[1] and sell;
  24. def sellsignal = CompoundValue(1, if sellnow and !stopsell then 1 else if sellsignal[1] == 1 and stopsell then 0 else sellsignal[1], 0);

  25. def Sell_Signal = sellsignal[1] == 0 and sellsignal;

  26. #Alert(condition = sellsignal[1] == 0 and sellsignal == 1, text = "Sell Signal", sound = Sound.Bell, "alert type" = Alert.BAR);

  27. def Momentum_Up = sellsignal[1] == 1 and sellsignal == 0;

  28. #Alert(condition = sellsignal[1] == 1 and sellSignal == 0, text = "Momentum_Up", sound = Sound.Bell, "alert type" = Alert.BAR);

  29. plot Colorbars = if buysignal == 1 then 1 else if sellsignal == 1 then 2 else if buysignal == 0 or sellsignal == 0 then 3 else 0;
  30. Colorbars.Hide();
  31. Colorbars.DefineColor("Buy_Signal_Bars", Color.GREEN);
  32. Colorbars.DefineColor("Sell_Signal_Bars", Color.RED);
  33. Colorbars.DefineColor("Neutral", Color.PLUM);
  34. #___________________________________________________________________________

  35. input method = {default average, high_low};
  36. def bubbleoffset = .0005;
  37. def percentamount = .01;
  38. def revAmount = .05;
  39. def atrreversal = 2.0;
  40. def atrlength = 5;
  41. def pricehigh = high;
  42. def pricelow = low;
  43. def averagelength = 5;
  44. def averagetype = AverageType.EXPONENTIAL;
  45. def mah = MovingAverage(averagetype, pricehigh, averagelength);
  46. def mal = MovingAverage(averagetype, pricelow, averagelength);
  47. def priceh = if method == method.high_low then pricehigh else mah;
  48. def pricel = if method == method.high_low then pricelow else mal;
  49. def EI = ZigZagHighLow("price h" = priceh, "price l" = pricel, "percentage reversal" = percentamount, "absolute reversal" = revAmount, "atr length" = atrlength, "atr reversal" = atrreversal);
  50. def reversalAmount = if (close * percentamount / 100) > Max(revAmount < atrreversal * reference ATR(atrlength), revAmount) then (close * percentamount / 100) else if revAmount < atrreversal * reference ATR(atrlength) then atrreversal * reference ATR(atrlength) else revAmount;
  51. rec EISave = if !IsNaN(EI) then EI else GetValue(EISave, 1);
  52. def chg = (if EISave == priceh then priceh else pricel) - GetValue(EISave, 1);
  53. def isUp = chg >= 0;
  54. rec isConf = AbsValue(chg) >= reversalAmount or (IsNaN(GetValue(EI, 1)) and GetValue(isConf, 1));
  55. def EId = if isUp then 1 else 0;
  56. #plot EnhancedLines = if EId <= 1 then EI else Double.NaN;
  57. #EnhancedLines.AssignValueColor(if EId == 1 then Color.GREEN else if EId == 0 then Color.RED else Color.DARK_ORANGE);
  58. #EnhancedLines.SetStyle(Curve.FIRM);
  59. #EnhancedLines.EnableApproximation();
  60. #EnhancedLines.HideBubble();
  61. #Price Change between Enhanceds
  62. def xxhigh = if EISave == priceh then priceh else xxhigh[1];
  63. def chghigh = priceh - xxhigh[1];
  64. def xxlow = if EISave == pricel then pricel else xxlow[1];
  65. def chglow = pricel - xxlow[1];
  66. def showBubbleschange = no;
  67. AddChartBubble(showBubbleschange and !IsNaN(EI) and BarNumber() != 1, if isUp then priceh * (1 + bubbleoffset) else pricel * (1 - bubbleoffset) , "$" + chg , if isUp and chghigh > 0 then Color.GREEN else if isUp and chghigh < 0 then Color.RED else if isUp then Color.YELLOW else if !isUp and chglow > 0 then Color.GREEN else if !isUp and chglow < 0 then Color.RED else Color.YELLOW, isUp);
  68. #Price at High/Low
  69. def showBubblesprice = no;
  70. AddChartBubble(showBubblesprice and !IsNaN(EI) and BarNumber() != 1, if isUp then priceh * (1 + bubbleoffset) else pricel * (1 - bubbleoffset) , if isUp then "$" + priceh else "$" + pricel , if isUp and chghigh > 0 then Color.GREEN else if isUp and chghigh < 0 then Color.RED else if isUp then Color.YELLOW else if !isUp and chglow > 0 then Color.GREEN else if !isUp and chglow < 0 then Color.RED else Color.YELLOW, isUp);
  71. #Label for Confirmed/Unconfirmed Status of Current Enhanced

  72. #Bar Count between Enhanceds
  73. rec EIcount = if EISave[1] != EISave then 1 else if EISave[1] == EISave then EIcount[1] + 1 else 0;
  74. def EIcounthilo = if EIcounthilo[1] == 0 and (EISave == priceh or EISave == pricel) then 1 else if EISave == priceh or EISave == pricel then EIcounthilo[1] + 1 else EIcounthilo[1];
  75. def EIhilo = if EISave == priceh or EISave == pricel then EIcounthilo else EIcounthilo + 1;
  76. def EIcounthigh = if EISave == priceh then EIcount[1] else Double.NaN;
  77. def EIcountlow = if EISave == pricel then EIcount[1] else Double.NaN;
  78. def showBubblesbarcount = no;
  79. AddChartBubble(showBubblesbarcount and !IsNaN(EI) and BarNumber() != 1, if isUp then priceh * (1 + bubbleoffset) else pricel * (1 - bubbleoffset) , if EISave == priceh then EIcounthigh else EIcountlow, if isUp and chghigh > 0 then Color.GREEN else if isUp and chghigh < 0 then Color.RED else if isUp then Color.YELLOW else if !isUp and chglow > 0 then Color.GREEN else if !isUp and chglow < 0 then Color.RED else Color.YELLOW, if isUp then yes else no );
  80. #Arrows
  81. def EIL = if !IsNaN(EI) and !isUp then pricel else GetValue(EIL, 1);
  82. def EIH = if !IsNaN(EI) and isUp then priceh else GetValue(EIH, 1);
  83. def dir = CompoundValue(1, if EIL != EIL[1] or pricel == EIL[1] and pricel == EISave then 1 else if EIH != EIH[1] or priceh == EIH[1] and priceh == EISave then -1 else dir[1], 0);
  84. def signal = CompoundValue(1, if dir > 0 and pricel > EIL then if signal[1] <= 0 then 1 else signal[1] else if dir < 0 and priceh < EIH then if signal[1] >= 0 then -1 else signal[1] else signal[1], 0);
  85. def showarrows = yes;
  86. def U1 = showarrows and signal > 0 and signal[1] <= 0;
  87. #U1.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
  88. #U1.SetDefaultColor(Color.GREEN);
  89. #U1.SetLineWeight(4);
  90. def D1 = showarrows and signal < 0 and signal[1] >= 0;
  91. #D1.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
  92. #D1.SetDefaultColor(Color.RED);
  93. #D1.SetLineWeight(4);
  94. def barnumber = BarNumber()[10];

  95. AddChartBubble((barnumber and U1), if isUp then low else high, if showarrows and signal > 0 and signal[1] <= 0 then "Reversal:" + low else "" , if Colorbars == 3 then Color.PLUM else Color.UPTICK, no);
  96. AddChartBubble((barnumber and D1), if isUp then low else high, if showarrows and signal < 0 and signal[1] >= 0 then "Reversal:" + high else "" , if Colorbars == 3 then Color.PLUM else Color.DOWNTICK, yes);

  97. def revLineTop;
  98. def revLineBot;

  99. if barnumber and D1 {
  100. revLineBot = Double.NaN;
  101. revLineTop = high[1];
  102. } else if barnumber and U1 {
  103. revLineTop = Double.NaN;
  104. revLineBot = low[1];
  105. } else if !IsNaN(revLineBot[1]) and (Colorbars[2] == 2 or Colorbars[1] == 2) {
  106. revLineBot = revLineBot[1];
  107. revLineTop = Double.NaN;
  108. } else if !IsNaN(revLineTop[1]) and (Colorbars[2] == 1 or Colorbars[1] == 1) {
  109. revLineTop = revLineTop[1];
  110. revLineBot = Double.NaN;
  111. } else {
  112. revLineTop = Double.NaN;
  113. revLineBot = Double.NaN;
  114. }

  115. plot botLine = revLineBot[-1];
  116. botLine.SetDefaultColor(Color.LIGHT_GREEN);
  117. plot topLine = revLineTop[-1];
  118. topLine.SetDefaultColor(Color.LIGHT_RED);

  119. #Alerts
  120. def usealerts = no;
  121. #Alert(usealerts and U1, "EI-UP", Alert.BAR, Sound.Bell);
  122. #Alert(usealerts and D1, "EI-DOWN", Alert.BAR, Sound.Chimes);
  123. #Supply Demand Areas
  124. rec data1 = CompoundValue(1, if (EISave == priceh or EISave == pricel) then data1[1] + 1 else data1[1], 0);
  125. def datacount1 = (HighestAll(data1) - data1[1]);
  126. def numbersuppdemandtoshow = 0;
  127. input showSupplyDemand = {default Pivot, Arrow, None};
  128. def idx = if showSupplyDemand == showSupplyDemand.Pivot then 1 else 0;
  129. def rLow;
  130. def rHigh;
  131. if signal crosses 0 {
  132. rLow = pricel[idx];
  133. rHigh = priceh[idx];
  134. } else {
  135. rLow = rLow[1];
  136. rHigh = rHigh[1];
  137. }
  138. def HighLine = if datacount1 <= numbersuppdemandtoshow and showSupplyDemand != showSupplyDemand.None and !IsNaN(close) and rHigh != 0 then rHigh else Double.NaN;

  139. def LowLine = if datacount1 <= numbersuppdemandtoshow and showSupplyDemand != showSupplyDemand.None and !IsNaN(close) and rLow != 0 then rLow else Double.NaN;

  140. def hlUp = if signal > 0 then HighLine else Double.NaN;
  141. def hlDn = if signal < 0 then HighLine else Double.NaN;

  142. def showsupplydemandcloud = no;
  143. AddCloud(if showsupplydemandcloud then hlUp else Double.NaN, LowLine, Color.LIGHT_GREEN, Color.LIGHT_GREEN);
  144. AddCloud(if showsupplydemandcloud then hlDn else Double.NaN, LowLine, Color.LIGHT_RED, Color.LIGHT_RED);
  145. #Store Previous Data
  146. def EIsave1 = if !IsNaN(EISave) then EISave else EIsave1[1];
  147. def EIsave2 = EIsave1;
  148. rec priorEI1 = if EIsave2 != EIsave2[1] then EIsave2[1] else priorEI1[1];
  149. rec priorEI2 = if priorEI1 != priorEI1[1] then priorEI1[1] else priorEI2[1];
  150. rec priorEI3 = if priorEI2 != priorEI2[1] then priorEI2[1] else priorEI3[1];
  151. #Fibonacci Extensions
  152. rec data = CompoundValue(1, if (EISave == priceh or EISave == pricel) then data[1] + 1 else data[1], 0);
  153. def datacount = (HighestAll(data) - data[1]);
  154. def numberextfibstoshow = 2;
  155. rec cpo = if dir[1] != dir then 0 else 1;
  156. def showFibExtLines = no;
  157. def showtodayonly = no;
  158. def today = if showtodayonly == yes then GetDay() == GetLastDay() else GetDay();
  159. def extfib1 = if EISave == priceh then priceh - AbsValue(priorEI2 - priorEI1) * 1
  160. else extfib1[1];
  161. def extfib100 = if datacount <= numberextfibstoshow and today and showFibExtLines and !IsNaN(extfib1) and dir < 0 and cpo != 0 then extfib1[1] else Double.NaN;

  162. def extfib1a = if EISave == priceh then priceh - AbsValue(priorEI2 - priorEI1) * 0.382
  163. else extfib1a[1];
  164. def extfib382 = if datacount <= numberextfibstoshow and today and showFibExtLines and !IsNaN(extfib1a) and dir < 0 and cpo != 0 then extfib1a[1] else Double.NaN;

  165. def extfib2 = if EISave == priceh then priceh - AbsValue(priorEI2 - priorEI1) *
  166. 0.618 else extfib2[1];
  167. def extfib618 = if datacount <= numberextfibstoshow and today and showFibExtLines and !IsNaN(extfib2) and dir < 0 and cpo != 0 then extfib2[1] else Double.NaN;

  168. def extfib3 = if EISave == priceh then priceh - AbsValue(priorEI2 - priorEI1) *
  169. 1.618 else extfib3[1];
  170. def extfib1618 = if datacount <= numberextfibstoshow and today and showFibExtLines and !IsNaN(extfib3) and dir < 0 and cpo != 0 then extfib3[1] else Double.NaN;

  171. def extfib3a = if EISave == priceh then priceh - AbsValue(priorEI2 - priorEI1) *
  172. 2.000 else extfib3a[1];
  173. def extfib2000 = if datacount <= numberextfibstoshow and today and showFibExtLines and !IsNaN(extfib3a) and dir < 0 and cpo != 0 then extfib3a[1] else Double.NaN;

  174. def extfib4 = if EISave == priceh then priceh - AbsValue(priorEI2 - priorEI1) *
  175. 2.618 else extfib4[1];
  176. def extfib2618 = if datacount <= numberextfibstoshow and today and showFibExtLines and !IsNaN(extfib4) and dir < 0 and cpo != 0 then extfib4[1] else Double.NaN;

  177. def extfib5 = if EISave == priceh then priceh - AbsValue(priorEI2 - priorEI1) *
  178. 3.618 else extfib5[1];
  179. def extfib3618 = if datacount <= numberextfibstoshow and today and showFibExtLines and !IsNaN(extfib5) and dir < 0 and cpo != 0 then extfib5[1] else Double.NaN;

  180. def extfib1_ = if EISave == pricel then pricel + AbsValue(priorEI2 - priorEI1) * 1
  181. else extfib1_[1];
  182. def extfib100_ = if datacount <= numberextfibstoshow and today and showFibExtLines and !IsNaN(extfib1_) and dir > 0 and cpo != 0 then extfib1_[1] else Double.NaN;

  183. def extfib1a_ = if EISave == pricel then pricel + AbsValue(priorEI2 - priorEI1) * 0.382
  184. else extfib1a_[1];
  185. def extfib382_ = if datacount <= numberextfibstoshow and today and showFibExtLines and !IsNaN(extfib1a_) and dir > 0 and cpo != 0 then extfib1a_[1] else Double.NaN;

  186. def extfib2_ = if EISave == pricel then pricel + AbsValue(priorEI2 - priorEI1) *
  187. 0.618 else extfib2_[1];
  188. def extfib618_ = if datacount <= numberextfibstoshow and today and showFibExtLines and !IsNaN(extfib2_) and dir > 0 and cpo != 0 then extfib2_[1] else Double.NaN;

  189. def extfib3_ = if EISave == pricel then pricel + AbsValue(priorEI2 - priorEI1) *
  190. 1.618 else extfib3_[1];
  191. def extfib1618_ = if datacount <= numberextfibstoshow and today and showFibExtLines and !IsNaN(extfib3_) and dir > 0 and cpo != 0 then extfib3_[1] else Double.NaN;

  192. def extfib3a_ = if EISave == pricel then pricel + AbsValue(priorEI2 - priorEI1) *
  193. 2.000 else extfib3a_[1];
  194. def extfib2000_ = if datacount <= numberextfibstoshow and today and showFibExtLines and !IsNaN(extfib3a_) and dir > 0 and cpo != 0 then extfib3a_[1] else Double.NaN;

  195. def extfib4_ = if EISave == pricel then pricel + AbsValue(priorEI2 - priorEI1) *
  196. 2.618 else extfib4_[1];
  197. def extfib2618_ = if datacount <= numberextfibstoshow and today and showFibExtLines and !IsNaN(extfib4_) and dir > 0 and cpo != 0 then extfib4_[1] else Double.NaN;

  198. def extfib5_ = if EISave == pricel then pricel + AbsValue(priorEI2 - priorEI1) *
  199. 3.618 else extfib5_[1];
  200. def extfib3618_ = if datacount <= numberextfibstoshow and today and showFibExtLines and !IsNaN(extfib5_) and dir > 0 and cpo != 0 then extfib5_[1] else Double.NaN;

  201. def fibextbubblespacesinexpansion = 8;
  202. def b = fibextbubblespacesinexpansion;
  203. def direction = if !isUp then 1 else 0;
  204. AddChartBubble( direction[b + 1] == 1 and showFibExtLines and !IsNaN(close[b + 1]) and IsNaN(close), extfib1[b + 2], "100%", Color.RED, no);
  205. AddChartBubble( direction[b + 1] == 1 and showFibExtLines and !IsNaN(close[b + 1]) and IsNaN(close), extfib1a[b + 2], "38.2%", Color.RED, no);
  206. AddChartBubble( direction[b + 1] == 1 and showFibExtLines and !IsNaN(close[b + 1]) and IsNaN(close), extfib2[b + 2], "61.8%", Color.RED, no);
  207. AddChartBubble( direction[b + 1] == 1 and showFibExtLines and !IsNaN(close[b + 1]) and IsNaN(close), extfib3[b + 2], "161.8%", Color.RED, no);
  208. AddChartBubble( direction[b + 1] == 1 and showFibExtLines and !IsNaN(close[b + 1]) and IsNaN(close), extfib3a[b + 2], "200%", Color.RED, no);
  209. AddChartBubble( direction[b + 1] == 1 and showFibExtLines and !IsNaN(close[b + 1]) and IsNaN(close), extfib4[b + 2], "261.8%", Color.RED, no);
  210. AddChartBubble( direction[b + 1] == 1 and showFibExtLines and !IsNaN(close[b + 1]) and IsNaN(close), extfib5[b + 2], "361.8%", Color.RED, no);
  211. AddChartBubble( direction[b + 1] == 0 and showFibExtLines and !IsNaN(close[b + 1]) and IsNaN(close), extfib1_[b + 2], "100%", Color.GREEN, yes);
  212. AddChartBubble( direction[b + 1] == 0 and showFibExtLines and !IsNaN(close[b + 1]) and IsNaN(close), extfib1a_[b + 2], "38.2%", Color.GREEN, yes);
  213. AddChartBubble( direction[b + 1] == 0 and showFibExtLines and !IsNaN(close[b + 1]) and IsNaN(close), extfib2_[b + 2], "61.8%", Color.GREEN, yes);
  214. AddChartBubble( direction[b + 1] == 0 and showFibExtLines and !IsNaN(close[b + 1]) and IsNaN(close), extfib3_[b + 2], "161.8%", Color.GREEN, yes);
  215. AddChartBubble( direction[b + 1] == 0 and showFibExtLines and !IsNaN(close[b + 1]) and IsNaN(close), extfib3a_[b + 2], "200%", Color.GREEN, yes);
  216. AddChartBubble( direction[b + 1] == 0 and showFibExtLines and !IsNaN(close[b + 1]) and IsNaN(close), extfib4_[b + 2], "261.8%", Color.GREEN, yes);
  217. AddChartBubble( direction[b + 1] == 0 and showFibExtLines and !IsNaN(close[b + 1]) and IsNaN(close), extfib5_[b + 2], "361.8%", Color.GREEN, yes);
  218. #Volume at Reversals
  219. def vol = if BarNumber() == 0 then 0 else volume + vol[1];
  220. def vol1 = if BarNumber() == 1 then volume else vol1[1];
  221. def xxvol = if EISave == priceh or EISave == pricel then TotalSum(volume) else xxvol[1];
  222. def chgvol = if xxvol - xxvol[1] + vol1 == vol then vol else xxvol - xxvol[1];
  223. def showBubblesVolume = no;
  224. AddChartBubble(showBubblesVolume and !IsNaN(EI) and BarNumber() != 1, if isUp then priceh * (1 + bubbleoffset) else pricel * (1 - bubbleoffset), chgvol, if isUp and chghigh > 0 then Color.GREEN else if isUp and chghigh < 0 then Color.RED else if isUp then Color.YELLOW else if !isUp and chglow > 0 then Color.GREEN else if !isUp and chglow < 0 then Color.RED else Color.YELLOW, if isUp then yes else no );

  225. input usemanualfibskip = no;#Hint usemanualfibskip: Select no to use preprogrammed fibskip amounts. Select no, to use the amount entered at input fibskip.
  226. input fibskip = .50;#Hint fibskip: Set input usemanualfibskip == yes to use this amount versus preprogrammed amounts. Standard is 1.0. This is percentage difference between fib high and low before a new fib grid created.
  227. def showBubblesfibratio = no;
  228. def showFibLabel = no;#Hint showfibLabel: Select yes to show label of current fib level as of last price
  229. def showfiblines = no;
  230. def fib1level = .236;
  231. def fib2level = .382;
  232. def fibMlevel = .500;
  233. def fib3level = .618;
  234. def fib4level = .786;
  235. #Fibs
  236. def datacount2 = (HighestAll(data1) - data1[1]);
  237. def numberfibretracementstoshow = 2;
  238. def fibskipit = if usemanualfibskip == no then if close > 800 then .25 else .5 else fibskip;
  239. def EIfibh = if EISave == priceh and AbsValue(EISave - EISave[1]) > priceh * fibskipit * .01 then priceh else EIfibh[1];
  240. def EIfibl = if EISave == pricel and AbsValue(EISave - EISave[1]) > priceh * fibskipit * .01 then pricel else EIfibl[1];
  241. def range = EIfibh - EIfibl;
  242. def fibH = if showfiblines == no then Double.NaN else if datacount2 <= numberfibretracementstoshow then EIfibh else Double.NaN;
  243. def fibL = if showfiblines == no then Double.NaN else if datacount2 <= numberfibretracementstoshow then EIfibl else Double.NaN;
  244. def fibM = if showfiblines == no then Double.NaN else if datacount2 <= numberfibretracementstoshow then EIfibl + range * fibMlevel else Double.NaN;
  245. def fib1 = if showfiblines == no then Double.NaN else if datacount2 <= numberfibretracementstoshow then EIfibl + range * fib1level else Double.NaN;
  246. def fib2 = if showfiblines == no then Double.NaN else if datacount2 <= numberfibretracementstoshow then EIfibl + range * fib2level else Double.NaN;
  247. def fib3 = if showfiblines == no then Double.NaN else if datacount2 <= numberfibretracementstoshow then EIfibl + range * fib3level else Double.NaN;
  248. def fib4 = if showfiblines == no then Double.NaN else if datacount2 <= numberfibretracementstoshow then EIfibl + range * fib4level else Double.NaN;

  249. AddLabel(showFibLabel, Concat( "Current Fib Level ", AsPercent((close - EIfibl) / (range))), if close > EIfibl then Color.GREEN else if EIfibh == close then Color.WHITE else Color.RED);

  250. AddChartBubble(showBubblesfibratio and !IsNaN(EI) and BarNumber() != 1, if isUp then priceh * (1 + bubbleoffset) else pricel * (1 - bubbleoffset) , if isUp then AsPercent((priceh - EIfibl) / (range)) else AsPercent((pricel - EIfibl) / range), if isUp and chghigh > 0 then Color.GREEN else if isUp and chghigh < 0 then Color.RED else if isUp then Color.GREEN else if !isUp and chglow > 0 then Color.GREEN else if !isUp and chglow < 0 then Color.RED else Color.RED, isUp);
複製代碼


發表於 22-9-28 20:00 | 顯示全部樓層
台灣同時會thinkscript和powerlanguage的人幾乎沒有吧..
 樓主| 發表於 22-9-29 22:14 | 顯示全部樓層
Option 發表於 22-9-28 20:00
台灣同時會thinkscript和powerlanguage的人幾乎沒有吧..

謝謝親的提醒,估計是不多,不同語言的腳本轉換確實是很麻煩的事情。
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

手機版|Archiver|站長信箱|廣告洽詢|COCO研究院

GMT+8, 24-11-24 23:54

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回復 返回頂部 返回列表
理財討論網站 |