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,873 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

(login for full post details)
  #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?
Wicked Renko Bars
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
News alerts
Traders Hideout
Searching for CurrentMonthOHL Indicator
NinjaTrader
Trader Dale [email protected] or Scammer Dale
Trading Reviews and Vendors
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Tao te Trade: way of the WLD
37 thanks
Deaddogs Stock Trading
27 thanks
GFIs1 1 DAX trade per day journal
26 thanks
Supertradersams Thread Journal on NQ/MNQ
24 thanks
Leaving CFD trading and learning futures
11 thanks

(login for full post details)
  #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
The following user says Thank You to NW27 for this post:
(login for full post details)
  #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
(login for full post details)
  #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