♥ 0 |
Hello Pete, I was working on some code from learning from some of your past posts. However, I am lost when it comes to plotting an arrow when the following condition below in bold is met. Can you use the solution below and show us how to plot an arrow under the candle that triggers this condition.
. Best
def Pre = if SecondsFromTime(100) > 0 and #vOLUMEfromopentODAY #forecast 50% #Once VF50% IS GREEN ^^ THEN draw a green big upwards arrow at low of the current candle only in which this event was triggered
Marked as spam
|
Private answer
In the comments section above, the author of the post changed the request to plot text instead of an up arrow. The title of the question has been updated to reflect that change. The solution to this request is found in this line of code from the chart study provided in the request:
From this we just need to grab the if/then/else statement that dynamically sets the color of the label:
We only need the true/false condition from this snippet (remove the word 'if' from that line). Then we simply assign that to a new variable statement. Which we add at the very bottom of the code you provided:
This variable will be true for every bar after the condition is true. If we used just use that signal for our chart bubble it would plot a chart bubble on every candle of the chart after the signal is true. So we just need to capture the very first bar where the condition is true. We do this by forming a statement that checks if the previous bar on the chart is false and the current bar on the chart is true:
Don't add that to the code. I just wanted to show what that looks like before adding it to the chart bubble statement. As follows:
Full details about how to apply the chart bubble here: https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddChartBubble.html Now that I have explained everything step-by-step. Here are the two lines of code you will add to the bottom of the chart study provided in the request above:
Marked as spam
|
Please log in to post questions.