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 Quick Summary with 1 posts (0 thanks)
    3. looks_3 NW27 with 1 posts (1 thanks)
    4. looks_4 Bimi with 1 posts (0 thanks)
    1. trending_up 2,915 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread

MC 7.4 Global Variables

  #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?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
ZombieSqueeze
Platforms and Indicators
Better Renko Gaps
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Exit Strategy
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
35 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
19 thanks
GFIs1 1 DAX trade per day journal
16 thanks
Spoo-nalysis ES e-mini futures S&P 500
14 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


© 2024 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 - Privacy Policy - Downloads - Top
no new posts