NexusFi: Find Your Edge


Home Menu

 





I need help with ... (ask any question)


Discussion in Traders Hideout

Updated
      Top Posters
    1. looks_one bobwest with 153 posts (94 thanks)
    2. looks_two Big Mike with 88 posts (82 thanks)
    3. looks_3 Philip Hutchinson with 10 posts (0 thanks)
    4. looks_4 xplorer with 9 posts (6 thanks)
      Best Posters
    1. looks_one josh with 3.7 thanks per post
    2. looks_two Daytrader999 with 2.5 thanks per post
    3. looks_3 Big Mike with 0.9 thanks per post
    4. looks_4 bobwest with 0.6 thanks per post
    1. trending_up 103,792 views
    2. thumb_up 387 thanks given
    3. group 325 followers
    1. forum 587 posts
    2. attach_file 42 attachments




 
Search this Thread

I need help with ... (ask any question)

  #451 (permalink)
 BeetleBaum 
East Ridge, Tennessee, USA
 
Experience: Master
Platform: TradeStation
Trading: Futures, Stocks, Options, Forex
Posts: 17 since Nov 2022
Thanks Given: 4
Thanks Received: 4

PRICE DENSITY INDEX


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

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
MC PL editor upgrade
MultiCharts
Trade idea based off three indicators.
Traders Hideout
Exit Strategy
NinjaTrader
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
31 thanks
Spoo-nalysis ES e-mini futures S&P 500
28 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
20 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #452 (permalink)
 BeetleBaum 
East Ridge, Tennessee, USA
 
Experience: Master
Platform: TradeStation
Trading: Futures, Stocks, Options, Forex
Posts: 17 since Nov 2022
Thanks Given: 4
Thanks Received: 4

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?...

Input: MinRatio (3.1415927);

Input: TrigSet(4);

Variables: LowPivotPrice1(0), LowPivotBar1(0), HighPivotPrice1(0), HighPivotBar1(0);
Variables: LowLS1(1), LowRS1(TrigSet), HighLS1(1), HighRS1(1);

Value1 = TrigSet - 1;
Value2 = High[Value1];
Value3 = Low[Value1];

// SHORT trade setup conditions

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> }

Condition4 = Pivot(High, 233, HighLS1, HighRS1, 1, 1, HighPivotPrice1, HighPivotBar1) <> -1;
{ High Pivot behind Low Pivot }

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 }


// ***************************************************


Variables: LowPivotPrice2(0), LowPivotBar2(0), HighPivotPrice2(0), HighPivotBar2(0);
Variables: HighLS2(1), HighRS2(TrigSet), LowLS2(1), LowRS2(1);


// LONG trade setup conditions

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> }

Condition12 = Pivot(Low, 233, LowLS2, LowRS2, 1, -1, LowPivotPrice2, LowPivotBar2) <> -1;
{ Low Pivot behind High Pivot }

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 }

Condition17 = (BarNumber[Value1] - BarNumber[HighPivotBar1]) / TrigSet >= MinRatio;

Condition18 = (BarNumber[Value1] - BarNumber[LowPivotBar2]) / TrigSet >= MinRatio;

If Condition17 and LowPivotBar1 = LowRS1 then
begin
PlotPaintBar[TrigSet](High, Low, "Short Trade", Red);
Alert("Short Trade Alert!");
end;

Reply With Quote
  #453 (permalink)
 
bobwest's Avatar
 bobwest 
Western Florida
Site Moderator
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
Frequency: Several times daily
Duration: Minutes
Posts: 8,168 since Jan 2013
Thanks Given: 57,452
Thanks Received: 26,278



BeetleBaum View Post
PRICE DENSITY INDEX


[SIZE="4"][SIZE="3"]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.


BeetleBaum View Post
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?...

Hi @BeetleBaum,

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:



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 ):



(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
Reply With Quote
  #454 (permalink)
 Dave G 
Minneapolis MN USA
 
Experience: Intermediate
Platform: NinjaTrader
Trading: CL
Posts: 14 since May 2012
Thanks Given: 2
Thanks Received: 9

Hi guys,

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.

Thanks,

David

Attached Files
Elite Membership required to download: JeffsCCI.zip
Reply With Quote
  #455 (permalink)
 
bobwest's Avatar
 bobwest 
Western Florida
Site Moderator
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
Frequency: Several times daily
Duration: Minutes
Posts: 8,168 since Jan 2013
Thanks Given: 57,452
Thanks Received: 26,278


Dave G View Post
Hi guys,

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.

Thanks,

David

Hi @Dave G,

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:



Please repost your request in that thread, which is where most coders who are interested in making these conversions are active.

Thanks, and good luck.

Bob.

When one door closes, another opens.
-- Cervantes, Don Quixote
Reply With Quote
  #456 (permalink)
Shaun1906
Dallas, Texas
 
Posts: 2 since Dec 2022
Thanks Given: 7
Thanks Received: 1

Hello, all.

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.

Reply With Quote
  #457 (permalink)
 
bobwest's Avatar
 bobwest 
Western Florida
Site Moderator
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
Frequency: Several times daily
Duration: Minutes
Posts: 8,168 since Jan 2013
Thanks Given: 57,452
Thanks Received: 26,278


Shaun1906 View Post
Hello, all.

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.

Hi @Shaun1906,

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:



Good luck with your trading.

Bob.

When one door closes, another opens.
-- Cervantes, Don Quixote
Reply With Quote
  #458 (permalink)
 golf 
Stone Mountain
 
Experience: Beginner
Platform: ninjatrader, tos,
Broker: td ameritrade
Trading: futures,stocks,options
Posts: 3 since May 2020
Thanks Given: 0
Thanks Received: 0

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

Reply With Quote
  #459 (permalink)
 
UHoser's Avatar
 UHoser 
Springfield, MA
 
Experience: Intermediate
Platform: Ninja, TradeStation
Trading: Futures and Options
Posts: 3 since Dec 2011
Thanks Given: 3
Thanks Received: 0

Hi

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 would be very appreciative of any help

UHoser

Reply With Quote
  #460 (permalink)
 
bobwest's Avatar
 bobwest 
Western Florida
Site Moderator
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
Frequency: Several times daily
Duration: Minutes
Posts: 8,168 since Jan 2013
Thanks Given: 57,452
Thanks Received: 26,278



golf View Post
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

Hi @golf,

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:



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
Reply With Quote




Last Updated on February 22, 2024


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts