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?
Gv and aiappid
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Gv and aiappid
You need to give more detail... maybe with sample code and screenshots with notes?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?
Re: Gv and aiappid
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:
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:
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
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?
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;
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;
Code: Select all
getsymbolname,"_",getexchangename,"_",getstrategyname,"_",barinterval:0:0,"_profit_",getappinfo(aiappid)
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?
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Gv and aiappid
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.