Expose Public Class List - NinjaTrader Programming | futures io social day trading
futures io futures trading


Expose Public Class List
Updated: Views / Replies:1,674 / 6
Created: by TAJTrades 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
 

Expose Public Class List

  #1 (permalink)
Trading for Fun
Here, GA
 
Futures Experience: Intermediate
Platform: Ninja
 
Posts: 146 since Jun 2009
Thanks: 1 given, 72 received

Expose Public Class List

Obviously my egotistical, narcissistic beliefs in my coding skills great exceed reality. So could somebody toss me a bone LOL.

I am trying to Expose the List created in the code to other Indicators and Strategies. The code seems to work fine within the indicator and am in fact using it. After spending a few weeks I still have not figured out how to expose it. I am guessing that I need something in the Properties Region and have tried many ideas but no success. Or maybe this is not possible.

 
Code
                            
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Gui.Chart;
using System.Collections.Generic;
#endregion

// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
    
//     Use Indicator Name as Prefix to Class Name
    
public class htcSampleExposePublicList_SampleListClass
    
{
        public 
int SampleInt
        public 
double SampleDouble;
        public 
string SampleString;
        public 
bool SampleBool;
    
        public 
htcSampleExposePublicList_SampleListClass(int SampleIntdouble SampleDoublestring SampleStringbool SampleBool )
        {
            
this.SampleInt SampleInt;
            
this.SampleDouble SampleDouble;
            
this.SampleString SampleString;
            
this.SampleBool SampleBool;
        }
    }    
    

    [
Description("Learn how to Expose a Publis Class List")]
    public class 
htcSampleExposePublicList Indicator
    
{
        
#region Variables
        // User defined variables (add any user defined variables below)
        
public List<htcSampleExposePublicList_SampleListClasssamplelistclass = new List<htcSampleExposePublicList_SampleListClass>();        
        
        
#endregion


        
protected override void Initialize()
        {
            
Overlay                false;
        }

        
/// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        
protected override void OnBarUpdate()
        {
            
//  Criteria to Clear List
            
if (Falling(SMA(20))) 
                
samplelistclass.Clear();
            
            
//  Criteria to Add to List
            
if (Rising(SMA(20))) 
                
samplelistclass.Add(new htcSampleExposePublicList_SampleListClass(0SMA(10)[0], "SMA is Rising"true ));
                
        }

        
#region Properties

            //  What is the Code to Expose "samplelistclass" to other Indicators and Stratagies?
        
        #endregion
    
}

Or maybe there is another solution to the problem that I am not aware of. After all I am not aware of much!

Thanks

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)
Elite Member
Santa Maria
 
Futures Experience: Advanced
Platform: NinjaTrader, ThinkOrSwim
Broker/Data: Mirus/Zen-Fire
Favorite Futures: ES
 
Posts: 295 since May 2010
Thanks: 101 given, 320 received


See if these minor modifications to your posting help (I had to strip stuff you'll have to put back, it said my post was too long):

 
Code
#region Using declarations
...
#endregion
namespace NinjaTrader.Indicator
{
// Use Indicator Name as Prefix to Class Name
publicclass htcSampleExposePublicList_SampleListClass
{
   publicint SampleInt; 
   publicdouble SampleDouble;
   publicstring SampleString;
   publicbool SampleBool;
 
   public htcSampleExposePublicList_SampleListClass(int SampleInt, double SampleDouble, string SampleString, bool SampleBool )
   {
      this.SampleInt = SampleInt;
      this.SampleDouble = SampleDouble;
      this.SampleString = SampleString;
      this.SampleBool = SampleBool;
   }
} 
 
[Description("Learn how to Expose a Publis Class List")]
publicclass htcSampleExposePublicList : Indicator
{
#region Variables
   // User defined variables (add any user defined variables below)
   public List<htcSampleExposePublicList_SampleListClass> samplelistclass { 
      get { return samplelistclass; } 
      set { samplelistclass = value; }
   }
 
#endregion
 
   protectedoverridevoid Initialize()
   {
      samplelistclass = new List<htcSampleExposePublicList_SampleListClass>();
      Overlay = false;
   }
   ///<summary>
   /// Called on each bar update event (incoming tick)
   ///</summary>
   protectedoverridevoid OnBarUpdate()
   {
      // Criteria to Clear List
      if (Falling(SMA(20))) 
         samplelistclass.Clear();
 
      // Criteria to Add to List
      if (Rising(SMA(20))) 
         samplelistclass.Add(new htcSampleExposePublicList_SampleListClass(0, SMA(10)[0], "SMA is Rising", true ));
 
   }
#region Properties
// What is the Code to Expose "samplelistclass" to other Indicators and Stratagies?

#endregion
}
 
publicclass test {
   public test() {
      htcSampleExposePublicList test = new htcSampleExposePublicList();
      List<htcSampleExposePublicList_SampleListClass> list = test.samplelistclass;
   }
}
} 
#region NinjaScript generated code. Neither change nor remove.
...
#endregion


Last edited by fluxsmith; July 7th, 2010 at 10:31 AM.
Reply With Quote
 
  #4 (permalink)
Trading for Fun
Here, GA
 
Futures Experience: Intermediate
Platform: Ninja
 
Posts: 146 since Jun 2009
Thanks: 1 given, 72 received

Many thanks fluxsmith. Will give it try after the markets close today.

Reply With Quote
 
  #5 (permalink)
Trading for Fun
Here, GA
 
Futures Experience: Intermediate
Platform: Ninja
 
Posts: 146 since Jun 2009
Thanks: 1 given, 72 received

No luck retrieving the information from the List.

Maybe I am going about this the wrong way. Here is the scenario that I am trying to accomplish:

Lets say that I have Exposed DataSeries, IntSeries, BoolSeries that are passing information to other Indicators. Now these Series are basically Empty or set to a value that indicates they are meaningless on 90% of the bars. Seems like a waste of computer resources to me. Therefore I was trying to use a List and then populate the List only when there exists meaningful information.

As an example think of Stochastics Bullishish Divergence on a 60 Minute Chart.
IntSeries : Initial Low Bar
DataSeries: Initial Low Price
DataSeries: Initial Low Indicator Value
IntSeries : Divergence Count
DataSeries: Divergence Low Price
DataSeries: Divergence Low Indicator Value

Using a bunch of Series I can access the 60 Minute Chart Divergence information on a 5 Minute chart. Price must make a Lower Low while keeping a Higher Stochastics Value off the Initial Low Bar on the 60 Minute Chart to create a Divergence Pattern.

Now I am thinking that is a waste of Series (Computer Resources) when most of the time the values are set to "0". Would I not be better off creating a List and having that List Exposed in a similar manner as any any Exposed Series?

Anyone have any suggestions.

Reply With Quote
 
  #6 (permalink)
Trading Apprentice
alask
 
Futures Experience: Master
Platform: ninja
 
Posts: 7 since Oct 2009
Thanks: 0 given, 5 received

Did you solve this?

hi,

did you ever solve this ?

thanks

Reply With Quote
 
  #7 (permalink)
Trading Apprentice
alask
 
Futures Experience: Master
Platform: ninja
 
Posts: 7 since Oct 2009
Thanks: 0 given, 5 received

Did you sole this?

Hi

did you ever manage to solve this?

thanks

Reply With Quote

Reply



futures io > > > > > Expose Public Class List

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
C# Charting Class/Library Dusty909 Platforms and Indicators 7 December 1st, 2011 07:08 PM
Egypt Protests Expose Rift Between Rich and Poor Quick Summary News and Current Events 0 January 31st, 2011 08:10 AM
Public class, passing values between scripts tinkerz NinjaTrader Programming 2 May 11th, 2010 12:41 PM
NT7 public beta release roonius Traders Hideout 6 April 6th, 2010 12:13 AM
Public site statistics Big Mike Feedback and Announcements 0 January 3rd, 2010 02:50 AM


All times are GMT -4. The time now is 04:14 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-12 in 0.12 seconds with 19 queries on phoenix via your IP 54.163.210.170