Sharing data between two indicators - NinjaTrader Programming | futures io social day trading
futures io futures trading


Sharing data between two indicators
Updated: Views / Replies:2,037 / 8
Created: by Erez 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
 

Sharing data between two indicators

  #1 (permalink)
Elite Member
Haifa,,,
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: CQG
Favorite Futures: Futures
 
Posts: 186 since Mar 2011
Thanks: 181 given, 865 received

Sharing data between two indicators

I'm looking for method to share (communicate) data between two indicators.
Both indicators need to be attached to the same chart.
Call one indicator from within another one is not an option, as it limits plot options in the called one.
At first stage I want to keep it simple, so one indicator need only to send/outputs data and the second one only to read it.
DataSeries is the preferred data type I would like to use, so it can be used for both,historical and real-time.

Any suggestions?

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)
 Vendor: www.tools4trading.de 
Erfurt Germany
 
Futures Experience: Master
Platform: rtMagic, NinjaTrader
Broker/Data: AMP/CQG, IAB
Favorite Futures: ES, 6E, FDAX, FGBL
 
Posts: 338 since Aug 2011
Thanks: 54 given, 460 received



Erez View Post
I'm looking for method to share (communicate) data between two indicators.
Both indicators need to be attached to the same chart.
Call one indicator from within another one is not an option, as it limits plot options in the called one.
At first stage I want to keep it simple, so one indicator need only to send/outputs data and the second one only to read it.
DataSeries is the preferred data type I would like to use, so it can be used for both,historical and real-time.

Any suggestions?

using the same "base class" and comunicate / datashare over static public class variable of this base class

myStorageIndiClass : Indicator
static valuelist = new list<double>

myWorkTool1 : myStorageIndiClass
valuelist.Add(Close[0])

myWorkTool2 : myStorageIndiClass
Close[0]=Mean(valuelist)

Reply With Quote
The following user says Thank You to TimeTrade for this post:
 
  #4 (permalink)
Elite Member
Haifa,,,
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: CQG
Favorite Futures: Futures
 
Posts: 186 since Mar 2011
Thanks: 181 given, 865 received


TimeTrade View Post
using the same "base class" and comunicate / datashare over static public class variable of this base class

myStorageIndiClass : Indicator
static valuelist = new list<double>

myWorkTool1 : myStorageIndiClass
valuelist.Add(Close[0])

myWorkTool2 : myStorageIndiClass
Close[0]=Mean(valuelist)

Thanks @TimeTrade, can you give more details? I'm not sure I completely understand your concept.

This is how the code shall looks from sender side?
How it should look from receiver side?
 
Code
 
namespace NinjaTrader.Indicator
{
    public class myStorageIndiClass : Indicator
    {
  public static valuelist = new list<double>;
 
        protected override void Initialize()
        {
        }
        protected override void OnBarUpdate()
        {
          valuelist.Add(Close[0]);
        }
 }
}

Reply With Quote
 
  #5 (permalink)
 Vendor: www.tools4trading.de 
Erfurt Germany
 
Futures Experience: Master
Platform: rtMagic, NinjaTrader
Broker/Data: AMP/CQG, IAB
Favorite Futures: ES, 6E, FDAX, FGBL
 
Posts: 338 since Aug 2011
Thanks: 54 given, 460 received


Erez View Post
Thanks @TimeTrade, can you give more details? I'm not sure I completely understand your concept.

This is how the code shall looks from sender side?
How it should look from receiver side?
 
Code
 
namespace NinjaTrader.Indicator
{
    public class myStorageIndiClass : Indicator
    {
  public static valuelist = new list<double>;
 
        protected override void Initialize()
        {
        }
        protected override void OnBarUpdate()
        {
          valuelist.Add(Close[0]);
        }
 }
}

 
Code
 
file 1:
namespace NinjaTrader.Indicator
{
    public class myStorageIndiClass : Indicator
    {
        public static valuelist = new list<double>;
    }
}

file 2:
namespace NinjaTrader.Indicator
{
    public class myWriteIndi : myStorageIndiClass
    {
        protected override void OnBarUpdate()
        {
          valuelist.Add(Close[0]);
        }
}

file 3:
namespace NinjaTrader.Indicator
{
    public class myReadIndi : myStorageIndiClass
    {
        protected override void OnBarUpdate()
        {
         // use try or count check to prevent problems with empty lists !!!
          Close[0]=valuelist[0];
        }
}

Reply With Quote
The following 5 users say Thank You to TimeTrade for this post:
 
  #6 (permalink)
Elite Member
Haifa,,,
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: CQG
Favorite Futures: Futures
 
Posts: 186 since Mar 2011
Thanks: 181 given, 865 received

Thanks, I'll test it.

I guess that I can use more than one instance of this in the same chart simultaneously, because the classes are not static.


TimeTrade View Post
 
Code
 
file 1:
namespace NinjaTrader.Indicator
{
    public class myStorageIndiClass : Indicator
    {
        public static valuelist = new list<double>;
    }
}
 
file 2:
namespace NinjaTrader.Indicator
{
    public class myWriteIndi : myStorageIndiClass
    {
        protected override void OnBarUpdate()
        {
          valuelist.Add(Close[0]);
        }
}
 
file 3:
namespace NinjaTrader.Indicator
{
    public class myReadIndi : myStorageIndiClass
    {
        protected override void OnBarUpdate()
        {
         // use try or count check to prevent problems with empty lists !!!
          Close[0]=valuelist[0];
        }
}


Reply With Quote
The following user says Thank You to Erez for this post:
 
  #7 (permalink)
 Vendor: www.tools4trading.de 
Erfurt Germany
 
Futures Experience: Master
Platform: rtMagic, NinjaTrader
Broker/Data: AMP/CQG, IAB
Favorite Futures: ES, 6E, FDAX, FGBL
 
Posts: 338 since Aug 2011
Thanks: 54 given, 460 received


Erez View Post
Thanks, I'll test it.

I guess that I can use more than one instance of this in the same chart simultaneously, because the classes are not static.

You can all do, if you have this self programmed... for more instances you cad add a key(=instance) based dictionary for select the right storeage container... or any other way (example the "register" concept with a unique name on Init and the storage shows the exist of this, if yes return the right container, if no create a new container and return the new value,...)
The only problem: you must understand the logic and know the "C# way" for realize this

Reply With Quote
The following 2 users say Thank You to TimeTrade for this post:
 
  #8 (permalink)
Elite Member
rockford
 
Futures Experience: Beginner
Platform: ninjatrader
Favorite Futures: oil
 
Posts: 43 since Apr 2012
Thanks: 3 given, 22 received

Hi TimeTrade

I get the following error trying to compile file1

Invalid token '=' in class, struct, or interface member declaration


TimeTrade View Post
 
Code
 
file 1:
namespace NinjaTrader.Indicator
{
    public class myStorageIndiClass : Indicator
    {
        public static valuelist = new list<double>;
    }
}

file 2:
namespace NinjaTrader.Indicator
{
    public class myWriteIndi : myStorageIndiClass
    {
        protected override void OnBarUpdate()
        {
          valuelist.Add(Close[0]);
        }
}

file 3:
namespace NinjaTrader.Indicator
{
    public class myReadIndi : myStorageIndiClass
    {
        protected override void OnBarUpdate()
        {
         // use try or count check to prevent problems with empty lists !!!
          Close[0]=valuelist[0];
        }
}


Reply With Quote
 
  #9 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,238 since Jun 2009
Thanks: 29,350 given, 83,218 received

Check a newer thread here:

https://futures.io/elite-automated-ninjatrader-trading/31403-global-variable.html

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote

Reply



futures io > > > > > Sharing data between two indicators

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

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 1320 December 4th, 2017 07:38 AM
Market data sharing rounder8 The Elite Circle 5 May 27th, 2012 04:47 AM
Global variables for sharing data between Charts ECI Ed NinjaTrader Programming 5 March 6th, 2012 10:02 AM
Moving Data between realtime indicators tinkerz NinjaTrader 3 May 22nd, 2011 06:53 AM
Does anyone have FDAX historical data they wouldn't mind sharing? Twiddle The Elite Circle 3 August 10th, 2010 08:38 AM


All times are GMT -4. The time now is 11:02 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-11 in 0.13 seconds with 19 queries on phoenix via your IP 54.145.16.43