Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
GetCurrentBid(); not working?
Collapse
X
-
Thanks for the script. This is the issue:
dCurrentPrice = GetCurrentBid();
dPrevPrice = GetCurrentBid();
if( dCurrentPrice == dPrevPrice )
return;
You're setting two variables equal to the same value, and stopping code processing with return;
-
OK, here it is. The idea is to show where a sopt might be on the upside and downside as you watch the movement.Attached Files
Leave a comment:
-
I'm not sure why it's not working for you. There's nothing additional to set. Make sure you've compiled all code changes by Right Clicking in editor > Compile. Make sure your script is running the latest version of these code changes by Right Clicking on Chart > Reload NinjaScript.
If it's still not working the way you expect, can you post the complete script here and will take a look?
Leave a comment:
-
PFGBest. And the chart is an 89 tick YM 09-11 which is fluidly showing the price movement.
Leave a comment:
-
What connection are you using for real time data? What is the instrument and interval you're viewing? Is there movement on the chart?
Most June futures contracts recently stopped trading, so make sure you're not using those. If you want to verify real time functionality with your script, you can always use the simulated data feed.
Leave a comment:
-
Interesting... this is now NOT printing my price at all. So why is this live indicator in a live chart show only Historical data?
Why is the code NOT real time? Is there some global value I need to set to tell it to show real time?
Leave a comment:
-
Hi TiggerTrader,
Yes, if accessed in real time with CalculateOnBarClose = false then you'll receive updates with every incoming tick of data. These values are only designed to be used in real time, so when accessed historically it will use Close price instead.
If you want, you can add a filter that only prints these values in real time. It may make the output window easier to follow.
if (!Historical)
{
Print( dCurrentPrice );
Print( GetCurrentAsk() );
}
Leave a comment:
-
GetCurrentBid(); not working?
I've written an indicator to draw some lines based on the current price and I must be missing something obvious. Here's a code snippet:
dCurrentPrice = GetCurrentBid();
Print( dCurrentPrice );
Print( GetCurrentAsk() );
The output window shows :
11826
11826
Every single time regardless of the price on my chart. For example, as I wruite the price is 12106 on YM. Also, only prints those two lines even tho I have CalcOnBarClose=false so it should be looping the pice as it changes, right? Any ideas?
Tags: None
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by SalmaTrader, 07-07-2026, 10:26 PM
|
0 responses
35 views
0 likes
|
Last Post
by SalmaTrader
07-07-2026, 10:26 PM
|
||
|
Started by CarlTrading, 07-05-2026, 01:16 PM
|
0 responses
20 views
0 likes
|
Last Post
by CarlTrading
07-05-2026, 01:16 PM
|
||
|
Started by CaptainJack, 06-17-2026, 10:32 AM
|
0 responses
12 views
0 likes
|
Last Post
by CaptainJack
06-17-2026, 10:32 AM
|
||
|
Started by kinfxhk, 06-17-2026, 04:15 AM
|
0 responses
18 views
0 likes
|
Last Post
by kinfxhk
06-17-2026, 04:15 AM
|
||
|
Started by kinfxhk, 06-17-2026, 04:06 AM
|
0 responses
20 views
0 likes
|
Last Post
by kinfxhk
06-17-2026, 04:06 AM
|

Leave a comment: