Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Refrencing Bar Pattern

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

    Refrencing Bar Pattern

    How would I create a pattern that can be referrenced. For example I define a Doji bar and then be able to reference it has Doji[1] = true for one bar back or Doji[5] =1 for 5 bars back.

    I have

    #region Variables
    private DataSeries myEMA, upperBand, lowerBand, doji;


    protected override void Initialize()
    doji = new DataSeries(this);

    protected override void OnBarUpdate()
    Doji.Set=
    Open[0] == Close[0]
    && High[0] > Open[0]
    && Low[0] < Open[0];

    I keep getting an error, "Can't assign to Set because it is a Method Group"

    How would I do this so that if it is true, i get a value of 1 i.e. true ?

    #2
    Originally posted by velocity View Post
    How would I create a pattern that can be referrenced. For example I define a Doji bar and then be able to reference it has Doji[1] = true for one bar back or Doji[5] =1 for 5 bars back.

    I have

    #region Variables
    private DataSeries myEMA, upperBand, lowerBand, doji;


    protected override void Initialize()
    doji = new DataSeries(this);

    protected override void OnBarUpdate()
    Doji.Set=
    Open[0] == Close[0]
    && High[0] > Open[0]
    && Low[0] < Open[0];

    I keep getting an error, "Can't assign to Set because it is a Method Group"

    How would I do this so that if it is true, i get a value of 1 i.e. true ?
    1. DataSeries must contain double values.
    2. you might want to use boolseries.

    #region Variables
    private BoolSeries doji;


    protected override void Initialize()
    doji = new BoolSeries(this);

    protected override void OnBarUpdate()
    doji.Set(Open[0] == Close[0] && High[0] > Open[0] && Low[0] < Open[0]);

    Comment


      #3
      Thanks for your help roonius!

      Here's a link to the BoolSeries Class - http://www.ninjatrader-support.com/H...riesClass.html

      Comment


        #4
        roonius,

        Thanks for all the help. I will give it a try. and thanks for the post Bertrand.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        164 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        318 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        246 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        350 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        179 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X