| 
Rank: Advanced Member
 Groups: Registered, Registered Users, SubscribersJoined: 6/12/2007(UTC)
 Posts: 32
 
 | 
            
	      
                Can you have global varaibles? I have a band trading system where I can manaully set the band parameters for a chart. The system also has indicator with band parameter that must be manaully set to the same level as the chart's. I want to know if its possible using global variables, when setting the chart band parameters they will automatically apply to all indicators as well.  Below are the band parmaters am using in chart & indicators - "x", "y" and "a"  x:=Input("Short Term Moving Average",7,14,7);y:=Input("Envelopes Percentage variation",1,30,5)/100;
 a:=x*5;
 Mov(C,x,E);Mov(C,x,S)*(1+y);
 Mov(C,x,S)*(1-y);
 Mov(C,a,E);
 Gregor     | 
    | 
             | 
            
         | 
    |  | 
        
        
        
            
        
            
            
    | 
Rank: Advanced Member
 Groups: Registered, Registered Users, SubscribersJoined: 7/25/2005(UTC)
 Posts: 1,042
 
 Was thanked: 57 time(s) in 54 post(s)
 | 
            
	      
                Hi Gregor
After setting global variable values via Input() functions in one indicator (SetVar GV function), you should only need to refresh the current chart in order to apply the new GV values to other indicators. One indicator needs to be the "master" and the others "slaves". That is, one indicator writes (SetVar) the required parameter values and all others read or (GetVar) those values. 
Indicators reading the GV values would need to apply LastValue() to them so they could be used as Periods parmeters.
Roy | 
    | 
             | 
            
         | 
    |  | 
        
        
        
    
        
            
            
    | 
Rank: Advanced Member
 Groups: Registered, Registered Users, Subscribers, Unverified UsersJoined: 10/28/2004(UTC)
 Posts: 3,112
 Location: Perth, Western Australia
 
 Was thanked: 17 time(s) in 17 post(s)
 | 
            
	      
                You can also use FmlVar(). 
wabbit [:D]
 | 
    | 
             | 
            
         | 
    |  | 
        
        
        
            
        
            
            
    | 
Rank: Advanced Member
 Groups: Registered, Registered Users, SubscribersJoined: 5/13/2005(UTC)
 Posts: 715
 Location: Midwest, USA
 
 Was thanked: 1 time(s) in 1 post(s)
 | 
            
	      
                Roy -- Might want to let him know where to download GV.DLL and any docs...
 
 
 | 
    | 
             | 
            
         | 
    |  | 
        
        
        
    
        
            
            
    | 
Rank: Advanced Member
 Groups: Registered, Registered Users, SubscribersJoined: 7/25/2005(UTC)
 Posts: 1,042
 
 Was thanked: 57 time(s) in 54 post(s)
 |  | 
    | 
             | 
            
         | 
    |  | 
        
        
        
    
                           
    
| Users browsing this topic | 
| 
Guest (Hidden) | 
    
        Forum Jump
         
    
    You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.