spread = Math.Abs(GetCurrentAsk() - GetCurrentBid());
DrawText("Sell Trig" + CurrentBar, "Sell Trigger: " + Instrument.MasterInstrument.Round2TickSize(sellEntryPrice).ToString(), 1, High[1] + 6 * TickSize, Color.Orange);
DrawText("SPread" + CurrentBar, "Spread: " + Instrument.MasterInstrument.Round2TickSize(spread).ToString(), 1, High[1] + 15 * TickSize, Color.Blue);
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Bid/Ask Spread + CurrentBar
Collapse
X
-
Bid/Ask Spread + CurrentBar
Hey guys, quick question. I entered the codeInto my indicator. and The "Sell Trig" works as always, just fine. shows Trig at every Signal. but the "Spread" always Shows 0. How can I show what the Spread was at Every Signal occurence? regardless of Strategy or signal. I just want the Spread to show on CurrentBars.Code:Tags: None
-
Hello ginx10k,
Here is what i am using:
Output window results $EURUSD as source):Code:if (Historical) return; double spread = Math.Abs((GetCurrentAsk() - GetCurrentBid()) / TickSize); Print ("Spread: "+spread +" ticks: "+Instrument.MasterInstrument.Round2TickSize(spread).ToString());
Spread: 3.00000000000189 ticks: 3
Spread: 3.00000000000189 ticks: 3
Spread: 3.00000000000189 ticks: 3
Spread: 3.00000000000189 ticks: 3
Spread: 3.00000000000189 ticks: 3
Spread: 2.000000000002 ticks: 2
Spread: 2.000000000002 ticks: 2
Spread: 2.000000000002 ticks: 2
Spread: 2.000000000002 ticks: 2
Spread: 2.000000000002 ticks: 2
Spread: 2.000000000002 ticks: 2
Spread: 2.000000000002 ticks: 2
Spread: 2.000000000002 ticks: 2
Spread: 3.00000000000189 ticks: 3
Spread: 3.00000000000189 ticks: 3
Spread: 3.00000000000189 ticks: 3
Spread: 3.00000000000189 ticks: 3
Spread: 2.000000000002 ticks: 2
Spread: 3.00000000000189 ticks: 3
Spread: 3.00000000000189 ticks: 3
Spread: 3.00000000000189 ticks: 3
Spread: 3.00000000000189 ticks: 3
Spread: 3.00000000000189 ticks: 3
Spread: 3.00000000000189 ticks: 3
Spread: 3.00000000000189 ticks: 3
Spread: 3.00000000000189 ticks: 3
Spread: 3.00000000000189 ticks: 3
Spread: 3.00000000000189 ticks: 3
Spread: 3.00000000000189 ticks: 3
Comment
-
Hey Paul, I get that also on Output window. but my original post was stating that I want
Meaning I want to see what the Spread was 10 bars ago. 50 bars ago. No matter how far back ago, just on Every Signal occurrence: example: if(EMA(10) > EMA(20) { enterSignal = true; DrawText("SPread" + CurrentBar, "Spread: " + Instrument.MasterInstrument.Round2TickSize(spread) .ToString(), 1, High[1] + 15 * TickSize, Color.Blue);Into my indicator. and The "Sell Trig" works as always, just fine. shows Trig at every Signal. but the "Spread" always Shows 0. How can I show what the Spread was at Every Signal occurence? regardless of Strategy or signal. I just want the Spread to show on CurrentBars.
}
So is it possible to get Historical Spread? that's what I'm after
Comment
-
Hello ginx10k,
You can take the work done with the spread and instead of printing to the output window send it to the chart using DrawTextFixed() method: http://ninjatrader.com/support/helpG...wtextfixed.htm
Comment
-
Here is the reference, with necessary links: http://ninjatrader.com/support/helpG..._ask_serie.htmOriginally posted by ginx10k View PostI don't know how to do that. How can you use bid data series. If it doesn't get stored? I would appreciate if you showed me. Thanks.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
558 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
324 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 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
546 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
547 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment