Using ADE to transfer data between charts ERROR

Questions about MultiCharts and user contributed studies.
nuno-online
Posts: 174
Joined: 31 Jan 2006
Has thanked: 74 times
Been thanked: 5 times

Using ADE to transfer data between charts ERROR

Postby nuno-online » 04 Nov 2009

Hi

i want to plot yesterday daily Pivot , supports an resistances in 1 hour Chart

I installed all components as described :
1/ place the elcollections.dll in "C: \Program Files\TS Support\Multicharts\"
2/ imported and compiled ELCollections.eld
2/ install ADE in c:\
4/ imported and compiled AllDataEverywhere.ELD

I created an indicator that calculates daily Pivot , supports an resistances

Code: Select all

Vars: Pivot(0), Resistance1(0), Resistance2(0), Resistance3(0), Support1(0), Support2(0), Support3(0),
Class("Pivot&Support1&Support2&Support3&Resistance1&Resistance2&Resistance3"),
InfoMap(MapSN.New); // used to pass data to ADE

Pivot = ( Low + High + Close ) / 3;
Resistance1 = ( Pivot * 2 ) - Low;
Resistance2 = Pivot + Range;
Resistance3 = Resistance1 + Range;
Support1 = ( Pivot * 2 ) - High;
Support2 = Pivot - Range;
Support3 = Support1 - Range;

// Put the information we want to store in our InfoMap
Value1 = MapSN.Put(InfoMap, "Pivot", Pivot);
Value1 = MapSN.Put(InfoMap, "Resistance1", Resistance1);
Value1 = MapSN.Put(InfoMap, "Resistance2", Resistance2);
Value1 = MapSN.Put(InfoMap, "Resistance3", Resistance3);
Value1 = MapSN.Put(InfoMap, "Support1", Support1);
Value1 = MapSN.Put(InfoMap, "Support2", Support2);
Value1 = MapSN.Put(InfoMap, "Support3", Support3);

// Tell ADE to store this info for the current symbol and bar interval
Value1 = ADE.PutBarInfo(Class, GetSymbolName, ADE.BarInterval, ADE.BarID, InfoMap);

Plot1( Pivot[1], "PP");
plot2( Resistance1[1], "R1");
Plot3( Resistance2[1], "R2");
Plot4( Resistance3[1], "R3");
Plot5( Support1[1], "S1");
Plot6( Support2[1], "S2");
Plot7( Support3[1], "S3");

i inserted the indicator below in 1 HOUR CHART to get values

Code: Select all

Inputs:
Interval(60);

Vars:
Class("Pivot&Support1&Support2&Support3&Resistance1&Resistance2&Resistance3"), // identifies our metrics with a unique name
InfoMap(MapSN.New), // used to retrieve data from ADE
Pivot(0), Resistance1(0), Resistance2(0), Resistance3(0), Support1(0), Support2(0), Support3(0);

// Retrieve the info for the current symbol and bar interval into InfoMap
Value1 = ADE.GetBarInfo(Class, GetSymbolName, Interval, ADE.BarID, InfoMap);
// Fetch the values from the InfoMap into variables
Pivot = MapSN.Get(InfoMap, "Pivot");
Resistance1 = MapSN.Get(InfoMap, "Resistance1");
Resistance2 = MapSN.Get(InfoMap, "Resistance2");
Resistance3 = MapSN.Get(InfoMap, "Resistance3");
Support1 = MapSN.Get(InfoMap, "Support1");
Support2 = MapSN.Get(InfoMap, "Support2");
Support3 = MapSN.Get(InfoMap, "Support3");

// Plot them
Plot1( Pivot[1], "PP");
plot2( Resistance1[1], "R1");
Plot3( Resistance2[1], "R2");
Plot4( Resistance3[1], "R3");
Plot5( Support1[1], "S1");
Plot6( Support2[1], "S2");
Plot7( Support3[1], "S3");
I did apply the second indicator, but got the following messages:
Error in "ADE Plot MD"
Company: "Bamboo"
Error location : "ADE"
Error category : "ADE Error"
Short string : "ADE Error"
Source string : "No data available for Class('Pivot&Support1&Support2&Support3&Resistance1&Resistance2&Resistance3'), AC, 60min"


How can this work correctly?
Thanks

User avatar
Geoff
Posts: 198
Joined: 18 Apr 2007
Has thanked: 15 times
Been thanked: 4 times

Postby Geoff » 04 Nov 2009

The way I did it was to use a separate class variable for each value, eg.

Class("pivot"),
Class2("support1"),
Class3("support2"),
etc....

nuno-online
Posts: 174
Joined: 31 Jan 2006
Has thanked: 74 times
Been thanked: 5 times

Postby nuno-online » 05 Nov 2009

Geoff,
thank you for your help


i changed the code like you suggested to me but i always have the same error

Error in "NR_PivotsADE"
Company: "Bamboo"
Error location : "ADE"
Error category : "ADE Error"
Short string : "ADE Error"
Source string : "No data available for Class 'Pivot', AC, 60min"


here is the first indicator:

Code: Select all

{ *** NR_Pivots Indicator *** }

Vars: Pivot(0), Resistance1(0), Resistance2(0), Resistance3(0), Support1(0), Support2(0), Support3(0),
Class("Pivot"), InfoMap(MapSN.New), //used to pass data to ADE
Class1("Resistance1"), InfoMap1(MapSN.New),
Class2("Resistance2"), InfoMap2(MapSN.New),
Class3("Resistance3"), InfoMap3(MapSN.New),
Class4("Support1"), InfoMap4(MapSN.New),
Class5("Support2"), InfoMap5(MapSN.New),
Class6("Support3"), InfoMap6(MapSN.New);

Pivot = ( Low + High + Close ) / 3;
Resistance1 = ( Pivot * 2 ) - Low;
Resistance2 = Pivot + Range;
Resistance3 = Resistance1 + Range;
Support1 = ( Pivot * 2 ) - High;
Support2 = Pivot - Range;
Support3 = Support1 - Range;

// Put the information we want to store in our InfoMap
Value9 = MapSN.Put(InfoMap, "Pivot", Pivot);
Value1 = MapSN.Put(InfoMap1, "Resistance1", Resistance1);
Value2 = MapSN.Put(InfoMap2, "Resistance2", Resistance2);
Value3 = MapSN.Put(InfoMap3, "Resistance3", Resistance3);
Value4 = MapSN.Put(InfoMap4, "Support1", Support1 );
Value5 = MapSN.Put(InfoMap5, "Support2", Support2);
Value6 = MapSN.Put(InfoMap6, "Support3", Support3);

// Tell ADE to store this info for the current symbol and bar interval
Value10 = ADE.PutBarInfo(Class, GetSymbolName, ADE.BarInterval, ADE.BarID, InfoMap);
Value11 = ADE.PutBarInfo(Class1, GetSymbolName, ADE.BarInterval, ADE.BarID, InfoMap1);
Value12 = ADE.PutBarInfo(Class2, GetSymbolName, ADE.BarInterval, ADE.BarID, InfoMap2);
Value13 = ADE.PutBarInfo(Class3, GetSymbolName, ADE.BarInterval, ADE.BarID, InfoMap3);
Value14 = ADE.PutBarInfo(Class4, GetSymbolName, ADE.BarInterval, ADE.BarID, InfoMap4);
Value15 = ADE.PutBarInfo(Class5, GetSymbolName, ADE.BarInterval, ADE.BarID, InfoMap5);
Value16 = ADE.PutBarInfo(Class6, GetSymbolName, ADE.BarInterval, ADE.BarID, InfoMap6);

Plot1( Pivot[1], "PP");
plot2( Resistance1[1], "R1");
Plot3( Resistance2[1], "R2");
Plot4( Resistance3[1], "R3");
Plot5( Support1[1], "S1");
Plot6( Support2[1], "S2");
Plot7( Support3[1], "S3");
the second indicator:

Code: Select all

{ *** NR_PivotsADE Indicator *** }

Inputs:
Interval(60);

Vars: Pivot(0), Resistance1(0), Resistance2(0), Resistance3(0), Support1(0), Support2(0), Support3(0),
Class("Pivot"), InfoMap(MapSN.New), //used to pass data to ADE
Class1("Resistance1"), InfoMap1(MapSN.New),
Class2("Resistance2"), InfoMap2(MapSN.New),
Class3("Resistance3"), InfoMap3(MapSN.New),
Class4("Support1"), InfoMap4(MapSN.New),
Class5("Support2"), InfoMap5(MapSN.New),
Class6("Support3"), InfoMap6(MapSN.New);


// Retrieve the info for the current symbol and bar interval into InfoMap
Value9 = ADE.GetBarInfo(Class, GetSymbolName, Interval, ADE.BarID, InfoMap);
Value1 = ADE.GetBarInfo(Class1, GetSymbolName, Interval, ADE.BarID, InfoMap1);
value2 = ADE.GetBarInfo(Class2, GetSymbolName, Interval, ADE.BarID, InfoMap2);
Value3 = ADE.GetBarInfo(Class3, GetSymbolName, Interval, ADE.BarID, InfoMap3);
Value4 = ADE.GetBarInfo(Class4, GetSymbolName, Interval, ADE.BarID, InfoMap4);
Value5 = ADE.GetBarInfo(Class5, GetSymbolName, Interval, ADE.BarID, InfoMap5);
Value6 = ADE.GetBarInfo(Class6, GetSymbolName, Interval, ADE.BarID, InfoMap6);

// Fetch the values from the InfoMap into variables
Pivot = MapSN.Get(InfoMap, "Pivot");
Resistance1 = MapSN.Get(InfoMap1, "Resistance1");
Resistance2 = MapSN.Get(InfoMap2, "Resistance2");
Resistance3 = MapSN.Get(InfoMap3, "Resistance3");
Support1 = MapSN.Get(InfoMap4, "Support1");
Support2 = MapSN.Get(InfoMap5, "Support2");
Support3 = MapSN.Get(InfoMap6, "Support3");


// Plot them
Plot1( Pivot[1], "PP");
plot2( Resistance1[1], "R1");
Plot3( Resistance2[1], "R2");
Plot4( Resistance3[1], "R3");
Plot5( Support1[1], "S1");
Plot6( Support2[1], "S2");
Plot7( Support3[1], "S3");
How can this work correctly?
Thanks

Nuno

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

Re: Using ADE to transfer data between charts ERROR

Postby TJ » 05 Nov 2009

Hi
....
How can this work correctly?
Thanks

Have you tried the included sample indicator?

That should tell you if you have installed everything properly.
because if the sample does not work, there is no point in debugging your indicator.

If the sample works,
then you should learn the intricacies of ADE by
modifying the sample...
if that works, then you can attempt more difficult tasks.

nuno-online
Posts: 174
Joined: 31 Jan 2006
Has thanked: 74 times
Been thanked: 5 times

Postby nuno-online » 05 Nov 2009

TJ

What is the included sample indicator

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

Postby TJ » 05 Nov 2009

TJ

What is the included sample indicator

in the ADE zip file.


if you have installed ADE, they are most likely already installed in your MultiCharts.
Open your PLE... look for indicators with ADE prefix.

nuno-online
Posts: 174
Joined: 31 Jan 2006
Has thanked: 74 times
Been thanked: 5 times

Postby nuno-online » 05 Nov 2009

I inserted in a daily chart the indicator :
'ADE Save Info Test'
and in an 60 minutes chart the indicator:
'ADE Plot Info Test'

and the same error :(

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

Postby TJ » 05 Nov 2009

I inserted in a daily chart the indicator :
'ADE Save Info Test'
and in an 60 minutes chart the indicator:
'ADE Plot Info Test'

and the same error :(

That means your ELCollections /ADE were not installed properly.

I would suggest you to de-install ELCollections and ADE,
and re-install again.



.
Last edited by TJ on 05 Nov 2009, edited 1 time in total.

nuno-online
Posts: 174
Joined: 31 Jan 2006
Has thanked: 74 times
Been thanked: 5 times

Postby nuno-online » 05 Nov 2009

i have to install GV?

where can i found it?

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

Postby TJ » 05 Nov 2009

i have to install GV?

where can i found it?

my fingers were too fast,
I meant ELCollections .

I have corrected the post above.

nuno-online
Posts: 174
Joined: 31 Jan 2006
Has thanked: 74 times
Been thanked: 5 times

Postby nuno-online » 06 Nov 2009

I did it

1/ELCollections

- I installed ELCollections.dll file in "C:\Program File\TS Support\Multicharts\",
- once that it done , I imported the "ELCollections.eld" file with PLEditor and compiled it.


2/ADE

- I created a directory called C:\ADE.
- I created the following subdirectories in the ADE root directory:
C:\ADE\Data
C:\ADE\Classes
C:\ADE\Code

- I extracted the ADE.zip file into the ADE root directory
- I moved the OHLCV.txt file into the Classes subdirectory.
- I imported the AllDataEverywhere.ELD file with PLEditor and compiled it.


Does i have to do this below?

8. If you want ADE to cache data in text files and reload them by default, open the ADE.UseFile function in TS. Modify the function to return True, and then verify the function. This feature is explained in more detail below. You can always come back and modify the ADE.UseFile function at a later time.

nuno-online
Posts: 174
Joined: 31 Jan 2006
Has thanked: 74 times
Been thanked: 5 times

Postby nuno-online » 06 Nov 2009

I tested this included sample indicator in a daily chart
ADE Save Info Test with ADXLen(14)

and the indicator ADE Plot Info Test in a 60 minutes chart

the problem i saw :
ADX in 60 min chart ( ADX = 23.78 ) doesn't have the same value than in the daily chart ( ADX = 22.37 )

Can someone explain me why????
Attachments
adx ade.jpg
(336.58 KiB) Downloaded 936 times

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

Postby TJ » 06 Nov 2009

What are the lastest EOB values?

EOB = End Of Bar

i.e. the bar has completed and closed, and all values confirmed and fixed.

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

Postby TJ » 06 Nov 2009

remember when using ADE:

the Short term chart is your main chart, (the importing chart)

the Long term chart is your support chart (the exporting chart)

nuno-online
Posts: 174
Joined: 31 Jan 2006
Has thanked: 74 times
Been thanked: 5 times

Postby nuno-online » 06 Nov 2009

TJ

that's ok, I understand that:
" the Short term chart is your main chart, (the importing chart) : My 60 min chart
the Long term chart is your support chart (the exporting chart)": My daily chart

It's correct! i have the same value for:
the last daily bar completed and closed (yesterday bar) because today bar isn't closed
and
the 60 min bar

what is incorrect in my code if with the included sample indicator that's ok?

I think the problem become in this:
in the included indicator ADE Plot Info Test

Code: Select all

[LegacyColorValue = TRUE];
Inputs:
[b]Interval(ADE.Daily),[/b] // number of minutes, or ADE.Daily, ADE.Weekly, ADE.Monthly
UseFile(ADE.UseFile); // default UseFile is returned by ADE.UseFile function

Vars:
Class("BarInfoTest"), // class name for our test data
InfoMap(MapSN.New), // we will use this map to retrieve data with ADE.GetBarInfo
MyADX(0),
MyRSI(0),
MySlowK(0),
MySlowD(0);

// If UseFile is true, load any previously stored data from the file on the first bar.
if CurrentBar = 1 and UseFile then
Value1 = ADE.OpenMap(Class, GetSymbolName, Interval);

// Retrieve the data for this symbol and bar interval.
// ADE.GetBarInfo will copy the information from the appropriate DataMap into our InfoMap.
Value1 = ADE.GetBarInfo(Class, GetSymbolName, Interval, ADE.BarID, InfoMap);

// Fetch the values from the InfoMap into variables
MyADX = MapSN.Get(InfoMap, "ADX");
MyRSI = MapSN.Get(InfoMap, "RSI");
MySlowK = MapSN.Get(InfoMap, "SlowK");
MySlowD = MapSN.Get(InfoMap, "SlowD");

// Plot them
Plot1(MyADX, "ADX");
Plot2(MyRSI, "RSI");
Plot3(MySlowK, "SlowK");
Plot4(MySlowD, "SlowD");

and in my code NR_PivotsADE

Code: Select all

{ *** NR_PivotsADE Indicator *** }

Inputs:
[b]Interval(60);[/b]

Vars: Pivot(0), Resistance1(0), Resistance2(0), Resistance3(0), Support1(0), Support2(0), Support3(0),
Class("Pivot"), InfoMap(MapSN.New), //used to pass data to ADE
Class1("Resistance1"), InfoMap1(MapSN.New),
Class2("Resistance2"), InfoMap2(MapSN.New),
Class3("Resistance3"), InfoMap3(MapSN.New),
Class4("Support1"), InfoMap4(MapSN.New),
Class5("Support2"), InfoMap5(MapSN.New),
Class6("Support3"), InfoMap6(MapSN.New);


// Retrieve the info for the current symbol and bar interval into InfoMap
Value9 = ADE.GetBarInfo(Class, GetSymbolName, Interval, ADE.BarID, InfoMap);
Value1 = ADE.GetBarInfo(Class1, GetSymbolName, Interval, ADE.BarID, InfoMap1);
value2 = ADE.GetBarInfo(Class2, GetSymbolName, Interval, ADE.BarID, InfoMap2);
Value3 = ADE.GetBarInfo(Class3, GetSymbolName, Interval, ADE.BarID, InfoMap3);
Value4 = ADE.GetBarInfo(Class4, GetSymbolName, Interval, ADE.BarID, InfoMap4);
Value5 = ADE.GetBarInfo(Class5, GetSymbolName, Interval, ADE.BarID, InfoMap5);
Value6 = ADE.GetBarInfo(Class6, GetSymbolName, Interval, ADE.BarID, InfoMap6);

// Fetch the values from the InfoMap into variables
Pivot = MapSN.Get(InfoMap, "Pivot");
Resistance1 = MapSN.Get(InfoMap1, "Resistance1");
Resistance2 = MapSN.Get(InfoMap2, "Resistance2");
Resistance3 = MapSN.Get(InfoMap3, "Resistance3");
Support1 = MapSN.Get(InfoMap4, "Support1");
Support2 = MapSN.Get(InfoMap5, "Support2");
Support3 = MapSN.Get(InfoMap6, "Support3");

// Plot them
Plot1( Pivot[1], "PP");
plot2( Resistance1[1], "R1");
Plot3( Resistance2[1], "R2");
Plot4( Resistance3[1], "R3");
Plot5( Support1[1], "S1");
Plot6( Support2[1], "S2");
Plot7( Support3[1], "S3");


Return to “MultiCharts”