With Globalvariables, send data between two scanners  [SOLVED]

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

With Globalvariables, send data between two scanners

Postby nuno-online » 16 Jul 2015

Hello

With Globalvariables, i want to send data between two scanners

In the scanner "sender" (quarter data") for some instruments i don't have enought data
For the instruments with data, the informataion is sent to the 2nd scanner

In the scanner "receiver" (monthly data) , i have errors because "not enought data in the 1st scanner
Is it possible to hide the errors windows ?

How to ask to easylanguage not to to deal with the intruments wiithout information for the 1st scanner

Code: Select all

{ *** QuarterIndicator *** }

Inputs:
Price((H+L+(2*C))/4),
AverageLength(10), AverageColor(DarkGray), ReturnMini(1),
BollingerLength(20), BollingerStDv(2), BollingerUpColor(Green), BollingerDnColor(Red),
GlobalVariables(True);
Variables:
BollingerAvg(0), BollingerSd(0),
BollingerUp(0), BollingerDn(0),
BollingerUpLineColor(0), BollingerDnLineColor(0),
MyAvg(0), PhName(""),
Ph1(False), Ph2(False), Ph3(False),
{ GV }
GV_BbPhases(0) ;
// ac(0);

{ Bollinger }
BollingerAvg = AverageFC(Price, BollingerLength);
BollingerSd = StandardDev(Price, BollingerLength, 1);
BollingerUp = BollingerAvg + (BollingerStDv * BollingerSd);
BollingerDn = BollingerAvg - (BollingerStDv * BollingerSd);

{ Setup }
Ph2 = BollingerUp > BollingerUp[1] and BollingerDn < BollingerDn[1] and Price > BollingerAvg and

BollingerUp[1] <> 0 and BollingerDn[1] <> 0;

{ GlobalVariables }
If GlobalVariables and LastBarOnChart then
GV_BbPhases = GVSetNamedBool(Symbol+"Q_BbPhases", Ph2);

Code: Select all

{ *** MonthIndicator *** }

Inputs:
Price((H+L+(2*C))/4),
AverageLength(10), AverageColor(DarkGray), ReturnMini(1),
BollingerLength(20), BollingerStDv(2), BollingerUpColor(Green), BollingerDnColor(Red),
GlobalVariables(True);

Variables:
Return(0),
BollingerAvg(0), BollingerSd(0),
BollingerUp(0), BollingerDn(0),
BollingerUpLineColor(0), BollingerDnLineColor(0),
MyAvg(0), PhName(""),
Ph1(False), Ph2(False), Ph3(False),
{ Global Variable }
GV_BbPhases(False);

{ Bollinger }
BollingerAvg = AverageFC(Price, BollingerLength);
BollingerSd = StandardDev(Price, BollingerLength, 1);
BollingerUp = BollingerAvg + (BollingerStDv * BollingerSd);
BollingerDn = BollingerAvg - (BollingerStDv * BollingerSd);

{ GlobalVariables }
If LastBarOnChart then
begin
GV_BbPhases = GVGetNamedBool(Symbol+"Q_BbPhases");
If (GV_BbPhases) then
Plot1("p2","Q_Ph",DarkGreen)
else
NoPlot(1);
end;

here the screenshot

All suggestions are welcome!

Nuno
Attachments
Capture.PNG
(179.73 KiB) Downloaded 480 times

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

Re: With Globalvariables, send data between two scanners

Postby TJ » 16 Jul 2015

Hello

With Globalvariables, i want to send data between two scanners

In the scanner "sender" (quarter data") for some instruments i don't have enought data
For the instruments with data, the informataion is sent to the 2nd scanner

In the scanner "receiver" (monthly data) , i have errors because "not enought data in the 1st scanner
Is it possible to hide the errors windows ?

How to ask to easylanguage not to to deal with the intruments wiithout information for the 1st scanner

Code: Select all

::
end;
here the screenshot
All suggestions are welcome!
Nuno

If you study the sample codes carefully, you will see the GV variables are initialized to -999.

They did not do that because they are stupid --- That is your error indication.

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

Re: With Globalvariables, send data between two scanners

Postby nuno-online » 16 Jul 2015

Thank you TJ for your help

but sorry, i don't know what tho do to stop this error

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

Re: With Globalvariables, send data between two scanners  [SOLVED]

Postby TJ » 16 Jul 2015

Thank you TJ for your help

but sorry, i don't know what tho do to stop this error
When the GV have received nothing, it will show up as -999.
That should be your indication that you do not have enough data.

THere are 2 things you can do...

1. get enough data... there is no substitute for data integrity.

2. if you just want to mindlessly scan a bunch of things, then try this:

Code: Select all


If whatever_GV_variable > -999 then
begin


Return to “MultiCharts”