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!
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
NinjaTrader
GetCurrentBid(); not working?
Collapse
X
-
-
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
-
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
-
-
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
-
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
-
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
-
-
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 dcriador, Today, 12:06 PM
|
0 responses
6 views
0 likes
|
Last Post
by dcriador
Today, 12:06 PM
|
||
Started by dcriador, Today, 12:04 PM
|
0 responses
5 views
0 likes
|
Last Post
by dcriador
Today, 12:04 PM
|
||
Started by cutzpr, Today, 08:54 AM
|
0 responses
11 views
0 likes
|
Last Post
by cutzpr
Today, 08:54 AM
|
||
Started by benmarkal, Today, 08:44 AM
|
0 responses
17 views
0 likes
|
Last Post
by benmarkal
Today, 08:44 AM
|
||
Started by Tin34, Today, 03:30 AM
|
2 responses
29 views
0 likes
|
Last Post
by Tin34
Today, 04:11 AM
|
Comment