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 Mindset, 04-21-2026, 06:46 AM
|
0 responses
44 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
56 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
35 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
95 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
57 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment