Global variables for sharing data between Charts - NinjaTrader Programming | futures io social day trading
futures io futures trading


Global variables for sharing data between Charts
Updated: Views / Replies:1,766 / 5
Created: by ECI Ed Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Global variables for sharing data between Charts

  #1 (permalink)
Trading Apprentice
Seminole, FL
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: ES
 
Posts: 17 since Oct 2011
Thanks: 9 given, 1 received

Global variables for sharing data between Charts

I have been using Esignal for 9 years and have written many efs's. Now I would like to convert my efs's to NinjaTrader to take advantage of lower data costs and automated trading. But a feature that I use extensively is the Global Variable where the results from an efs in one subchart are stored in a Global variable then read by an efs in another chart or subchart.

I took a course at the local Junior College to learn the basics of C# and I'm just now starting to convert my code, but I'm not going to get very far without this capablilty. I know I could save the data to a file, but that would cause too much delay. I read in one of the posts that this might be accomplised by writing a dll.

Any help, direction, or examples would be appreciated.

TIA

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Urban Samurai
Chicago IL
 
Futures Experience: Intermediate
Platform: Ninja, MT4,TOS, SC, Matlab
Broker/Data: CQG, AMP, MB, DTN
Favorite Futures: E/U, G/U
 
forrestang's Avatar
 
Posts: 1,039 since Jun 2010
Thanks: 226 given, 688 received


If you need something that one study calculates available for another study, as long as you declare it as an 'exposed' dataSeries or variable, any study you create can access that information.

Not sure if that is your question or not?

Reply With Quote
 
  #4 (permalink)
Elite Member
Calcutta, India
 
Futures Experience: Intermediate
Platform: ArthaChitra
 
Posts: 278 since Jun 2009
Thanks: 161 given, 259 received

indicator strategies are partial class (see userdefinedmethods.cs). you can define a static property etc and store the values there which can be called by any other indicators etc. very easy and convenient way of passing values.

Reply With Quote
The following user says Thank You to bukkan for this post:
 
  #5 (permalink)
Trading for Fun
College Point, NY (Queens)
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: AMP/CQG
Favorite Futures: YM
 
Posts: 63 since Nov 2009
Thanks: 5 given, 20 received


bukkan View Post
indicator strategies are partial class (see userdefinedmethods.cs). you can define a static property etc and store the values there which can be called by any other indicators etc. very easy and convenient way of passing values.

I agree, a static is one way to go. But remember, a static is a class variable, not an instance variable. If you instantiate multiple instances of your class, they'll all use the same static variable. For example, my strats all use statics. But I only start one instance of each, because it's not clear which strat will update the static if I start multiple instances (a good multithreading issue).

Reply With Quote
The following 2 users say Thank You to kandlekid for this post:
 
  #6 (permalink)
Elite Member
New York
 
Futures Experience: None
Platform: Ninja, Kinetick
Broker/Data: Global futures
Favorite Futures: ES
 
Posts: 1 since May 2010
Thanks: 0 given, 0 received


forrestang View Post
If you need something that one study calculates available for another study, as long as you declare it as an 'exposed' dataSeries or variable, any study you create can access that information.

Not sure if that is your question or not?

So how do I do the following:


Let's say I plot an SMA on a TICK chart then another on an ADD chart.

Now I want to access the current SMA data being calculated on TICK and then SMA on ADD.

I know that I can, within a code:
Initialize section:
add("^TICK", PeriodType.Second,4)
add("^ADD", PeriodType.Second,4)


Then in the OnBarsUpdate section refer to the added data series and do an SMA on each but that's a waste of CPU. I want to access the SMA already being calculated on the ADD chart and TICK chart, so that if I add this code to, say 15 different instruments, I don't need to have all 15 instruments recalculating what I is alreayd being calculated on the TICK and the ADD charts.

Is this possible within NinjaTrader?

Does anyone know?

Reply With Quote

Reply



futures io > > > > > Global variables for sharing data between Charts

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Official tick data sharing thread for raw data, GomRecorder and QCollector Big Mike The Elite Circle 1322 Yesterday 07:07 AM
Global Variables (GV) in EasyLanguage for TradeStation/MultiCharts Big Mike EasyLanguage Programming 19 October 29th, 2013 04:07 PM
Market data sharing rounder8 The Elite Circle 5 May 27th, 2012 04:47 AM
global variables: anyone got a complete NT7 example? elbone NinjaTrader Programming 2 July 19th, 2011 10:13 AM
Global Variables and Strategies in Ninja 6.5 TonyA NinjaTrader Programming 3 November 6th, 2010 08:50 AM


All times are GMT -4. The time now is 10:47 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-14 in 0.10 seconds with 19 queries on phoenix via your IP 54.90.207.75