♥ 1 |
Hi. Again thanks a lot for your support. I believe this Study can help a lot of traders to set realistic expectations for Intraday movement. I got a Study that calculates ADR (AvgDailyRange) from past (x) days and then plots a line (I made it a band) from the OPEN. This band remains fixed all day. It’s an initial estimate of the potential move of the stock based on avg range. Attached ADR.jpg. Great to define reasonable intraday targets. The BEST use though is to consider the Low of Day and High of Day at each bar, instead of off the Open. If I replace “Open” with “Low” or “High” the plots adjust accordingly BUT they plot the same horizontal line adjusting to last value. First Question: ¿Is there a way to get the bands plot each bar (vs a horizontal band updating based on last/new values)?. Attached ADR Example NT.jpg, as I used to have this on Ninja Trader many years ago. So bands would be dynamic each bar : Target_ADR_High =Low[0] + ADR // Target_ADR_Low = High[0] – ADR The second request is more simple, even if the first one is not feasible. Study had an Input: “Show Only Last Period: yes”, to avoid plotting on previous days, but it’s missing the rest of the code. And I can’t get around it to use an IF THEN statement to filter this. Below the code, which I tried to show as neat as possible as per your suggestions before. Hope you can teach us how to solve this. THANKS !!! input aggregationPeriod = AggregationPeriod.DAY; # Defines de period in which the study will plot to avoid showing during extended session # (1) Define Current Day’s Range, (2) AverageDailyRange for 14 days, (3) Actual % Range for the dayRange (1 / 2) #Plots Value CALCULATED from the OPEN as a FIXED Level throughout the day #Format the level as a “BAND” with a 0,1% size Target_ADR_High.SetDefaultColor(Color.GREEN); #Plots Labels on Chart with Color Coding RESOLVED
Marked as spam
|
Private answer
Thanks for posting this. However I believe this will take quite a bit more time than I permit for providing free solutions in the Q&A forum. So about all I have time for is to offer some suggestions. I'm not sure if I understand the first question. You seem to be asking how to get these horizontal lines to be adjusted based on the current high of day and low of day. I believe your code already contains this information and you only need to plug that into your mathematical computations to achieve this. As for the second request, you can see how I accomplished this in the code provided with the following video: https://www.hahn-tech.com/thinkorswim-alert-high-low-version-two/ Perhaps that will give you an idea how to incorporate this into your code. Marked as spam
|
|||||||||
Private answer
So as this was adapted from a free public ADR Study I got and I managed to modify it as I needed with the help of Pete, I am sharing the final code, together with a basic explanation of features and how it works attached. Hope you enjoy. You can send your comments to [email protected] / @gtichauer (Tweeter). PS: If someone gets to improve/optimize the code pls let me know. GT Marked as spam
|
Please log in to post questions.