Hi,
When GVSetNamedInt and GVGetNamedInt were used to pass values from low resolution time frame to high resolution time frame, saying, 5m as the sender and 1m as the receiver, it worked fine. However, I couldn't get it work on the reverse direction, i.e., 1m as the sender, 5m as the receiver. Were they designed as so or anything I missed? thanks.
-K
GVSetNamedInt, GVGetNamedInt
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: GVSetNamedInt, GVGetNamedInt
They should work in either direction. Were both scripts updating continously, either by checking the option 'update on every tick' (for indicators) or with RecalcLastBarAfter?When GVSetNamedInt and GVGetNamedInt were used to pass values from low resolution time frame to high resolution time frame, saying, 5m as the sender and 1m as the receiver, it worked fine. However, I couldn't get it work on the reverse direction, i.e., 1m as the sender, 5m as the receiver. Were they designed as so or anything I missed? thanks.
When, for example, both scripts are calculated on bar close only, the 1m sender would submit five `GVSetNamedInt` updates before the 5m receiver would be able to access one value through `GVGetNamedInt` (since the 5m receiver would only pull or set a global variable every 5 minutes).
Re: GVSetNamedInt, GVGetNamedInt
I set IntraBarOrderGeneration to true in both the 1m and 5m scripts, so the updating frequency should be tick by tick, regardless who the sender/receiver is, right?They should work in either direction. Were both scripts updating continously, either by checking the option 'update on every tick' (for indicators) or with RecalcLastBarAfter?
When, for example, both scripts are calculated on bar close only, the 1m sender would submit five `GVSetNamedInt` updates before the 5m receiver would be able to access one value through `GVGetNamedInt` (since the 5m receiver would only pull or set a global variable every 5 minutes).
Re: GVSetNamedInt, GVGetNamedInt
ran a quick test as follows:
30m (indicator, sender/receiver) script:
5m (indicator, sender/receiver) script:
1m (signal, sender/receiver) script:
apply 30m, 5m, and 1m to 30m, 5m and 1m chart respectively.
output:
even with IntraBarOrderGeneration set to TRUE, dat1 was not updated on every tick, i.e., the script was not run on every incoming tick. What have I missed?
30m (indicator, sender/receiver) script:
Code: Select all
[IntraBarOrderGeneration = TRUE]
vars:
dat30(30);
//send
GVSetNamedInt("d30",dat30);
//recieve
print("30m: d1=", GVGetNamedInt("d1",-999), " dat30=", dat30);
5m (indicator, sender/receiver) script:
Code: Select all
[IntraBarOrderGeneration = TRUE]
//send
GVSetNamedInt("d5",5);
//recieve
print("5m: d1=", GVGetNamedInt("d1",-999));
1m (signal, sender/receiver) script:
Code: Select all
[IntraBarOrderGeneration = TRUE]
vars:
dat1(0);
dat1=dat1+1;
//send
GVSetNamedInt("d1",1);
//recieve
print("1m: d5=", GVGetNamedInt("d5",-999), " d30=", GVGetNamedInt("d30",-999), " dat1=", dat1);
apply 30m, 5m, and 1m to 30m, 5m and 1m chart respectively.
output:
Code: Select all
1m: d5= 5.00 d30= 30.00 dat1= 1.00
1m: d5= 5.00 d30= 30.00 dat1= 1.00
1m: d5= 5.00 d30= 30.00 dat1= 1.00
1m: d5= 5.00 d30= 30.00 dat1= 1.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
1m: d5= 5.00 d30= 30.00 dat1= 2.00
1m: d5= 5.00 d30= 30.00 dat1= 3.00
30m: d1= 1.00 dat30= 30.00
30m: d1= 1.00 dat30= 30.00
30m: d1= 1.00 dat30= 30.00
30m: d1= 1.00 dat30= 30.00
30m: d1= 1.00 dat30= 30.00
30m: d1= 1.00 dat30= 30.00
30m: d1= 1.00 dat30= 30.00
30m: d1= 1.00 dat30= 30.00
30m: d1= 1.00 dat30= 30.00
30m: d1= 1.00 dat30= 30.00
30m: d1= 1.00 dat30= 30.00
30m: d1= 1.00 dat30= 30.00
30m: d1= 1.00 dat30= 30.00
30m: d1= 1.00 dat30= 30.00
30m: d1= 1.00 dat30= 30.00
30m: d1= 1.00 dat30= 30.00
30m: d1= 1.00 dat30= 30.00
30m: d1= 1.00 dat30= 30.00
30m: d1= 1.00 dat30= 30.00
30m: d1= 1.00 dat30= 30.00
30m: d1= 1.00 dat30= 30.00
30m: d1= 1.00 dat30= 30.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 4.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 4.00
1m: d5= 5.00 d30= 30.00 dat1= 4.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 4.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 4.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 4.00
30m: d1= 1.00 dat30= 30.00
1m: d5= 5.00 d30= 30.00 dat1= 4.00
Re: GVSetNamedInt, GVGetNamedInt
then I added one line in the 30m script to have its data "dat30" incremented on each run:
5m and 1m scripts were same as before.
output:
dat30 got assigned to 3350, a number I have no idea where it came from. any one has any clue? thanks.
Code: Select all
[IntraBarOrderGeneration = TRUE]
vars:
dat30(30);
dat30=dat30+1;
//send
GVSetNamedInt("d30",dat30);
//recieve
print("30m: d1=", GVGetNamedInt("d1",-999), " dat30=", dat30);
output:
Code: Select all
1m: d5= 5.00 d30=3350.00 dat1= 3.00
30m: d1= 1.00 dat30=3350.00
5m: d1= 1.00
30m: d1= 1.00 dat30=3350.00
5m: d1= 1.00
30m: d1= 1.00 dat30=3350.00
5m: d1= 1.00
30m: d1= 1.00 dat30=3350.00
5m: d1= 1.00
30m: d1= 1.00 dat30=3350.00
5m: d1= 1.00
30m: d1= 1.00 dat30=3350.00
5m: d1= 1.00
30m: d1= 1.00 dat30=3350.00
5m: d1= 1.00
30m: d1= 1.00 dat30=3350.00
5m: d1= 1.00
30m: d1= 1.00 dat30=3350.00
5m: d1= 1.00
30m: d1= 1.00 dat30=3350.00
5m: d1= 1.00
30m: d1= 1.00 dat30=3350.00
5m: d1= 1.00
30m: d1= 1.00 dat30=3350.00
5m: d1= 1.00
30m: d1= 1.00 dat30=3350.00
5m: d1= 1.00
30m: d1= 1.00 dat30=3350.00
5m: d1= 1.00
30m: d1= 1.00 dat30=3350.00
5m: d1= 1.00
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times