Formula Quick Reference

Market Data | Date Functions | Reference Functions | Logical Functions | Math Functions | Statistic Functions | Indicator Functions | Drawing Functions | Drawing Descriptors | Miscellaneous Functions | Formula Forum


Market Data

open, o
close, c
open price
close price
open: o, colorred, linethick2;
close: c, colorblue;
var1 := (close+high+low)/3;
var2 := ema(ema(ema(var1,1),13),21);
control : (var2-ref(var2,1))/ref(var2,1)*100, colorstick, linethick3;
strength : 0, colorred;
high, h
low, l
high price
low price
(h-l)/l > 0.07; # volatility hh : hhv(h, 20);
ll : llv(l, 20); # draw in the main chart
volume, vol, v volume v, volstick;
polyline(1, ma(v, 5)), colorblack;
polyline(1, ma(v, 10)), colorbrown;
polyline(1, ma(v, 30)), colorblue;
ll := (high+low+close)/3;
ll1 := if(high=low, 1, high-max(open, close));
ll2 := if(high=low, 1, max(close, open)-ll);
ll3 := if(high=low, 1, min(open, close)-low);
ll4 := if(high=low, 1, ll-min(close, open));
ll5 := vol/if(high=low, 4, high-low);
ll6 := (ll1*ll5);
ll7 := (ll2*ll5);
ll8 := (ll3*ll5);
ll9 := (ll4*ll5);
buy_vol := (ll6+ll9);
sell_vol := -(ll7+ll8);
stickline(buy_vol > 0, 0, buy_vol, 1, 0), colorblue;
stickline(sell_vol < 0, 0, sell_vol, 1, 0), colorred;
capital shares float pvol:= if(capital = 0, v, v/capital*100);
pvol, volstick;
polyline(1, ma(pvol, 5)), colorblack;
polyline(1, ma(pvol, 10)), colorbrown;
polyline(1, ma(pvol, 30)), colorblue;
day_no:sumbars(vol,capital);
finance finance("data_name") finance("shares_outstanding"): shares outstanding
finance("shares_float"): shares float
finance("current_pe"): current P/E ratio
finance("forward_pe"): forward P/E ratio
finance("institutional_ownership"): institutional ownership
finance("mutual_fund_ownership"): mutual fund ownership
finance("insider_ownership"): insider ownership
finance("gross_margin"): gross margin
finance("pre_tax_margin"): pre tax margin
finance("net_profit_margin"): net profit margin
finance("indu_gross_margin"): industry gross margin
finance("indu_pre_tax_margin"): industry pre tax margin
finance("indu_net_profit_margin"): industry net profit margin
finance("sp_gross_margin"): SP gross margin
finance("sp_pre_tax_margin"): SP pre tax margin
finance("sp_net_profit_margin"): SP net profit margin
# calculate market capitalization in million
market_cap := finance("shares_outstanding")*close / (1000*1000);
...

 

Function Index
abs | align | avedev | backset | barscount | barslast | barssince | between | capital | ceiling | circledot | close | color | colorstick | cost | count | cross | crossdot | date | datediff | day | dma | drawicon | drawline | drawnumber | drawtext | ema | every | exist | fillrgn | filter | finance | floor | hhv | hhvbars | high | if | intpart | iscamarket | isdown | isequal | islastbar | isup | isusmarket | last | linestick | linestyle | linethick | llv | llvbars | ln | log | longcross | low | ma | max | min | mod | month | not | open | partline | peak | peakbars | peaktrough | peaktroughbars | pointdot | polyline | pow | range | ref | relate | reverse | sar | sarturn | sgn | sigperform | slope | sma | std | stick | stickline | sum | sumbars | transparency | trough | troughbars | var | vertline | vol | volstick | weekday | winner | year | zig