Global Variables - does this beast exist in Ninja - futures io
futures io futures trading



Global Variables - does this beast exist in Ninja


Discussion in NinjaTrader

Updated by shodson
      Top Posters
    1. looks_one trendisyourfriend with 3 posts (0 thanks)
    2. looks_two monpere with 2 posts (4 thanks)
    3. looks_3 ejtrader with 2 posts (1 thanks)
    4. looks_4 NJAMC with 2 posts (1 thanks)
      Best Posters
    1. looks_one monpere with 2.0 thanks per post
    2. looks_two shodson with 1.0 thanks per post
    3. looks_3 NJAMC with 0.5 thanks per post
    4. looks_4 ejtrader with 0.5 thanks per post
    1. trending_up 4,479 views
    2. thumb_up 7 thanks given
    3. group 6 followers
    1. forum 13 replies
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
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

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

 
Thread Tools Search this Thread
 

Global Variables - does this beast exist in Ninja

  #1 (permalink)
Quebec
 
Experience: Intermediate
Platform: NinjaTrader wt Rancho Dinero's profiling tools
Broker: AMP/CQG
Trading: ES, NQ, YM
 
trendisyourfriend's Avatar
 
Posts: 3,877 since Oct 2009
Thanks: 3,496 given, 4,947 received

Global Variables - does this beast exist in Ninja

Is it possible for two different charts that use the same symbol in their DataSeries to share a common variable ? Does the concept of Global Variable exist in Ninja ?

Reply With Quote

Can you help answer these questions
from other members on futures io?
Convert NinjaTrader NT7 indicator to Tradestation EasyLanguage and RADARSCREEN
Platforms and Indicators
Issue meeting order entry conditions
Elite Automated NinjaTrader Trading
Last 5 minutes Label
ThinkOrSwim
Moving average with Lag reduction
NinjaTrader
Linux?
ThinkOrSwim
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Spoo-nalysis ES e-mini futures S&P 500
245 thanks
What is your single biggest weakness?
58 thanks
Want your NinjaTrader indicator created, free?
44 thanks
VWAP for stock index futures trading?
39 thanks
Is Amp at risk of going under?
39 thanks
 
  #3 (permalink)
Atkinson, NH USA
 
Experience: Intermediate
Platform: NinjaTrader 8/TensorFlow
Broker: NinjaTrader Brokerage
Trading: Futures, CL, ES, ZB
 
NJAMC's Avatar
 
Posts: 1,963 since Dec 2010
Thanks: 3,028 given, 2,374 received



trendisyourfriend View Post
Is it possible for two different charts that use the same symbol in their DataSeries to share a common variable ? Does the concept of Global Variable exist in Ninja ?

If I understand your question, the answer would be no. Two charts cannot communicate with one another. I suspect you have something else in mind such as an Indicator or Strategy. If this is the case, give more information and there may be a programming technique to get what youneed.

Nil per os
-NJAMC [Generic Programmer]

LOM WIKI: NT-Local-Order-Manager-LOM-Guide
Artificial Bee Colony Optimization
Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to NJAMC for this post:
 
  #4 (permalink)
Quebec
 
Experience: Intermediate
Platform: NinjaTrader wt Rancho Dinero's profiling tools
Broker: AMP/CQG
Trading: ES, NQ, YM
 
trendisyourfriend's Avatar
 
Posts: 3,877 since Oct 2009
Thanks: 3,496 given, 4,947 received


NJAMC View Post
If I understand your question, the answer would be no. Two charts cannot communicate with one another. I suspect you have something else in mind such as an Indicator or Strategy. If this is the case, give more information and there may be a programming technique to get what youneed.

I might have some ideas but if Global variables are not supported then i am not sure what to think. I/RT supports it very well. Let's take an easy task (in my mind), i use a SMA(8) on a Range chart and would like to pass the current value of this RangeChart(x).SMA(8) to another chart that is a tick chart for example. Is this possible ?

Reply With Quote
 
  #5 (permalink)
Atkinson, NH USA
 
Experience: Intermediate
Platform: NinjaTrader 8/TensorFlow
Broker: NinjaTrader Brokerage
Trading: Futures, CL, ES, ZB
 
NJAMC's Avatar
 
Posts: 1,963 since Dec 2010
Thanks: 3,028 given, 2,374 received


trendisyourfriend View Post
I might have some ideas but if Global variables are not supported then i am not sure what to think. I/RT supports it very well. Let's take an easy task (in my mind), i use a SMA(8) on a Range chart and would like to pass the current value of this RangeChart(x).SMA(8) to another chart that is a tick chart for example. Is this possible ?

If you are only trying to display the value, you are looking at a multi timeframe Indicator. The indicator would be applied to the "other chart". you wouldn't actually need the RangeChart open. This is not trivial, but can be done, and would need to be coded.

Nil per os
-NJAMC [Generic Programmer]

LOM WIKI: NT-Local-Order-Manager-LOM-Guide
Artificial Bee Colony Optimization
Visit my futures io Trade Journal Reply With Quote
 
  #6 (permalink)
Denver, CO
 
Experience: Advanced
Platform: NinjaTrader
Broker: NinjaTrader Brokerage
Trading: ES
 
NinjaTrader's Avatar
 
Posts: 1,510 since May 2010
Thanks: 177 given, 2,280 received


trendisyourfriend View Post
I might have some ideas but if Global variables are not supported then i am not sure what to think. I/RT supports it very well. Let's take an easy task (in my mind), i use a SMA(8) on a Range chart and would like to pass the current value of this RangeChart(x).SMA(8) to another chart that is a tick chart for example. Is this possible ?

You could just add both series to a single chart, apply the indicator to the range series but it plot it over top of the other tick series and hide the range series...If I understand what you want to do correctly.

I believe this video might help - NinjaTrader 7 Tips - Hidden Data Series - YouTube

Reply With Quote
 
  #7 (permalink)
Bala, PA, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus, IB
Trading: SPY, Oil, Euro
 
monpere's Avatar
 
Posts: 1,858 since Jul 2010
Thanks: 300 given, 3,327 received


trendisyourfriend View Post
Is it possible for two different charts that use the same symbol in their DataSeries to share a common variable ? Does the concept of Global Variable exist in Ninja ?

I haven't had the need tor two charts to talk to each other, but I get an indicator to talk to a strategy using this:

//### This is for External strategies.
//### Update() ensures this exposed variable is up to date, when external strategy Add()'s this indicator
public string TradeCommand {
get { Update(); return tradeCommand; }
Set { tradeCommand = value; }
}

And I get one indicator to share variables with another indicator like this:

public class GlobalChartVars {
public static Dictionary<string, string> chartIds = new Dictionary<string, string>();
public static Dictionary<string, string> SoundFiles = new Dictionary<string, string>();
}

I think the 2nd one should be able to share data between charts. I haven't tried it that way, but maybe that can give you some ideas.


Last edited by monpere; January 28th, 2012 at 07:02 PM.
Reply With Quote
The following 3 users say Thank You to monpere for this post:
 
  #8 (permalink)
Portland, OR
 
Experience: Intermediate
Platform: Sierra Chart
Trading: ES
 
Posts: 269 since Jan 2011
Thanks: 327 given, 180 received

- I have done some work in this space
- it is possible to share the values using globalvariable.dll (tradestation dll)
- I would do a cleanup of the code and post in elite downloads section soon.

Reply With Quote
The following user says Thank You to ejtrader for this post:
 
  #9 (permalink)
East Coast
 
Experience: Beginner
Platform: Ninja
Trading: ES, NQ
 
Posts: 126 since Apr 2010
Thanks: 55 given, 80 received

The GlobalVariable.dll was great in TradeStation and NT 32bit. In 64bit NT the static class works.

Reply With Quote
 
  #10 (permalink)
Portland, OR
 
Experience: Intermediate
Platform: Sierra Chart
Trading: ES
 
Posts: 269 since Jan 2011
Thanks: 327 given, 180 received


Tarkus1 - you are correct. I did it sometime back and realized it would work only with 32 bit version of Ninja ( due to the dll being 32 bit).

probably static class might be the way to go in that case.

Thanks.

Reply With Quote



futures io Trading Community Platforms and Indicators NinjaTrader > Global Variables - does this beast exist in Ninja




Upcoming Webinars and Events
 

Understanding Order Flow Stops Runs & Icebergs w/Bookmap

May 28
     



Copyright © 2020 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