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 PaulMohn, Today, 03:49 AM
      0 responses
      7 views
      0 likes
      Last Post PaulMohn  
      Started by inanazsocial, Today, 01:15 AM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by rocketman7, Today, 02:12 AM
      0 responses
      10 views
      0 likes
      Last Post rocketman7  
      Started by dustydbayer, Today, 01:59 AM
      0 responses
      4 views
      0 likes
      Last Post dustydbayer  
      Started by trilliantrader, 04-18-2024, 08:16 AM
      5 responses
      23 views
      0 likes
      Last Post trilliantrader  
      Working...
      X