NexusFi: Find Your Edge


Home Menu

 





MC 7.4 Global Variables


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one kleff with 2 posts (0 thanks)
    2. looks_two Bimi with 1 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 NW27 with 1 posts (1 thanks)
    1. trending_up 3,432 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
kleff
Stockholm
 
Posts: 2 since Jul 2011
Thanks Given: 1
Thanks Received: 0

Hello, I've got a simple question in regards to using global variables in MultiCharts 7.4. Despite,
being fairly new I usually end up fixing it trough trial and error, but now I'm stuck, and I haven't
found a solution.

I've got an index in which I've plotted moving averages. I wanted to transfer the value
of the division to a second chart. It was sucessful, however I only receive the
value calculated from the latest bar, giving me a flat line.

Is it possible to transfer the value from the previous bars aswell?

This is my code.

Sending chart

var0 = XAverage(Close, EMA1)/XAverage(Close, EMA2);

If Bartype = 3 then
Begin
GVSetNamedDouble("Study 1",var0);
End;

Receiving chart

var0 = GVGetNamedDouble("Study 1",0);

If BarType = 3 then
Begin
Plot1(var0,"EMAs",red);
RecalcLastBarAfter(1);
End;

Thanks in advance.

Edit: I'm using EOD data.


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Iran Update May 8: Still Reviewing MOU, Demands Reparati …
Traders Hideout
ATFX Suspends Prop Trading Unit ATFunded -- Full Review …
Funded Trading Evaluation Firms
Election Sunday Resolves: Peru Heads to Runoff at 42pct, …
Prediction Markets & Event Contracts
Powell in 48 Hours: Word Markets Give 78% on Inflation, …
Prediction Markets & Event Contracts
UMA Votes Tonight: Polymarkets $80M Strategy Bitcoin Bat …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
196 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
BERN ALGOS algo trading journal
8 thanks
Volume Indicators
8 thanks
  #3 (permalink)
 NW27 
Newcastle, Australia
 
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
Posts: 285 since Oct 2010
Thanks Given: 108
Thanks Received: 188


No.
Put both of them onto the same chart screen and hide one.
This is how i display a ma from a 5min chart on my tick chart.

Sent from my GT-I9100T using Tapatalk 2


Reply With Quote
Thanked by:
  #4 (permalink)
kleff
Stockholm
 
Posts: 2 since Jul 2011
Thanks Given: 1
Thanks Received: 0


NW27 View Post
No.
Put both of them onto the same chart screen and hide one.
This is how i display a ma from a 5min chart on my tick chart.

Sent from my GT-I9100T using Tapatalk 2

Ok, I'll do that. Thanks!


Reply With Quote
  #5 (permalink)
Bimi
London
 
Posts: 118 since Mar 2010
Thanks Given: 42
Thanks Received: 58


kleff View Post
Hello, I've got a simple question in regards to using global variables in MultiCharts 7.4. Despite,
being fairly new I usually end up fixing it trough trial and error, but now I'm stuck, and I haven't
found a solution.

I've got an index in which I've plotted moving averages. I wanted to transfer the value
of the division to a second chart. It was sucessful, however I only receive the
value calculated from the latest bar, giving me a flat line.

Is it possible to transfer the value from the previous bars aswell?

This is my code.

Sending chart

var0 = XAverage(Close, EMA1)/XAverage(Close, EMA2);

If Bartype = 3 then
Begin
GVSetNamedDouble("Study 1",var0);
End;

Receiving chart

var0 = GVGetNamedDouble("Study 1",0);

If BarType = 3 then
Begin
Plot1(var0,"EMAs",red);
RecalcLastBarAfter(1);
End;

Thanks in advance.

Edit: I'm using EOD data.

take the space out of "Study 1"


Reply With Quote




Last Updated on May 12, 2012


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts