Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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
    BertrandNinjaTrader Customer Service

    Comment


      #3
      All fixed

      Fantastic! Worked a charm :-) many thanks.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by benmarkal, Yesterday, 12:52 PM
      3 responses
      22 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by helpwanted, Today, 03:06 AM
      1 response
      17 views
      0 likes
      Last Post sarafuenonly123  
      Started by Brevo, Today, 01:45 AM
      0 responses
      11 views
      0 likes
      Last Post Brevo
      by Brevo
       
      Started by aussugardefender, Today, 01:07 AM
      0 responses
      6 views
      0 likes
      Last Post aussugardefender  
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      244 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Working...
      X