Hi Team,
- Anyway I can code the price to buy only if the price reach at the open of bearish candle when condition is met…as of now SELL trade gets opened when condition is met and candle is down , I need that price to retrace to open or therebaouts instead of opening straightaway…on Dow Jones these 5 mins candles are sometimes 100+ points 🙂 I’d rather wait for price to retrace near open etc?
- Is there a way to code and point to a specific candle in last few bars..i.e. condition met for a bearish candle 5 or 7 bars ago..price went down as expected and now traced higher than bearish candle thus signalling a reversal…I trade manually since I do not know how to code that…vice versa for Bullish candle...?
Appreciate your help on this..
Please see attached PIC for example I have colour coded, it took 8 candles for the price to revert…I want someway to track this last candle when condition was met, in this scenario pink/magenta candle – so when price breaks above this candle, we go long!!
vice versa for short if blue breaks..
Please see attached PIC for example I have colour coded, it took 8 candles for the price to revert…I want someway to track this last candle when condition was met, in this scenario pink/magenta candle – so when price breaks above this candle, we go long!!
vice versa for short if blue breaks..
Any help please, not sure if it’s possible to have a for loop and track last candle that meets the condition?
Please don’t quote any of your message for each of your reply.
To check if the close of the current candle breaks one of the candlestick Close X bars ago (from minCandles to maxCandles) and with a retracement > minPoints, use the below code:
mincandles = 3
maxcandles = 20
minPoints = 20
for i = mincandles to maxcandles
if close>close[i] and close[1]<close[i] and min(close,close[i])-lowest[max(1,i)](low)>minPoints*pointsize then
drawarrowup(barindex,low) coloured("green")
drawsegment(barindex,min(close,close[i]),barindex[i],min(close,close[i])) style(dottedline2)
break
endif
next
return
Hi Nicolas, apologies for duplication via quoting. Thank you for your response, appreciate it. Let me try and revert on the results.
Hi Nicolas,
My condition is simple: c1=close>high[1]
All I want is in a loop is when candle goes below , when this condition was met, an arrow should be drawn or segment as you kindly put in the code already.
I have tried but unable to get the result I expect. Would appreciate your help.
Sorry, goes below c1 (condition) i.e. c1=close>high[1]
So c1 occurred 8 or 10 candles ago , and price was consolidating or going higher, now close is going below c1 after 8-10 candles…I need the arrow/segment at this point please.
I still don’t get it sorry.
Could you just take a chart and show me the pattern by a simple drawing please?
Hi Nicolas, sure, and many thanks for your assistance.
Please see the attached chart, I have tried to explain in a simple possible way according to my brain, hope it’s the same message coming across to you as well .
If you actually observe, there are 2 times candle closed below c1 condition. I have only highlighted last 1 for better visibility. it could be 4 candles or 8 when candle closed below c1.
this version plots c1 conditions tested and the arrow on the candle that close below the Open of the c1 candle.
minCandles = 3
c1 = close>high[1]
if c1 then
trigger=open
bar=barindex
drawtext("c1",barindex,high)
endif
if barindex-bar>=minCandles and close crosses under trigger and trigger>0 then
drawarrowdown(barindex,high) coloured("red")
trigger=0
endif
return
minCandles = 3 c1 = close>high[1] if c1 then trigger=open bar=barindex drawtext(“c1”,barindex,high) endif if barindex-bar>=minCandles and close crosses under trigger and trigger>0 then drawarrowdown(barindex,high) coloured(“red”) trigger=0 endif return
Hi Nicolas, many many thanks for your help, much appreciate it! All works as expected, finally!