Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Common variable between an indicator and a strategy?

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

    #16
    it started out because i was confused at the beginning by unexpected print message [my messages] popping up. i thought maybe for some reason messages were not displayed in the order they were created but rather grouped together by indicator or strategy or whatever. i was flying in the dark. the quick and dirty counter tracking counter would help me help me to understand how the flow actually goes. more generally, i have pursued this only because a 'global' variable can be useful and i got the impression early on in this thread that it could easily be done. I've learned a lot in this dialogue, but at greater time expense than i am comfortable with. i not in this to learn programming, but what is, is. i have rambled on, hope it came out in English.

    Comment


      #17
      Re: "expose the variable as public in the indicator. This must be done using the Properties of the variable.

      all I know is "public int tracectr;"

      how does one alternatively do it using "properties"?

      Comment


        #18
        Originally posted by joemiller View Post
        Re: "expose the variable as public in the indicator. This must be done using the Properties of the variable.

        all I know is "public int tracectr;"

        how does one alternatively do it using "properties"?
        Use the wizard to create a dummy test indicator with one variable of the type that you want to track, then open the indicator for editing and see how the variable that you defined has a private access backing store in the Variables region, and how the public access is exposed in the Properties region. Use the arrangement as an example.

        Comment


          #19
          my strategy now has the two statements
          public
          int GlobalVariable;
          Add(lanceV3(1000));

          I think I properly created the indicator as instructed per the preceding post
          but now doing a 'LanceV3().GlobalVariable++;' in the strategy
          results in error msg 'The name LanceV3 does not exist in the current context'

          what am I doing wrong?

          Comment


            #20
            Originally posted by joemiller View Post
            my strategy now has the two statements
            public
            int GlobalVariable;
            Add(lanceV3(1000));

            I think I properly created the indicator as instructed per the preceding post
            but now doing a 'LanceV3().GlobalVariable++;' in the strategy
            results in error msg 'The name LanceV3 does not exist in the current context'

            what am I doing wrong?
            Off the bat, C# is CaSe SeNsItIvE. lanceV3 is NOT the same as LanceV3.

            Other than that there is a paucity of information on what exactly you are doing. Yes, I have read your descriptions: I am saying that just a little snippet is often not enough to tell why an error exists.

            Also, while I understand that you may have no desire to learn programming, if you are going to write NinjaScript, there is really no alternative. It is just not possible to teach programming using a few snippets of highly specific scenarios: one must needs understand concepts. At this time, it would appear that you may need to bite the bullet and learn the basic concepts first. The NinjaTrader Help file is a good resource, and so is Google.

            Comment


              #21
              many thanks.
              I will press on. you are a great resource - even your sermons.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by habeebft, Today, 07:27 AM
              1 response
              11 views
              0 likes
              Last Post NinjaTrader_ChristopherS  
              Started by AveryFlynn, Today, 04:57 AM
              1 response
              12 views
              0 likes
              Last Post NinjaTrader_Erick  
              Started by Max238, Today, 01:28 AM
              4 responses
              37 views
              0 likes
              Last Post Max238
              by Max238
               
              Started by r68cervera, Today, 05:29 AM
              1 response
              10 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by geddyisodin, Today, 05:20 AM
              1 response
              14 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Working...
              X