Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Determine input price type
Collapse
X
-
Hello digibob,
Thanks for your patience.
Here is something you can work with:
Code:if (CurrentBar == 0) { Print ("price Type is:"); if (Input[0] == Median[0]) Print ("Median"); else if (Input[0] == Typical[0]) Print ("Typical"); else if (Input[0] == Weighted[0]) Print ("Weighted"); else if (Input[0] == High[0]) Print ("High"); else if (Input[0] == Low[0]) Print ("Low"); else if (Input[0] == Open[0]) Print ("Open"); else Print ("Close"); }
I'm checking to see if there isn't a more elegant solution and if I find anything I will update this thread.
Comment
-
Hi Paul. Thanks for the suggestion. It would work as long as no two are the same. If the Close equals the High for example, it may fail.
I take it there's no built in property or method such as InputPriceType, .GetName, something like that.
Well, thanks anyway.
Comment
-
Remove the "else" clauses. Every possibility will then be tested.Originally posted by digibob View PostHi Paul. Thanks for the suggestion. It would work as long as no two are the same. If the Close equals the High for example, it may fail.
I take it there's no built in property or method such as InputPriceType, .GetName, something like that.
Well, thanks anyway.
- Likes 1
Comment
-
Thanks guys.
Removing the 'else' will not prevent a wrong call when two types are same value.
I added a custom 'price type' enum property that has to be set alongside the actual price type. It's not more elegant than Paul's suggestion but it works for now.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
579 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
334 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
554 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment