Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Can someone code the following measure of congestion at each price level on a chart? Only certain ones above an input set threshold would be displayed.
The idea is to look back from the current price to all levels above and below to calculate how many bars behind the current bar contain a price matching the given price.
(Close <= the high and Close >= the low of each given bar)
The first match, no matter how far back it is, begins the count at 1. From there, each bar back to the first one loaded on the chart is checked for a match to the given price. You add up the bars checked from the first match back to the beginning of the chart.
And one bar at a time, it will calculate the following formula for each price level one tick apart:
(Bar Matches / Bars Checked) * Bar Matches = PDI
Once this is calculated with each bar in regression, the maximum value out from all bars checked and calculated one at a time for that given price level is recorded as pertaining to that level.
As an example, 5 bars in a row to start the count would equal a running PDI of 5. If the next two bars checked did not match, then two more then did, it would be a total of 7 matches out of 9 checked. This would yield a PDI of (7 / 9) * 7 or 5.44. I have attached a chart for a visual example on a limited number of bars.
The idea is to compare this number at each level in both favorable and adverse movement to the Thrust Factor of a pattern traded to determine an exit point with a MIT order wherever the PDI is bigger than the Thrust Factor (TBD).
Any questions please post...thanks in advance!
Matt Thomas PDI Illustration
Can you help answer these questions from other members on NexusFi?
QUESTION: Why does the following code used to detect and plot a PaintBar for certain specified Pivots fail in giving the error that it cannot reference historical data into the future?...
Condition1 = Low < Lowest(Low, Value1)[1]; { Active or pertinent Low breaks below the Low Pivot to be called the Trigger Point at 1 tick below that Trigger Pivot }
Condition2 = Value2 >= Highest(High, Value1);
{ High for the Trigger Set is the Trigger Set Extreme at its first bar (subsequent ties allowed) }
Condition3 = Pivot(Low, 233, LowLS1, Trigset, 1, -1, LowPivotPrice1, LowPivotBar1) <> -1;
{ Low Pivot with a minimum Right Strength of <Trigger Set> }
Condition5 = High[Value1] > HighPivotPrice1;
{ High Pivot must be less than the Trigger Set Extreme High }
Condition6 = Open[Value1] >= Low[LowPivotBar1] or High[Value1] >= Low[LowPivotBar1];
{ Prevents gaps from causing unwanted entry points too far from the Trigger Point if not filled on that bar by the eventual High for that bar }
Condition7 = BarNumber[LowPivotBar1] > BarNumber[HighPivotBar1];
{ High Pivot must occur first }
{ Not sure how to disregard any High Pivots occurring within the Trigger Set that would usurp the 1st instance of a High Pivot that must occur behind the Trigger pivot }
Value4 = Value2 - LowPivotPrice1;
{ Distance from the Trigger Set Extreme to the Low Pivot (Trigger Pivot) called the Standard Profit Projection (SPP) to be later used for stop placements }
Value5 = HighPivotPrice1 - LowPivotPrice1;
{ Height of the bars prior to the Trigger Set back to the High Pivot }
Condition8 = Value2 - HighPivotPrice1 <= Value5;
{ Disallows any overly long "tail" in the Trigger Set that would cause a lopsided pattern }
Condition9 = High > Highest(High, Value1)[1]; { Active or pertinent High breaks above
the High Pivot to be called the Trigger Point at 1 tick above that Trigger Pivot }
Condition10 = Value3 <= Lowest(Low, Value1);
{ Low for the Trigger Set is the Trigger Set Extreme at its first bar
(subsequent ties allowed) }
Condition11 = Pivot(High, 233, HighLS2, HighRS2, 1, 1, HighPivotPrice2, HighPivotBar2) <> -1;
{ High Pivot with a minimum Right Strength of <Trigger Set> }
Condition13 = Low[Value1] < LowPivotPrice2;
{ Low Pivot must be greater than the Trigger Set Extreme Low }
Condition14 = Open[Value1] <= High[HighPivotBar2] or Low[Value1] <= High[HighPivotBar2];
{ Prevents gaps from causing unwanted entry points too far from the Trigger Point if
not filled on that bar by the eventual Low for that bar }
Condition15 = BarNumber[HighPivotBar2] > BarNumber[LowPivotBar2];
{ Low Pivot must occur first }
{ Not sure how to disregard any Low Pivots occurring within the Trigger Set that
would usurp the 1st instance of a Low Pivot that must occur behind the Trigger Pivot }
Value6 = HighPivotPrice2 - Value3;
{ Distance from the Trigger Set Extreme to the Low Pivot (Trigger Pivot) called the
Standard Profit Projection (SPP) to be later used for stop placements }
Value7 = HighPivotPrice2 - LowPivotPrice2;
{ Height of the bars prior to the Trigger Set back to the High Pivot }
Condition16 = HighPivotPrice2 - Value3 <= Value7;
{ Disallows any overly long "tail" in the Trigger Set that would cause a lopsided pattern }
Thanks for posing these questions. Although this thread is named "I need help with ... (ask any question)", it is actually more a jumping-off point for someone who isn't sure where to post a question. Anything posted here, when someone clicks on the "Ask your first question" link, is read by a moderator who figures out the best location in the forum for it, based on the subject-matter, and then copies it out to a new thread in that location. The idea is that this will make it more visible to other members who share an interest in the topic, and that it will make it more likely to attract an interest, and of course, an answer. It's meant as sort of a way to introduce someone to the idea of making posts in relevant areas of the forum, so that they will do that for their next post, after getting their feet wet with this one.
In this case, you have EasyLanguage questions, so I have created a new thread in the "EasyLanguage Programming" section for both your questions. You can normally find this section from the main page of the forum by following the links from "Platforms and Indicators" to "EasyLanguage Programming."
You can access the new thread by clicking this box. Both your questions are now there:
Can someone code the following measure of congestion at each price level on a chart? Only certain ones above an input set threshold would be displayed.
The idea is to look back from the current price to all …
I hope that you will receive a quick reply to the questions, allowing for the holiday break.
In the future, it is best if you do not use the "Ask your first question" for additional questions. It is best, once someone has gotten the hang of things, to just go on your own to a location that, from its title, seems to be relevant to your question (usually it will be.) If you aren't sure where it should go, you can always just use the fairly generic "Traders Hideout."
If you're not sure how to post in a particular location, you can give this post a look and it may clear things up (or, just send me a DM ):
No problem. First you decide where you want the thread to be located. In this case, "where" means, "in what forum or subforum" -- forums/subforums are set up to deal with related matters so that people can know where to look for something.
How …
(Also Just from a stylistic viewpoint, I would appreciate your not using extra-large or bold fonts so much in the future. Just the normal forum font will work fine, and the huge text does not emphasize it or make it more likely that it will be read. It might even put some people off, actually.)
Good luck, and I hope you get useful responses to your questions.
Bob.
When one door closes, another opens.
-- Cervantes, Don Quixote
I am wondering if any of you generous coders would be willing to convert this JeffsCCI from NT7 to NT8? I believe I have the correct version uploaded.
I would like the 4 histogram color version converted. It would be greatly appreciated.
This is not the best place to make this request. Since you are an Elite member, you can use the thread in the Elite section for NT7 to NT8 conversions, which you can access here:
I'm new at trading. I've been on sim for a couple of months. I have NT8, and currently use Level 1 data. I'd like to know what the difference is between Level 1 data & Level 2 data, and whether or not I should (or need) L2?
If anyone can help me with this, I would greatly appreciate it.
Thank you.
I have opened a new thread in the NinjaTrader section for your question. Most of the traders who use Ninja probably will be looking in that section, and this will improve your chances of getting a reply. Just so you know, in the future, you can use the list of main topics and sections on the front page of the site to select a location that is specific to your needs.
You can access the new thread by clicking on this box:
I'm new at trading. I've been on sim for a couple of months. I have NT8, and currently use Level 1 data. I'd like to know what the difference is between Level 1 data & Level 2 data, and whether or not I should (or need) L2? …
Good luck with your trading.
Bob.
When one door closes, another opens.
-- Cervantes, Don Quixote
I have TOS. Thinkorswim I'm seeking good (Thinkscripts) **indicators showing stocks at 20MA and going to 50MA. I would appreciate any direction. Or better. If there's a fee just let me just let me know.
I am looking for a little help, writing code for a TradeStation indicator might be above my pay grade and was wondering if someone, who is more knowledgeable with making a possible minor adjustment or two, to the standard TradeStation MACD and the RSI indicators and would be able to help out.
What I would like to have as an additional input setting, that I would have the ability to change the color of each line, in each indicator, the MACD line and the RSI line, so that whenever it crossed their specific zero line, either from above or from below, that I would have the ability to select a different color for either line on a cross?
If possible, a second input option, would be to change the color the chart background or by plotting a vertical line on the chart, whenever there was a cross that occurred. Also if the chart background would be easier, then I might need the ability to change to the color intensity as well
As an example, when crossing from above and after closing below the zero line, going from say a green to a red color and crossing and closing back above from below, going from a red to a green color line.
I have created a new thread for your question in the TOS section, and have copied your post there. This may increase the chance that it will be seen by a TOS programmer who will be able to give you a hand.
You can access the new thread by clicking on this box:
I have TOS. Thinkorswim I'm seeking good (Thinkscripts) **indicators showing stocks at 20MA and going to 50MA. I would appreciate any direction. Or better. If there's a fee just let me just let me know.
Thanks,
Brad
Any replies will appear there, after your post.
I hope this will give your issue visibility and will lead to getting a solution.
Bob.
When one door closes, another opens.
-- Cervantes, Don Quixote