Gv and aiappid

Questions about MultiCharts and user contributed studies.
rtrader
Posts: 9
Joined: 21 Aug 2013

Gv and aiappid

Postby rtrader » 01 Sep 2013

Hi,
How can aiappid be used with gvset and gvget if the sender and receiver indicators applied to different charts? As the indicator on the receiver chart, using aiappid and the corresponding gvget returns the aiappid of the receiver chart and not that of the sender chart. Any ideas?

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

Re: Gv and aiappid

Postby TJ » 01 Sep 2013

Hi,
How can aiappid be used with gvset and gvget if the sender and receiver indicators applied to different charts? As the indicator on the receiver chart, using aiappid and the corresponding gvget returns the aiappid of the receiver chart and not that of the sender chart. Any ideas?
You need to give more detail... maybe with sample code and screenshots with notes?

rtrader
Posts: 9
Joined: 21 Aug 2013

Re: Gv and aiappid

Postby rtrader » 02 Sep 2013

Hi TJ,
An example of the GV block that may be embedded in a signal or indicator to send out our GV variable would be such:

Code: Select all

if LastBarOnChart then begin
SMA_profit= GVSetNamedDouble(text(getsymbolname,"_",getexchangename,"_",getstrategyname,"_",
barinterval:0:0,"_profit_",getappinfo(aiappid):0:0), Today_Profit) ;
SMA_open = GVSetNamedDouble(text(getsymbolname,"_",getexchangename,"_",getstrategyname,"_",
barinterval:0:0,"_open_",getappinfo(aiappid):0:0), Open_pnl) ;
end;
where Today_Profit and Open_Pnl are the variable values we would like to send out (store) for how many charts this signal is applied to.

On the receiver chart, the indicator would have a block such:

Code: Select all

If LastBarOnChart then begin

Get_profit= GVGetNamedDouble(text(getsymbolname,"_",getexchangename,"_",getstrategyname,"_",
barinterval:0:0,"_profit_",getappinfo(aiappid):0:0), 0) ;
Get_open = GVGetNamedDouble(text(getsymbolname,"_",getexchangename,"_",getstrategyname,"_",
barinterval:0:0,"_open_",getappinfo(aiappid):0:0), 0) ;
end;
But if one were to do the above (i.e. applied the receiver GV block to a receiver chart), we find that the returned values for Today_Profit and Open_Pnl are zero, which makes sense as the parameters

Code: Select all

getsymbolname,"_",getexchangename,"_",getstrategyname,"_",barinterval:0:0,"_profit_",getappinfo(aiappid)
returns the attributes of the receiver chart and not of the sender chart.
So, the question remains, has anyone used GV set/get with aiappid etc successfully on charts where the sender and receiver are not the same?

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Gv and aiappid

Postby Henry MultiСharts » 25 Sep 2013

aiappid will return a unique number for each chart. You do not need to use it in the variable name to get the GV data transfer between charts.


Return to “MultiCharts”