Hello all, I just created this script to compare overnight and premarket activity over a certain number of days, and tell me the percentages when:
1. Premarket high breaks overnight high
- does the US session break the premarket high and/or the overnight highs? if so, by how much %?
- does the US session break the premarket low and/or the overnight lows? if so, by how much %?
2. Premarket low breaks overnight low
- same as above
Problem is, I am getting strange results from this - the data for my highs and lows in each session do not match what I am seeing on my chart. I am pretty sure I've got my timeframes correct, because I print those values as the script runs. But I am seeing serious discrepancies and can't seem to find my issue. Admittedly I am new to MQL, but am experienced w programming and have written a few advisors and indicators already. I'm thinking it is some thing about how I am handling the arrays of data, but just can't spot it.
- Help requested - Created script to compare gains/losses in US session with premarket vs overnight session activity
- Specify a high and low on chart and count how many pips it gets broken by before touching the other end??
- How can I get the current day high and low on an expert advisor?
Your topic has been moved to the section: Expert Advisors and Automated Trading
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
Thank you, will check that forum post next time!
Clint Kuhl:
I'm thinking it is some thing about how I am handling the arrays of data, but just can't spot it.
I'm thinking it is some thing about how I am handling the arrays of data, but just can't spot it.
Just based on the symmetry of your code, it all seems ok until:
int premarketUpDayLowerThanOvernight = 0; int premarketUpDayLowerThanPremarket = 0; int premarketDownDayLowerThanOvernight = 0; int premarketDownDayLowerThanPremarket = 0; int premarketDownDayHigherThanOvernight = 0; int premarketDownDayHigherThanPremarket = 0;
Is this intended, or should there be premarketUpDayHigherThanOvenight and premarketUpDayHigherThanPremarket variables also?
Ryan L Johnson #:
You're right, the naming of the variables was confusing, although I think the logic still mostly worked until the reporting area of the code - print statements near the bottom. I cleared that up. It doesn't impact the price quote issue, but thanks for pointing it out anyway!
Just based on the symmetry of your code, it all seems ok until:
Is this intended, or should there be premarketUpDayHigherThanOvenight and premarketUpDayHigherThanPremarket variables also?
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register