Yes, I have one as well but they detect after the bar closes. I would like to do something that works on the current bar. By the way I don't have any issue on the pin bar method itself but the commands High, Low, Open does not seem working on index 0 during visual tests.
Alert does not work in the Start.-Tester - could that be the problem?
Use either Comment() or Print()..
aed71: The problem is both uc and h1 is the same value |
Of course they're the same value on the first tick of a new bar. You can't test for a pin bar on the forming bar. |
Alert does not work in the Start.-Tester - could that be the problem?
Use either Comment() or Print()..
aed71: The problem is both uc and h1 is the same value | Of course they're the same value on the first tick of a new bar. You can't test for a pin bar on the forming bar. |
It's not related with the first tick of the new bar. To avoid this I've put 20 pips distance condition.
The problem is during 1 Hour bar, the Ask/Bid line moves up and down but the uc and h1 values are never changes?
Why the high[0] does not change in the current bar? (it goes up like 35 pips and you can clearly see that it's moving up in the tester)
Any other idea why High[0], Low[0] does not change during the strategy tester?
Does it get the highest and lowest values in advance by looking to H1 data? If so we could not test any strategy working on the index 0.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I'm trying to write a PinBar detector function for the current bar (index 0).
The Pinbar_Bar() function will detect the pin bar based on the following assumption:
h1= Height of the total bar (difference between current high and low)
uc= Distance between open price and current high.
The condition h1>20*PP means that it will check the pinbar if the total height of the bar is greater than 20 pips (this part works)
If h1/uc > 2 (which means uc if half of the total bar (at least) it will trigger the pinbar.
The problem is both uc and h1 is the same value (say 0.0038) and the ratio is always 1 (open price is = lowest). I tried both with High[] and iHigh() type of functions, result is the same.
Is there a problem in strategy tester (visual mode) to test index 0? If yes is there a way to overcome this issue?
My code is as below: