Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Where to put your helper class

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Where to put your helper class

    Assume I have quite some just generic C# help classes shared among indicators and strategies. Where do you put them to avoid duplicate copies with maintenance nightmare?

    A related question is, how can one make use of all the nice features in C#??

    For example I have a helper class called waveState that's something like :

    PHP Code:
     public class WaveST
            {
                public Pt P1, P2, P3, P4, P5;
                public Boolean bull;
                public Boolean meaty;
                public List<Pt> Bumps;
                public Cwave cw;
                public Boolean inLTF;
    
                public void Draw(int cr, Boolean e, Color c) ... 
    
    I can't even reference DrawLine in this code without causing something like 'can't reference outer class etc etc.

    So how shall one go about solving this type of issues, and how would you implement really useful helper classes without stuffing everything into userdefinemethods?

    #2
    balancenv, unfortunately what we could support here is working with the UserDefinedMethods options available (split per strategy and indicators). I leave this open so the community could chime in with their thoughts.

    Comment


      #3
      Originally posted by balancenv View Post
      Assume I have quite some just generic C# help classes shared among indicators and strategies. Where do you put them to avoid duplicate copies with maintenance nightmare?

      A related question is, how can one make use of all the nice features in C#??

      For example I have a helper class called waveState that's something like :

      PHP Code:
       public class WaveST
              {
                  public Pt P1, P2, P3, P4, P5;
                  public Boolean bull;
                  public Boolean meaty;
                  public List<Pt> Bumps;
                  public Cwave cw;
                  public Boolean inLTF;
       
                  public void Draw(int cr, Boolean e, Color c) ... 
      
      I can't even reference DrawLine in this code without causing something like 'can't reference outer class etc etc.

      So how shall one go about solving this type of issues, and how would you implement really useful helper classes without stuffing everything into userdefinemethods?
      If you want to use NT Indicator methods in your helper class, then make the class inherit from the Indicator class.

      Otherwise, make it a partial class of Indicator.

      Comment


        #4
        Thanks for the note. But I can't do that because there'll be thousands of instances of those wave state objects and indicator is just too heavy to carry...

        I figure out a solution is to include the indicator as a data member in these helper class to gain access its methods.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        649 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        370 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        109 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        573 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        576 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X