#Сырая идея по поводу отображения 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();
plot ask = close(priceType = "ASK"
;
;
Мар 30 2013, 07:25input 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, 08:38Добавить премаркет и убрать цену, скрины в файлах
Мар 30 2013, 09:30конечно кому как удобнее... но стоит заметить что две рекурсии будут излишне грузить память. В итоге польза получится меньше вреда.
Мар 30 2013, 10:34offset и offset2 не нужны здесь
а можно ли сделать чтоб на графике бидсайз/асксайз чертился по фильтру. сам не секу в коде)
Мар 30 2013, 14:24