thinkorswim

Просьба к знающим: помогите написать формулу thinkorswim для кроссовера к следующему индикатору: # TS_MarketThrust # http://www.thinkscripter.com # thinkscripter@gmail.com # Last Update 12 May 2010 declare lower; input AvePeriod = 10; input showOnlyToday = YES; def T1c = (close("$ADVN") * close("$UVOL")) - (close("$DECN") * close("$DVOL")); plot T1 = if showOnlyToday and getDay() == getLastDay() then T1c else if !showOnlyToday then T1c else double.nan; T1.SetDefaultColor(color.red); def TAvec = Average(T1, AvePeriod); plot TAve = if showOnlyToday and getDay() == getLastDay() then TAvec else if !showOnlyToday then TAvec else double.nan; TAve.SetDefaultColor(color.white); plot zero = 0; zero.SetDefaultColor(color.yellow); def U = close("$UVOL"); def D = close ("$DVOL"); def DVOL = U - D; AddChartLabel(yes, concat(DVOL, concat(" ", "UVOL-DVOL")), if DVOL > DVOL[1] then color.green else color.red);


Проголосовало: 0

Ноя 29 2011, 21:58


Комментарии
Lotoss

Не понял. какая-то рожица в коде. А ну , вот так: # TS_MarketThrust
# http://www.rpg-club.com/x1000m?h=www.thinkscripter.com
# thinkscripter@gmail.com
# Last Update 12 May 2010

declare lower;
input AvePeriod = 10;
input showOnlyToday = YES;

def T1c = (close("$ADVN";) * close("$UVOL";)) - (close("$DECN";) * close("$DVOL";));
plot T1 = if showOnlyToday and getDay() == getLastDay() then T1c else if !showOnlyToday then T1c else double.nan;
T1.SetDefaultColor(color.red);
def TAvec = Average(T1, AvePeriod);
plot TAve = if showOnlyToday and getDay() == getLastDay() then TAvec else if !showOnlyToday then TAvec else double.nan;
TAve.SetDefaultColor(color.white);

plot zero = 0;
zero.SetDefaultColor(color.yellow);

def U = close("$UVOL";);
def D = close ("$DVOL";);
def DVOL = U - D;

AddChartLabel(yes, concat(DVOL, concat(" ",
"UVOL-DVOL";)),
if DVOL > DVOL[1] then color.green else color.red);

Ноя 29 2011, 22:04
Lotoss

Нет , всё равно.

Ноя 29 2011, 22:05
PapaRed

а для чего эта формула?

Ноя 29 2011, 22:06
HAMAHA

Скрипт воспринимает как команду на смаил.

Ноя 29 2011, 22:07
Lotoss

К PapaRed : если не понятно из кода, то попробуй в ТОСе, в окне тикеров вбить $UVOL и $DVOL — посмотреть их значение. Затем вбить ($UVOL-$DVOL) — возможно вопросы отпадут сами по себе.

Ноя 29 2011, 22:54

Разделено

Наш канал