thinkorswim

#Сырая идея по поводу отображения Bid & Ask на графике, кому интересно может развить и усовершенствовать plot ask = close(priceType = "ASK"); input offset=0; input length = 1; def sma = SimpleMovingAvg(ask, 1, length); rec line = if IsNaN(sma) then line[1] else sma[offset]; plot askline=if isnan(sma) then line else double.nan; askline.setpaintingStrategy(paintingStrategy.LINE); askline.setlineWeight(3); askline.setdefaultColor(color.green); askline.hideBubble(); plot bid = close(priceType = "BID"); input offset2=0; input length2 = 1; def sma2 = SimpleMovingAvg(bid, 1, length2); rec line2 = if IsNaN(sma2) then line2[1] else sma2[offset2]; plot bidline=if isnan(sma2) then line2 else double.nan; bidline.setpaintingStrategy(paintingStrategy.LINE); bidline.setlineWeight(3); bidline.setdefaultColor(color.red); bidline.hideBubble();


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

2.bmp · 2MB 3.bmp · 1,9MB
Мар 30 2013, 07:23


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

plot ask = close(priceType = "ASK";);
input offset=0;
input length = 1;

def sma = SimpleMovingAvg(ask, 1, length);
rec line = if IsNaN(sma) then line[1] else sma[offset];
plot askline=if isnan(sma) then line else double.nan;
askline.setpaintingStrategy(paintingStrategy.LINE);
askline.setlineWeight(3);
askline.setdefaultColor(color.green);
askline.hideBubble();

plot bid = close(priceType = "BID";);
input offset2=0;
input length2 = 1;

def sma2 = SimpleMovingAvg(bid, 1, length2);
rec line2 = if IsNaN(sma2) then line2[1] else sma2[offset2];
plot bidline=if isnan(sma2) then line2 else double.nan;
bidline.setpaintingStrategy(paintingStrategy.LINE);
bidline.setlineWeight(3);
bidline.setdefaultColor(color.red);
bidline.hideBubble();

Мар 30 2013, 07:25
Maksimillion

можешь выложить скрин, что видно на графике?

Мар 30 2013, 08:38
cyborg

Добавить премаркет и убрать цену, скрины в файлах

Мар 30 2013, 09:30
growex

конечно кому как удобнее... но стоит заметить что две рекурсии будут излишне грузить память. В итоге польза получится меньше вреда.
offset и offset2 не нужны здесь

Мар 30 2013, 10:34
ytka

а можно ли сделать чтоб на графике бидсайз/асксайз чертился по фильтру. сам не секу в коде)

Мар 30 2013, 14:24
Наш канал