Sharing variables between studies?  [SOLVED]

Questions about MultiCharts and user contributed studies.
Ram
Posts: 90
Joined: 25 Nov 2014
Has thanked: 17 times
Been thanked: 5 times

Sharing variables between studies?

Postby Ram » 25 Nov 2014

Dear All,

I'm new to MC and still have some difficulties with some basic stuff so please bare with me :)

I'm using MC64b and Power Language Editor V3.

In the screenshot below I have 4 different studies:

1. Ram_Three_Step
2. RSI 2 Days
3. RSI 3 Days
4. RSI 5 Days

My goal is to read the data from the RSI's studies (marked in red) in the Ram_Three_Step script using historical data:

Image

I thought to use the

Code: Select all

GVGetNamedInt
however i read that isnt possible
GV works only realtime. viewtopic.php?f=1&t=7719#p42438


please indicate how I can access data from other studies.

Any help will be highly appreciated!

Thank you all in advance,
Ram

User avatar
Smoky
Posts: 517
Joined: 03 Dec 2010
Location: Thailand
Has thanked: 99 times
Been thanked: 121 times

Re: Sharing variables between studies?

Postby Smoky » 25 Nov 2014

On your main chart add Data1 hidden 1 day data2 hidden 2 days data(x) hidden x days,
and use these data choice on your indicator

;)

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Sharing variables between studies?

Postby JoshM » 25 Nov 2014

In the screenshot below I have 4 different studies:

1. Ram_Three_Step
2. RSI 2 Days
3. RSI 3 Days
4. RSI 5 Days

My goal is to read the data from the RSI's studies (marked in red) in the Ram_Three_Step script using historical data:

Image
If I look at your screenshot (a 1 minute chart), I see that the "2 Days", "3 Days", and "5 Days" indicators are perfectly aligned with the minute chart. If those indicators were based on daily data, your chart would not be as nicely aligned.

Can you clarify whether the "x Days" indicators need to be based on minute data (as your chart seems to suggest) or daily data (as their name suggests)? Because, if "x Days" are based on minutes, Smoky's valid suggestion of multiple data series is not needed.

Ram
Posts: 90
Joined: 25 Nov 2014
Has thanked: 17 times
Been thanked: 5 times

Re: Sharing variables between studies?

Postby Ram » 25 Nov 2014

@Smoky

many thanks for your quick reply!

I've added the Data sources as hidden to my main chart but how do i read it from my study?

TIA!!!

User avatar
Smoky
Posts: 517
Joined: 03 Dec 2010
Location: Thailand
Has thanked: 99 times
Been thanked: 121 times

Re: Sharing variables between studies?

Postby Smoky » 25 Nov 2014

You have to use datax on you indicator like this

RSIday1 = RSI(close,len) data1;
RSIday2 = RSI(close,len) data2; ... and so on ....

You have thanks buton LoL

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

Re: Sharing variables between studies?

Postby TJ » 25 Nov 2014

@Smoky
many thanks for your quick reply!
I've added the Data sources as hidden to my main chart but how do i read it from my study?
TIA!!!
See post #4
(4) [FAQ] Multiple time frame, Multi-Data Analysis
viewtopic.php?f=16&t=6929

Ram
Posts: 90
Joined: 25 Nov 2014
Has thanked: 17 times
Been thanked: 5 times

Re: Sharing variables between studies?  [SOLVED]

Postby Ram » 25 Nov 2014

@JoshM

your point is well taken, thanks much!


In the screenshot below I have 4 different studies:

1. Ram_Three_Step
2. RSI 2 Days
3. RSI 3 Days
4. RSI 5 Days

My goal is to read the data from the RSI's studies (marked in red) in the Ram_Three_Step script using historical data:

Image
If I look at your screenshot (a 1 minute chart), I see that the "2 Days", "3 Days", and "5 Days" indicators are perfectly aligned with the minute chart. If those indicators were based on daily data, your chart would not be as nicely aligned.

Can you clarify whether the "x Days" indicators need to be based on minute data (as your chart seems to suggest) or daily data (as their name suggests)? Because, if "x Days" are based on minutes, Smoky's valid suggestion of multiple data series is not needed.


Return to “MultiCharts”