Перейти к содержанию
Форекс Форум трейдеров Академии «MasterForex-V»

ZIGANI

Пользователи
  • Постов

    2
  • Зарегистрирован

  • Посещение

Достижения ZIGANI

пробегал

пробегал (2/5)

0

Репутация

  1. Код написан с ошибками не if (i == 1) {LLV = MCD_Arr;} а if (i == 1) {LLV = MCD_Arr;} // и так везде без . http://andrei.moy.su/jpg/8691402.jpg Индикаторы для MetaStock - Oscillator - Schaff Trend Cycle by Jose Silva hxxp://www.virtuosclub.ru/main/ind/M/macdoscillatorschafftrendcyclebyjosesilva /*[[ Name := Schaff Trend Cycle Author := Copyright © 2004, FostarFX link := "mail: fostar_fx@yahoo.com" Separate Window := Yes First Color := Lime First Draw Type := Line First Symbol := 217 Use Second Data := No Second Color := Red Second Draw Type := Line Second Symbol := 218 Minimum Chart Limits := -10.000000 Maximum Chart Limits := 110.000000 ]]*/ Inputs: MAShort(23), MALong(50), Cycle(10), BarsCount(300); Variable : shift(0), MCD(0), LLV(0), HHV(0), n(0), i(0), s(0), MA_Short(0), MA_Long(0), ST(0), check_begin(false), check_begin_MA(false), sum(0), MA(0), prev(0), smconst(0), bars_(0); Array : MCD_Arr[100](0); SetLoopCount(0); check_begin = false; check_begin_MA = false; n = 1; s = 1; smconst = 2 / (1 + Cycle/2); if BarsCount > 0 then { if BarsCount > Bars then {bars_ = Bars;} else {bars_ = BarsCount;} } else {bars_ = Bars;}; For shift= bars_ Downto 0 Begin MA_Short = iMAEx(MAShort, MODE_EMA, 0, PRICE_TYPICAL, shift); MA_Long = iMAEx(MALong, MODE_EMA, 0, PRICE_TYPICAL, shift); MCD_Arr[n] = MA_Short - MA_Long; MCD = MA_Short - MA_Long; if n >= Cycle then Begin n = 1; check_begin = true; end else n = n + 1; if check_begin then begin for i = 1 to Cycle Begin if i = 1 then LLV = MCD_Arr[i] else begin if LLV > MCD_Arr[i] then LLV = MCD_Arr[i]; end; if i = 1 then HHV = MCD_Arr[i] else begin if HHV < MCD_Arr[i] then HHV = MCD_Arr[i]; end; end; ST = ((MCD - LLV)/(HHV - LLV))*100 + 0.01; s = s + 1; if s >= (Cycle)/2 then Begin s = 1; check_begin_MA = true; end; end else ST = 0; if check_begin_MA then begin prev = GetIndexValue(shift + 1); MA = smconst * (ST - prev) + prev; SetIndexValue(shift, MA); end; End;
×
×
  • Создать...