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
Hi
I've done a lot of digging around and can't find anything similar to this - which may mean that either my understanding/coding ability isn't good enough (I'm a 'cut and paste' coder) or this isn't possible.
What I'm doing is building an EA which uses a series of boolean to determine whether conditions are right to place a trade. i.e. if A happens, boolean 1=True, then if B happens whilst boolean 1 is true, boolean 2 is true and so on (so for example, if a MA cross happens, then stochastic >80 and then price returns to the MA and so on). The code has 6 booleans so far and I want to add a 7th and make a couple of them possible either way round. Additionally, I've got reset boolean to false triggers in there.
As its complex there's potential either for my coding to be wrong or for it trigger when I didn't expect it to. Working all this out I'm fine with - but what I'm trying to do is track it.
I can load the current status of the booleans to a comment field and see them no problems. What I want to be able to do is see what status the booleans had at any point in the past (or at least whilst it's been running on a demo account).
I have lifted the code from iCrosshair and put that in an EA - which works fine for seeing the values (for a given candle) for the arrays in iCrosshair (open, close etc - or something derived from those).
If I replace the code in iCrosshair with a calculation of one of my booleans, I can also get that to work (see example in the attached/embedded code). What I want to be able o do though is pass the value of the boolean as it was at that candle to the comment box (I may try to get funkier after that and do something graphical) - which I haven't been able to do.
The reason for wanting to do it that way is because the value of the later booleans are conditional on the earlier ones - so it not just as simple of copying the code (which would be messy for any code changes).
Does anybody know if this is possible and if so do you have any pointers as to how to go about doing it? I suspect if it is then I need to get to grips with arrays - but my use of arrays has been in basic indicators so far - nothing as complex as this!
So in the example attached (which I have stripped down to just one boolean - an MA cross) I want ' double EMA50AboveEMA100(int i)' to use the result created by 'void void_buy1_EMA50_Above_EMA100()' rather than to recreate the result
Thanks in advance for any comments :)
David