Create a ticki indicator for OMXS (47 stocks stockholm)  [SOLVED]

Questions about MultiCharts and user contributed studies.
stefanols
Posts: 51
Joined: 01 Jan 2014
Has thanked: 14 times
Been thanked: 2 times

Create a ticki indicator for OMXS (47 stocks stockholm)

Postby stefanols » 02 Jul 2016

Hi,
I am trying to do a ticki indicator but for Swedish stocks and futures.
Hope that someone can see where I am doing wrong.

Thanks in advance. BR Stefan

Code: Select all

Input: NumberInstruments(47);

Vars: Datacounter(0);
Vars: Newuptick (0);
Vars: NewupTickAgg (0);
Vars: NewdownTick (0);
Vars: NewdownTickAgg (0);
Vars: Uptickcount (0);
Vars: downtickcount (0);
//Vars: intrabarpersist Uptick (0);
//Vars: intrabarpersist Downtick (0);


//reset variables
NewupTick =0;
NewupTickAgg =0;
NewdownTick =0;
NewdownTickAgg =0;

For datacounter = 2 to Numberinstruments begin
if close > close[ 1 ] of data(datacounter) then UpTickCount = upTickCount[ 1 ] + 1;

if close < close[ 1 ] of data(datacounter) then downtickcount = downtickcount[1] + 1;

end;

//UpTickCount = (NewupTick /(Numberinstruments-1)) * 100;
//Downtickcount = (NewdownTick/(Numberinstruments-1)) * 100;

Value1 = UpTickCount-Downtickcount;
Plot1(value1,"");

Attachments
OMX ticki 1 plot up - down1.png
(66.84 KiB) Downloaded 721 times
Last edited by stefanols on 04 Jul 2016, edited 1 time in total.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Create a ticki indicator for OMXS (47 stocks stockholm)

Postby TJ » 02 Jul 2016

See post #5
(5) [FAQ] Data2
viewtopic.php?f=16&t=6929

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Create a ticki indicator for OMXS (47 stocks stockholm)

Postby TJ » 02 Jul 2016

you can try this:

Code: Select all

if close of data(datacounter) > close[ 1 ] of data(datacounter) then ...

stefanols
Posts: 51
Joined: 01 Jan 2014
Has thanked: 14 times
Been thanked: 2 times

Re: Create a ticki indicator for OMXS (47 stocks stockholm)

Postby stefanols » 04 Jul 2016

Hi,

Thanks for your help.
I made the change and now I get a result but something is wrong.

It should vary between -47 and +47.
Would be happy if someone could take a quick check.
My guess is that it does not reset for each bar.

Thanks in advance.

Best regards

Stefan

Code: Select all

Input: NumberInstruments(47);

Vars: Datacounter(0);
Vars: Newuptick (0);
Vars: NewdownTick (0);
Vars: Uptickcount (0);
Vars: Downtickcount (0);
Vars: Tickcount (0);

//Vars: intrabarpersist Uptick (0);
//Vars: intrabarpersist Downtick (0);



//reset variables
NewupTick = 0;
NewdownTick = 0;
Tickcount = 0;
Uptickcount = 0;
downtickcount = 0;


For datacounter = 2 to Numberinstruments begin

if close of data(datacounter) > close[ 1 ] of data(datacounter) then newupTick = newUptick[1] + 1;

if close of data(datacounter) < close[ 1 ] of data(datacounter) then newdowntick = newdowntick[1] + 1;

end;

Uptickcount = newuptick;
downtickcount = newdowntick;
Tickcount = (uptickcount - downtickcount);

Plot1(Tickcount,"Uptick-downtick");

//Plot1 (uptickcount,"upticks");
//PLot2 (downtickcount,"downticks");
Attachments
OMX ticki 1 plot up - down1.png
(66.84 KiB) Downloaded 723 times

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Create a ticki indicator for OMXS (47 stocks stockholm)

Postby TJ » 04 Jul 2016

How many ticks in a 3 minutes interval?

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Create a ticki indicator for OMXS (47 stocks stockholm)  [SOLVED]

Postby TJ » 04 Jul 2016

Look up the keyword:

BarStatus


Return to “MultiCharts”