Hidden content
Amellian Member FREEDOM Joined Jan 5, 2015 Messages 16,426 Reaction score 5,164 Apr 14, 2016 #1 You need to log in to view the content.
Amellian Member FREEDOM Joined Jan 5, 2015 Messages 16,426 Reaction score 5,164 Apr 14, 2016 Thread starter #2 You need to log in to view the content.
S Stiven Member Joined Sep 30, 2006 Messages 204 Reaction score 87 Apr 14, 2016 #3 грааль по скринам , в коде полюбому зигзаг зашит помню эти индюки, на тосе такие видел , очень заинтересовали , глянул в код и ахерел,кому интересно скидываю (прятать код под хайд не вижу смысла) Spoiler: код Zorex declare lower; input price = hlc3; input reversalAmount = 0.05; rec state = {default init, undefined, uptrend, downtrend}; rec minMaxPrice; if (getValue(state, 1) == getValue(state.init, 0)) { minMaxPrice = price; state = state.undefined; } else if (getValue(state, 1) == getValue(state.undefined, 0)) { if (price <= getValue(minMaxPrice, 1) - getValue(minMaxPrice, 1) * reversalAmount / 100) { state = state.downtrend; minMaxPrice = price; } else if (price >= getValue(minMaxPrice, 1) + getValue(minMaxPrice, 1) * reversalAmount / 100) { state = state.uptrend; minMaxPrice = price; } else { state = state.undefined; minMaxPrice = getValue(minMaxPrice, 1); } } else if (getValue(state, 1) == getValue(state.uptrend, 0)) { if (price <= getValue(minMaxPrice, 1) - getValue(minMaxPrice, 1) * reversalAmount / 100) { state = state.downtrend; minMaxPrice = price; } else { state = state.uptrend; minMaxPrice = Max(price, getValue(minMaxPrice, 1)); } } else { if (price >= getValue(minMaxPrice, 1) + getValue(minMaxPrice, 1) * reversalAmount / 100) { state = state.uptrend; minMaxPrice = price; } else { state = state.downtrend; minMaxPrice = Min(price, getValue(minMaxPrice, 1)); } } plot “ZZT$” = if state == state.uptrend and !IsNan(close) then 1 else if state == state.downtrend and !IsNan(close) then -1 else Double.NaN; “ZZT$”.SetDefaultColor(GetColor(1)); def Vol = volume; rec countp = if “zzT$” >= 0 then countp[1] + vol else 0; plot upvol = countp; upvol.SetDefaultColor(Color.GReen); upvol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM); rec countn = if “zzT$”<= 0 then countn[1] + vol else 0; plot dnvol = countn; dnvol.SetDefaultColor(Color.red); dnvol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM); # plot VolAvg = Average(upvol + dnvol/2 , 10); # VolAvg.SetDefaultColor(GetColor(8)); ProfiZorex (или хер знает как он там правильно называется , не могу прочитать) declare lower; input price = close;input reversalAmount = 1.0;input showBubbles = no;input showLabel = no; assert(reversalAmount > 0, "'reversal amount' should be positive: " + reversalAmount); plot "ZZ$" = reference ZigZagHighLow(price, price, 0, reversalAmount, 1, 0); def zzSave = if !IsNaN("ZZ$") then price else getValue(zzSave, 1); def chg = price - getValue(zzSave, 1); def isUp = chg >= 0; def isDn = chg < 0; def isConf = AbsValue(chg) >= reversalAmount or (IsNaN(getValue("ZZ$", 1)) and getValue(isConf, 1)); "ZZ$".EnableApproximation(); "ZZ$".DefineColor("Up Trend", Color.UPTICK); "ZZ$".DefineColor("Down Trend", Color.DOWNTICK); "ZZ$".DefineColor("Undefined", Color.DARK_ORANGE); "ZZ$".AssignValueColor(if !isConf then "ZZ$".color("Undefined") else if isUp then "ZZ$".color("Up Trend") else "ZZ$".color("Down Trend")); DefineGlobalColor("Unconfirmed", Color.DARK_ORANGE); DefineGlobalColor("Up", Color.UPTICK); DefineGlobalColor("Down", Color.DOWNTICK); plot “ZZT$” = if isUP and !IsNan(close) then 1 else if !IsNan(close) then -1 else Double.NaN; “ZZT$”.SetDefaultColor(GetColor(1)); def Vol = volume; rec countp = if “zzT$” >= 0 then countp[1] + vol else 0; plot upvol = countp; upvol.SetDefaultColor(Color.GReen); upvol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM); rec countn = if “zzT$”<= 0 then countn[1] + vol else 0; plot dnvol = countn; dnvol.SetDefaultColor(Color.red); dnvol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM); def barNumber = barNumber(); AddChartBubble(showBubbles and !IsNaN("ZZ$") and barNumber != 1 and isUp, upvol, upvol, if !isConf then globalColor("Unconfirmed") else if isUp then globalColor("Up") else globalColor("Down"), isUp); AddChartBubble(showBubbles and !IsNaN("ZZ$") and barNumber != 1 and isDn, dnvol, dnvol, if !isConf then globalColor("Unconfirmed") else if isUp then globalColor("Up") else globalColor("Down"), isUp); AddLabel(showLabel and barNumber != 1, (if isConf then "Confirmed " else "Unconfirmed ") + "ZigZag: " + chg, if !isConf then globalColor("Unconfirmed") else if isUp then globalColor("Up") else globalColor("Down")); Last edited by a moderator: Apr 15, 2016
грааль по скринам , в коде полюбому зигзаг зашит помню эти индюки, на тосе такие видел , очень заинтересовали , глянул в код и ахерел,кому интересно скидываю (прятать код под хайд не вижу смысла) Spoiler: код Zorex declare lower; input price = hlc3; input reversalAmount = 0.05; rec state = {default init, undefined, uptrend, downtrend}; rec minMaxPrice; if (getValue(state, 1) == getValue(state.init, 0)) { minMaxPrice = price; state = state.undefined; } else if (getValue(state, 1) == getValue(state.undefined, 0)) { if (price <= getValue(minMaxPrice, 1) - getValue(minMaxPrice, 1) * reversalAmount / 100) { state = state.downtrend; minMaxPrice = price; } else if (price >= getValue(minMaxPrice, 1) + getValue(minMaxPrice, 1) * reversalAmount / 100) { state = state.uptrend; minMaxPrice = price; } else { state = state.undefined; minMaxPrice = getValue(minMaxPrice, 1); } } else if (getValue(state, 1) == getValue(state.uptrend, 0)) { if (price <= getValue(minMaxPrice, 1) - getValue(minMaxPrice, 1) * reversalAmount / 100) { state = state.downtrend; minMaxPrice = price; } else { state = state.uptrend; minMaxPrice = Max(price, getValue(minMaxPrice, 1)); } } else { if (price >= getValue(minMaxPrice, 1) + getValue(minMaxPrice, 1) * reversalAmount / 100) { state = state.uptrend; minMaxPrice = price; } else { state = state.downtrend; minMaxPrice = Min(price, getValue(minMaxPrice, 1)); } } plot “ZZT$” = if state == state.uptrend and !IsNan(close) then 1 else if state == state.downtrend and !IsNan(close) then -1 else Double.NaN; “ZZT$”.SetDefaultColor(GetColor(1)); def Vol = volume; rec countp = if “zzT$” >= 0 then countp[1] + vol else 0; plot upvol = countp; upvol.SetDefaultColor(Color.GReen); upvol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM); rec countn = if “zzT$”<= 0 then countn[1] + vol else 0; plot dnvol = countn; dnvol.SetDefaultColor(Color.red); dnvol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM); # plot VolAvg = Average(upvol + dnvol/2 , 10); # VolAvg.SetDefaultColor(GetColor(8)); ProfiZorex (или хер знает как он там правильно называется , не могу прочитать) declare lower; input price = close;input reversalAmount = 1.0;input showBubbles = no;input showLabel = no; assert(reversalAmount > 0, "'reversal amount' should be positive: " + reversalAmount); plot "ZZ$" = reference ZigZagHighLow(price, price, 0, reversalAmount, 1, 0); def zzSave = if !IsNaN("ZZ$") then price else getValue(zzSave, 1); def chg = price - getValue(zzSave, 1); def isUp = chg >= 0; def isDn = chg < 0; def isConf = AbsValue(chg) >= reversalAmount or (IsNaN(getValue("ZZ$", 1)) and getValue(isConf, 1)); "ZZ$".EnableApproximation(); "ZZ$".DefineColor("Up Trend", Color.UPTICK); "ZZ$".DefineColor("Down Trend", Color.DOWNTICK); "ZZ$".DefineColor("Undefined", Color.DARK_ORANGE); "ZZ$".AssignValueColor(if !isConf then "ZZ$".color("Undefined") else if isUp then "ZZ$".color("Up Trend") else "ZZ$".color("Down Trend")); DefineGlobalColor("Unconfirmed", Color.DARK_ORANGE); DefineGlobalColor("Up", Color.UPTICK); DefineGlobalColor("Down", Color.DOWNTICK); plot “ZZT$” = if isUP and !IsNan(close) then 1 else if !IsNan(close) then -1 else Double.NaN; “ZZT$”.SetDefaultColor(GetColor(1)); def Vol = volume; rec countp = if “zzT$” >= 0 then countp[1] + vol else 0; plot upvol = countp; upvol.SetDefaultColor(Color.GReen); upvol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM); rec countn = if “zzT$”<= 0 then countn[1] + vol else 0; plot dnvol = countn; dnvol.SetDefaultColor(Color.red); dnvol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM); def barNumber = barNumber(); AddChartBubble(showBubbles and !IsNaN("ZZ$") and barNumber != 1 and isUp, upvol, upvol, if !isConf then globalColor("Unconfirmed") else if isUp then globalColor("Up") else globalColor("Down"), isUp); AddChartBubble(showBubbles and !IsNaN("ZZ$") and barNumber != 1 and isDn, dnvol, dnvol, if !isConf then globalColor("Unconfirmed") else if isUp then globalColor("Up") else globalColor("Down"), isUp); AddLabel(showLabel and barNumber != 1, (if isConf then "Confirmed " else "Unconfirmed ") + "ZigZag: " + chg, if !isConf then globalColor("Unconfirmed") else if isUp then globalColor("Up") else globalColor("Down"));
ishtar Member Biber my nigga Joined Feb 24, 2015 Messages 1,786 Reaction score 1,293 Apr 15, 2016 #4 Stiven said: грааль по скринам , в коде полюбому зигзаг зашит помню эти индюки, на тосе такие видел , очень заинтересовали , глянул в код и ахерел,кому интересно скидываю (прятать код под хайд не вижу смысла) Click to expand... тогда прячь под спойлер такие длинные тексты\коды
Stiven said: грааль по скринам , в коде полюбому зигзаг зашит помню эти индюки, на тосе такие видел , очень заинтересовали , глянул в код и ахерел,кому интересно скидываю (прятать код под хайд не вижу смысла) Click to expand... тогда прячь под спойлер такие длинные тексты\коды