The price channel study that is already in TOS I’m wanting to add arrows for entry for either a long or short.
I’ve changed the default length from 20 to 21. This is irrelevant on how many days you choose but for this example and code, I’m using the 21.
I’m looking to add a red arrow when the high bar of the channel is broke down below. When a candle (depending on time frame, this example is a Daily) closes below the low of the high bar of the channel.
I’m looking to add a green arrow when the high of the low bar is broke above.
The attached photo shows the arrows where this example would be met. I’ve added white lines to show the low/high of the bars I’m talking about. I hope I explained this properly
Marked as spam
How about the second to the last bar on your screenshot? is that a valid "close below the low of the high bar"? The price channel made a lower high there. So I'm not sure if you intend that to be a valid signal. There are hidden complexities here and I'm not sure I'll be able to complete a solution for this within the time I allow for free assistance in the Q&A Forum.
Yes, the bar you referenced would've been a short signal as well. I've started on the arrows. Just need to define everything. input displace = 0; input length = 21; plot LowerBand = Lowest(low[-displace + 1], length); LowerBand.SetDefaultColor(GetColor(1)); plot UpperBand = Highest(high[-displace + 1], length); UpperBand.SetDefaultColor(GetColor(1)); #def LongTrigger; #def ShortTrigger; #plot LongTrigger = #plot ShortTrigger = #LongTrigger.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP); #LongTrigger.SetLineWeight(3); #LongTrigger.SetDefaultColor(Color.GREEN); #LongTrigger.HideBubble(); #LongTrigger.HideTitle(); #ShortTrigger.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN); #ShortTrigger.SetLineWeight(3); #ShortTrigger.SetDefaultColor(Color.RED); #ShortTrigger.HideBubble(); #ShortTrigger.HideTitle();
Please log in to post questions.