hy
How i define third candle of the day in 15 min chart,,
Thanks
Sarath
hy
How i define third candle of the day in 15 min chart,,
Thanks
Sarath
Look for BarSince function in help, you will also need function Day() to find out when day change.
@sarathlal I am not an expert and I suspect there are better ways to define the 3rd bar of the day, but this code seems to function well.
Oops, I just noticed the hint from @awilson and so I came up with a second method that seems to identify the same bar (let's call it ThirdBarB for method B)
dn = Day();
bi = BarIndex();
newDay = dn != Ref( dn, -1 ); // first bar of new day
ThirdBar = ValueWhen( newday, bi ) == Ref( bi, -2 ); // 3rd bar of the day
ThirdBarB = BarsSince(newDay)==2; // 3rd bar of the day is 2 bars after the first bar of the day
The first method shows the white circle and the second method shows the green circle with the number 3
I have spared you (and the forum) my customary bloated Exploration for debugging.
Thankyou sir,
sir one more doubt how i plot third cndle high and low ..please help
Thankyou sir....
thanks for the quick reply...thanks a lot
Thanks lennon...thanks alot...
This is not working in scanning during trading hours
Thank you,
this worked,
But the problem is BUY and SELL signal arrows showing on everycandle after 3rd candle, even after using = ExRem code...
Any solution for this?
@trading5848 I have no idea what Buy and Sell arrows are you talking about? I have not seen any code with trading signals on this forum thread.
If you have improperly coded a system how can anyone tell what you have done wrong without looking at the code?
@portfoliobuilder Hi.. how can we do the same for previous Day's 3rd candle Low ,High?
I have tried like this but not working
dn = DateNum(); // Select the day
bi = BarIndex(); // Select the barindex
newDay = dn != Ref( dn, -1 ); // First bar of new day
PDN = Valuewhen(NewDay, Ref(DN,-1)); // Previous day's datenum // if today's datenum is 1220729 pdn is 1220728
bipdn = BarsSince(pdn)==3; // Previous day's 3rd bar
pdn3h = ValueWhen(bipdn,H); // Previous day's 3rd candle high
pdn3L = ValueWhen(bipdn,L);
@PunitRaj I don't use intraday data much and that answer above is from a question more than 4 years ago. But maybe try something like this,
dn = Day();
newDay = dn != Ref( dn, -1 ); // first bar of new day
ThirdBar = BarsSince( newDay ) == 2; // 3rd bar of the day is 2 bars after the first bar of the day
// on the third bar of each day your variables update
ThirdBar_Hi = ValueWhen( ThirdBar, High );
PrevBar3_Hi = ValueWhen( ThirdBar, High, 2 ); // previous Day's 3rd bar high
I'd suggest running an Explore and a Plot to debug the code and make sure it is what you were looking for.