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

GetCurrentBid(); not working?

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

    #16
    No error, just stops printing the current price and prints a garbage price once.

    Comment


      #17
      Originally posted by TiggerTrader View Post
      No error, just stops printing the current price and prints a garbage price once.
      We must be talking about different indicators. I downloaded the StopTest.cs file that you posted. I did not see any GetCurrentBid() call in there. The file that I downloaded MUST be creating an error in your log. Have you looked at the Log tab in the Control Center, for the last exact time that you tried to load the indicator (StopTest.cs)?

      Comment


        #18
        oops... wrong file. Here it is. When you comment out the DrawRay, the correct price gets printed as the price changes. When you put it back, bad price only once.
        Attached Files

        Comment


          #19
          Originally posted by TiggerTrader View Post
          oops... wrong file. Here it is. When you comment out the DrawRay, the correct price gets printed as the price changes. When you put it back, bad price only once.
          Except for using variables to hold some more of the parameters, I do not see a difference between this last file and the StopTest.cs file. I still cannot see any GetCurrentBid() in the StopLinesJPW.cs file. On what line is the statement?

          As the file is no different, I am still expecting you to look in the log and tell me the error that you see there. There MUST be one. Again, have you looked at the Log tab in the Control Center, for the last exact time that you tried to load the indicator
          Last edited by koganam; 06-22-2011, 08:50 AM.

          Comment


            #20
            TiggerTrader,

            The ray draws as far as 20 bars back, which causes issues for the first 20 bars in the series. This type of error can usually be seen in log tab of control center, and is explained in more detail here.

            To resolve, use this line to prevent processing for the first few bars:
            if (CurrentBar < 20) return;

            There is also a separate RemoveDrawObject line. This is not needed if you only want to replace the drawing object. If the tag stays the same the draw object is replaced to use the most recent values. RemoveDrawObject is used only if you want to remove it completely.
            Ryan M.NinjaTrader Customer Service

            Comment


              #21
              line 48: Print( GetCurrentAsk() );

              Comment


                #22
                Originally posted by TiggerTrader View Post
                line 48: Print( GetCurrentAsk() );
                Now I am confused. At 1924EDT today you wrote: "... No effect. Also, doing just that 1 change BROKE GetCurrentBid." I ask about that and you show me a line that talks about GetCurrentAsk(). Are we talking about the same things here?

                Comment


                  #23
                  This originally started as a way to draw a line above and below the current price to represent potential stop points for a trade. They would move up and down with the current price. It didn't work so I try to "debug" by printing the current price. At that time "GetCurrentBid()" showed an odd number like 11877 even tho the current price was 12121 on the YM 89 tick chart I am using. I comment out the DrawRay line and then the GetCurrentBid() prints out the current price correctly as it changes. Whereas when DrawRay is in the compile, GetCurrentBid() only prints 11877 once and nothing else.

                  Does that clear it up?

                  P.S. Thanks for your help so far, I appreciate it.

                  Comment


                    #24
                    Originally posted by TiggerTrader View Post
                    This originally started as a way to draw a line above and below the current price to represent potential stop points for a trade. They would move up and down with the current price. It didn't work so I try to "debug" by printing the current price. At that time "GetCurrentBid()" showed an odd number like 11877 even tho the current price was 12121 on the YM 89 tick chart I am using. I comment out the DrawRay line and then the GetCurrentBid() prints out the current price correctly as it changes. Whereas when DrawRay is in the compile, GetCurrentBid() only prints 11877 once and nothing else.

                    Does that clear it up?

                    P.S. Thanks for your help so far, I appreciate it.
                    Not for me it does not. GetCurrentBid() is not the same thing as GetCurrentAsk(). You keep writing about GetCurrentBid(), and when I ask about it, you respond with some statement about GetCurrentAsk().

                    Comment


                      #25
                      Ooops... sorry again. I've tried both. You pick, situation for Ask is also borken. You can use either. When DrawRay is commented out, you get a stream of current prices happening. When you compile it in, only 11877 once.

                      Comment


                        #26
                        Originally posted by TiggerTrader View Post
                        Ooops... sorry again. I've tried both. You pick, situation for Ask is also borken. You can use either. When DrawRay is commented out, you get a stream of current prices happening. When you compile it in, only 11877 once.
                        Now, that we have cleared that up, please go and look in the Log tab of the Control Center and tell me what the log says about the situation. I have been asking for more than 3 hours now. Is there any particular reason why you prefer not to look where I am requesting you to look?

                        Comment


                          #27
                          The Log tab shows only my trade activity, no errors or warnings of any kind.

                          Comment


                            #28
                            Originally posted by TiggerTrader View Post
                            The Log tab shows only my trade activity, no errors or warnings of any kind.
                            That is not possible. Please note the time, refresh the chart to reload the indicator, then look in the log for the entries that match the EXACT time that you loaded the indicator. There is a lot of information in the log, so you have to look for what is there by matching the times that the problem may have occurred.

                            Comment


                              #29
                              Here is the export of the log. I closed a position at 11:51:56, you see the entry. I cleared the output window. I Refreshed the indicator. The ouput window shows 1 entry of 11877. And this is the log, no error. It is an Excel CSV saved as TXT.

                              This is a simple script. I would think anyone could load it and try it and see the same results. Try it if you like.
                              Attached Files

                              Comment


                                #30
                                Your log does not show that much activity. Make sure you aren't filtering categories in the log tab. Right Click > Filter by category > Check all these.
                                Ryan M.NinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by dcriador, Today, 12:06 PM
                                0 responses
                                6 views
                                0 likes
                                Last Post dcriador  
                                Started by dcriador, Today, 12:04 PM
                                0 responses
                                5 views
                                0 likes
                                Last Post dcriador  
                                Started by cutzpr, Today, 08:54 AM
                                0 responses
                                11 views
                                0 likes
                                Last Post cutzpr
                                by cutzpr
                                 
                                Started by benmarkal, Today, 08:44 AM
                                0 responses
                                17 views
                                0 likes
                                Last Post benmarkal  
                                Started by Tin34, Today, 03:30 AM
                                2 responses
                                29 views
                                0 likes
                                Last Post Tin34
                                by Tin34
                                 
                                Working...
                                X