Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
GetCurrentBid(); not working?
Collapse
X
-
-
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)?Originally posted by TiggerTrader View PostNo error, just stops printing the current price and prints a garbage price once.
Comment
-
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
-
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?Originally posted by TiggerTrader View Postoops... 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.
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 indicatorLast edited by koganam; 06-22-2011, 08:50 AM.
Comment
-
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
-
-
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?Originally posted by TiggerTrader View Postline 48: Print( GetCurrentAsk() );
Comment
-
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
-
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().Originally posted by TiggerTrader View PostThis 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
-
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
-
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?Originally posted by TiggerTrader View PostOoops... 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
-
-
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.Originally posted by TiggerTrader View PostThe Log tab shows only my trade activity, no errors or warnings of any kind.
Comment
-
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.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
606 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
351 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
560 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
561 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment