Page 1 of 1

Sharing variables between studies?

Posted: Nov 25 2014
by Ram
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

Re: Sharing variables between studies?

Posted: Nov 25 2014
by Smoky
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

;)

Re: Sharing variables between studies?

Posted: Nov 25 2014
by JoshM
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.

Re: Sharing variables between studies?

Posted: Nov 25 2014
by Ram
@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!!!

Re: Sharing variables between studies?

Posted: Nov 25 2014
by Smoky
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

Re: Sharing variables between studies?

Posted: Nov 25 2014
by TJ
@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

Re: Sharing variables between studies?  [SOLVED]

Posted: Nov 25 2014
by Ram
@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.