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
Different data types possible. No need to cast to real datatype on retrieval, everywhere.
If you don't understand that initialization code goes in functions (like OnInit), step away from the code and hire some.
Perhaps you should read the manual.
How To Ask Questions The Smart Way. 2004
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.
Thanks, I probably needed those links, am new to coding and its etiquette!
I declared the initialization OnInit and the code worked as expected utilising the Array.
I'm running into an issue I anticipated but couldn't replicate until last night in Strategy Tester.
I declared a global array to capture the opentime, ticket, and highest high and lowest low for all open trades. (A massive thanks to everyone for helping me get this far).
However when multiple orders are opened, the way that I am stamping the tickets and resizing the array (I believe) causes a mismatch between the ticket and the HH and LL for that particular trade. In other words, the ticket takes the stamped HH and LL of another or previous trade - the result is a trade opened and closed instantly.
I think I have pinned it to this - I understand that this is not right, because I am esentially changing the index for ticket to its corresponding HH and LL. But I am inserting this code because I need to get all open trades on every tick, and ignore all the closed trades from the array.
I was wondering if anyone had any ideas to get around this - kind of getting stuck!
This is the full code, highligting where I am stamping the highest high and lowest low.