Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Calling variables from 1 indicator to another....

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

    Calling variables from 1 indicator to another....

    Hi,
    I have modified the zig zag indicator to find a certain calculation based on the swing differences.

    Now i want to call the result from my modified ZigZag (now name ZIigZagBU)and use it in another indicator and or strategy.


    Below is the code i am using to return the variable to the new indicator, it all compiles fine. However the value is always 0 despite each of the 4 varibles below having values when i add the indicator to the chart..... Am i missing something? Should the indicator automatically be up to the same CurrentBar as the indicator i am calling it from or do i have to add more code to find the same point in time or something?

    Thanks in advance for any help/guidance. :-)



    UpCxn1 = ZigZagBU(DeviationType.Points, zZDeviation1, 10, 1, false, true).Level(true, true);

    Here is the Level function in the "ZigZagBU"

    public double Level (bool UpOrDown, bool CxnOrDD)
    {
    if (UpOrDown == true)
    {
    if (CxnOrDD == true) return UpCxnLinePrice; // return Upward CXN price
    if (CxnOrDD == false) return UpDDLinePrice; // return Upward DD price
    }
    if (UpOrDown == false)
    {
    if (CxnOrDD == true) return DownCxnLinePrice; // return Downward CXN price
    if (CxnOrDD == false) return DownDDLinePrice; // return Downward DD price
    }
    return -1;
    }

    #2
    Marty, please try including a call to Update() as shown here for your exposed public property you wish to access from the other script - http://www.ninjatrader.com/support/f...ead.php?t=4991

    Comment


      #3
      All fixed

      Fantastic! Worked a charm :-) many thanks.

      Comment

      Latest Posts

      Collapse

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