Improving the quality of sparse data

Questions about MultiCharts and user contributed studies.
janus
Posts: 835
Joined: 25 May 2009
Has thanked: 63 times
Been thanked: 104 times

Improving the quality of sparse data

Postby janus » 18 Jun 2009

I've found a way to enhance the quality of the data during quiet times in the market. The attached image demonstrates the difference. It helps me a lot when developing a trading system that is supposed to work round the clock. If anyone is interested I'll post the study.
Attachments
picture12.png
(56.17 KiB) Downloaded 367 times

brodnicki steven
Posts: 407
Joined: 01 Jan 2008
Been thanked: 3 times

Postby brodnicki steven » 18 Jun 2009

Please post the code.

janus
Posts: 835
Joined: 25 May 2009
Has thanked: 63 times
Been thanked: 104 times

Postby janus » 19 Jun 2009

Very simple really. It does what some CFD market makers do to their charts. It computes the mid-points of the ask and bids. It's not totally accurate though as it doesn't look at the intra bar values to compute the correct highs and lows but its good enough. Set the properties of the the study as shown in the attached image. The colors don't matter. One major downside to this is you can't run standard studies on it since it's an indicator itself plotted as a candlestick chart. Until MC allows us to create synthetic symbols you have to replicate the studies you are interested in into this one. It's a general issue I've requested MC to fix to allow me to utilize the mid-point (and any other modified data) as if it's from a normal data source.

variables:
oaskq(0), obidq(0), omidq(0),
haskq(0), hbidq(0), hmidq(0),
laskq(0), lbidq(0), lmidq(0),
caskq(0), cbidq(0), cmidq(0),
colorb(0);

oaskq = open of data1; // open ask
obidq = open of data2; // open bid
omidq = (obidq + oaskq)/2.0; // mid-point of open bid-ask

haskq = high of data1; // high ask
hbidq = high of data2; // high bid
hmidq = (hbidq + haskq)/2.0; // mid-point of highest bid-ask

laskq = low of data1; // low ask
lbidq = low of data2; // low bid
lmidq = (lbidq + laskq)/2.0; // mid-point of lowest bid-ask

caskq = close of data1; // close ask
cbidq = close of data2; // close bid
cmidq = (cbidq + caskq)/2.0; // mid-point of latest bid-ask

if cmidq < omidq then colorb = red;
if cmidq > omidq then colorb = darkgreen;
if cmidq = omidq then colorb = black;

plot1(hmidq,"High",colorb);
plot2(lmidq,"Low",colorb);
plot3(omidq,"Open",colorb);
plot4(cmidq,"Close",colorb);
Attachments
picture1.png
(11.11 KiB) Downloaded 350 times

brodnicki steven
Posts: 407
Joined: 01 Jan 2008
Been thanked: 3 times

Postby brodnicki steven » 20 Jun 2009

Thanks for the code and explanation.


Return to “MultiCharts”