Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Help with simple price based indicator from Larry Williams
Collapse
X
-
Help with simple price based indicator from Larry Williams
Attended a webinar from Larry Williams and he gave out code for Tommy Gun entry. Could someone please help me with this, i am not a programmer. The attachment explains it and has formula. would be neat if arrow or colored bar identifies setup. thank you.Tags: None
-
Looking for symmetry, are you sure that your condition2 should not be:Originally posted by forrest View PostAttended a webinar from Larry Williams and he gave out code for Tommy Gun entry. Could someone please help me with this, i am not a programmer. The attachment explains it and has formula. would be neat if arrow or colored bar identifies setup. thank you.
TrueHigh - Close < TrueHigh.1 - Close.1 ?
Comment
-
Hm. Maybe you should find out from the presenter what the short setup should be? The close will always be less than or equal to the TrueHigh, so that first condition will be handling negative numbers if used as written. While not a code breaker, it seems to be a logic breaker. Once that is settled, I may be able to post some short-side code.Originally posted by forrest View PostI assume it is a long and short entry. Short entry would be the inverse so i think this would be it:
close - true high > Close.1 - true high.1
and
true low - close < true low.1 - close.1
and
(close>close.1 AND Close.1> Close.2)
In the meantime, here is the code for what you wrote.
Code:protected override void Initialize() { Overlay = true; DrawOnPricePanel = false; BarsRequired = 3; }Code:protected override void OnBarUpdate() { if (CurrentBar < 2) return; bool Cond1 = Close[0] - Math.Min(Close[1], Low[0]) > Close[1] - Math.Min(Close[2], Low[1]); // bool Cond2 = Math.Max(Close[1], High[0]) - Close[0] < Math.Max(Close[2], High[1]) - Close[0]; bool Cond2 = Math.Max(Close[1], High[0]) - Close[0] < Math.Max(Close[2], High[1]) - Close[1]; bool Cond3 = Close[0] < Close[1]; bool Cond4 = Close[1] < Close[2]; if (Cond1 && Cond2 && Cond3 && Cond4) DrawArrowUp("Long_" + CurrentBar.ToString(), false, 0, Low[0] - 10 * TickSize, Color.Green); }
Comment
-
Thank you Koganam
Thanks K, you are exactly right I am sorry was not thinking about the negative values. I corrected the below. I apologize. I understood the logic as comparing( in the case of a short) the upper wicks (sellers = true high less close) where as you want the current bar to have a larger value than the previous bar. AND the buyers shown on each bar being the lower wicks (close less true low). so you would want the current lower wick to have a value less than previous bar.
corrected below:
true high - close > true high.1 - close.1
and
close - true low < close.1 - true low.1
and
(close>close.1 AND Close.1> Close.2)
I appreciate what you have done.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
133 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
75 views
1 like
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
117 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
113 views
1 like
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
90 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment