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 mintos, 04-02-2024, 08:22 PM
      7 responses
      38 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by PaulMohn, 04-24-2024, 03:49 AM
      5 responses
      39 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by claxxical, 05-30-2017, 12:30 PM
      38 responses
      4,480 views
      0 likes
      Last Post alancurry  
      Started by Felix Reichert, 04-26-2024, 02:12 PM
      10 responses
      70 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by lightsun47, Today, 11:37 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_Zachary  
      Working...
      X