Индикатор RH New High Low

vitas334

Новичок
Регистрация
09.02.14
Сообщения
95
Реакции
30
Всем привет ! Вот нашел индикатор,стрелочник. Пытаюсь приспособить,может какие-либо мысли будут на этот счет?


RH.PNG

Код:
declare upper;

input length      = 252;

def highestHigh   = fold highIdx = 1 to length with sHigh = high do if sHigh > GetValue( high, highIdx, length + 1 ) then sHigh else GetValue( high, highIdx, length + 1 );
plot NewHigh      = if highestHigh > highestHigh[1] then high else Double.NaN;

def lowestLow     = fold lowIdx = 1 to length with sLow = low do if sLow < GetValue( low, lowIdx, length + 1 ) then sLow else GetValue( low, lowIdx, length + 1 );
plot NewLow       = if lowestLow < lowestLow[1] then low else Double.NaN;

#===============================[ Look & Feel ]================================
NewHigh.SetPaintingStrategy( PaintingStrategy.ARROW_DOWN );
NewHigh.SetDefaultColor( Color.PLUM );
NewHigh.SetLineWeight( 3 );
NewLow.SetPaintingStrategy( PaintingStrategy.ARROW_UP );
NewLow.SetDefaultColor( Color.BLUE );
NewLow.SetLineWeight( 3 );
 

Sound2050

Непризнанный
Регистрация
03.04.14
Сообщения
34
Реакции
5
Sound2050 не предоставил никакой дополнительной информации.
Всем привет ! Вот нашел индикатор,стрелочник. Пытаюсь приспособить,может какие-либо мысли будут на этот счет?


Посмотреть вложение 3182

Код:
declare upper;

input length      = 252;

def highestHigh   = fold highIdx = 1 to length with sHigh = high do if sHigh > GetValue( high, highIdx, length + 1 ) then sHigh else GetValue( high, highIdx, length + 1 );
plot NewHigh      = if highestHigh > highestHigh[1] then high else Double.NaN;

def lowestLow     = fold lowIdx = 1 to length with sLow = low do if sLow < GetValue( low, lowIdx, length + 1 ) then sLow else GetValue( low, lowIdx, length + 1 );
plot NewLow       = if lowestLow < lowestLow[1] then low else Double.NaN;

#===============================[ Look & Feel ]================================
NewHigh.SetPaintingStrategy( PaintingStrategy.ARROW_DOWN );
NewHigh.SetDefaultColor( Color.PLUM );
NewHigh.SetLineWeight( 3 );
NewLow.SetPaintingStrategy( PaintingStrategy.ARROW_UP );
NewLow.SetDefaultColor( Color.BLUE );
NewLow.SetLineWeight( 3 );
:D Где ты его откопал? Это же обыкновенный Price Channel со стрелками только что-то слишком замудрёный!:D Замени def на plot и вот этот length параметр поставь 20 и посмотри на график.
 

vitas334

Новичок
Регистрация
09.02.14
Сообщения
95
Реакции
30
:D Где ты его откопал? Это же обыкновенный Price Channel со стрелками только что-то слишком замудрёный!:D Замени def на plot и вот этот length параметр поставь 20 и посмотри на график.


Да я его уже давно забросил.....
 

Sound2050

Непризнанный
Регистрация
03.04.14
Сообщения
34
Реакции
5
Sound2050 не предоставил никакой дополнительной информации.

vitas334

Новичок
Регистрация
09.02.14
Сообщения
95
Реакции
30
А что за канал у тебя на графике с красными и зелёными полосами? Я думал это он и есть.


Держи,вот он

Код:
#COG_inertia
#
# [email protected]
# April 5 2014,  find mid point (COG) using first order linear regression and slope
#                removed repainting

# Modified code from;
# Hurst_Channels
# www.trendxplorer.info
# [email protected]
# Build: July 25, 2012
# Rev 1: July 27, 2012: ExtrapolatedMA based on Kirills code
# Rev 2: July 29, 2012: FlowPrice value for better extremes
# Rev 3: Sept  9, 2012: Coloring for ExtrapolatedCMA added
#

#
# --- script begin ----
#

declare upper;

input price = ohlc4;
input length = 20;
input InnerValue = 1.618;
input OuterValue = 2.618;
input ExtremeValue = 4.236;
input OuterExtremeValue = 6.854;
input showFlowPrice = NO;
input showPriceBar = YES;
input smooth = 1;

def dPrice =  if !IsNaN(price) then Inertia(price, length) else  Inertia(dPrice[1], length - 1);

rec LRS = 6 * ( WMA(dPrice, length) -  Average(dPrice, length) ) / (length - 1);
rec CMA = if !IsNaN(dPrice) then Inertia(dPrice, length) - LRS * (length / 2) else  Inertia(CMA[1], length - 1) - LRS * (length / 2);

plot CenteredMA = if !IsNaN(dPrice) then CMA else Double.NaN;
CenteredMA.SetDefaultColor(GetColor(1));
CenteredMA.SetLineWeight(2);


def sterr = if !IsNaN(dprice - CMA) then StDev (dprice - CMA , 4 * length) else sterr[1];
;

def ExtremeBand = sterr * ExtremeValue;
def OuterBand   = sterr * OuterValue;
def InnerBand   = sterr * InnerValue;
def OuterExtremeBand = sterr * OuterExtremeValue;
plot UpperOuterExtremeBand = if !IsNaN(price) then CMA + OuterExtremeBand else Double.NaN;
plot LowerOuterExtremeBand = if !IsNaN(price) then CMA - OuterExtremeBand else Double.NaN;

plot UpperExtremeBand = if !IsNaN(price) then CMA + ExtremeBand else Double.NaN;
plot LowerExtremeBand = if !IsNaN(price) then CMA - ExtremeBand else Double.NaN;
plot UpperOuterBand   = if !IsNaN(price) then CMA + OuterBand else Double.NaN;
plot LowerOuterBand   = if !IsNaN(price) then CMA - OuterBand else Double.NaN;
plot UpperInnerBand   = if !IsNaN(price) then CMA + InnerBand else Double.NaN;
plot LowerInnerBand   = if !IsNaN(price) then CMA - InnerBand else Double.NaN;
UpperOuterExtremeBand.SetDefaultColor(GetColor(4));
UpperOuterExtremeBand.SetLineWeight(1);
UpperOuterExtremeBand.SetStyle(Curve.SHORT_DASH);
UpperExtremeBand.SetDefaultColor(GetColor(4));
UpperExtremeBand.SetLineWeight(1);
UpperExtremeBand.SetStyle(Curve.SHORT_DASH);
LowerOuterExtremeBand.SetDefaultColor(GetColor(4));
LowerOuterExtremeBand.SetLineWeight(1);
LowerOuterExtremeBand.SetStyle(Curve.SHORT_DASH);
LowerExtremeBand.SetDefaultColor(GetColor(4));
LowerExtremeBand.SetLineWeight(1);
LowerExtremeBand.SetStyle(Curve.SHORT_DASH);
#UpperExtremeBand.hide();
#LowerExtremeBand.hide();
#UpperOuterExtremeBand.hide();
#LowerOuterExtremeBand.hide();


UpperOuterBand.SetDefaultColor(GetColor(5));
UpperOuterBand.SetLineWeight(2);
LowerOuterBand.SetDefaultColor(GetColor(6));
LowerOuterBand.SetLineWeight(2);

UpperInnerBand.SetDefaultColor(GetColor(5));
UpperInnerBand.SetLineWeight(1);
UpperInnerBand.SetStyle(Curve.SHORT_DASH);
LowerInnerBand.SetDefaultColor(GetColor(6));
LowerInnerBand.SetLineWeight(1);
LowerInnerBand.SetStyle(Curve.SHORT_DASH);

# Turn AddClouds off by putting a #-sign at the first position of the lines
AddCloud(UpperOuterBand, UpperInnerBand, Color.RED);
AddCloud(LowerInnerBand, LowerOuterBand, Color.GREEN);

#Rev 2:
#def FlowValue = if close > close[1] then high else if close < close[1] then low else (high + low)/2;
def FlowValue =
    if high >= high[1] and low <= low[1]
    then
        if close >= close[1] #or high >= high[2]
        then high
        else low
    else
        if high > high[1]
        then high
        else
            if low < low[1]
            then low
            else
                if close > close[1]
                then high
                else
                    if close < close[1]
                    then low
                    else (high + low) / 2;

plot FlowPrice = if showFlowPrice then Average(FlowValue, smooth) else Double.NaN;
FlowPrice.SetDefaultColor(GetColor(9));
FlowPrice.SetLineWeight(2);

HidePricePlot(!showPriceBar);

#
# --- script end ----
 

Sound2050

Непризнанный
Регистрация
03.04.14
Сообщения
34
Реакции
5
Sound2050 не предоставил никакой дополнительной информации.
А, понял, спасибо у меня такой есть только без центральной линии.
 
Верх Низ