Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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
-
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
-
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 bortz, 11-06-2023, 08:04 AM
|
47 responses
1,603 views
0 likes
|
Last Post
by aligator
Today, 07:22 PM
|
||
Started by jaybedreamin, Today, 05:56 PM
|
0 responses
8 views
0 likes
|
Last Post
by jaybedreamin
Today, 05:56 PM
|
||
Started by DJ888, 04-16-2024, 06:09 PM
|
6 responses
18 views
0 likes
|
Last Post
by DJ888
Today, 05:12 PM
|
||
Started by Jon17, Today, 04:33 PM
|
0 responses
4 views
0 likes
|
Last Post
by Jon17
Today, 04:33 PM
|
||
Started by Javierw.ok, Today, 04:12 PM
|
0 responses
12 views
0 likes
|
Last Post
by Javierw.ok
Today, 04:12 PM
|
Comment