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
Sorry posted the wrong expert line in previous posts - should be
NR 0 StaticEA (EURUSD,M15) 17:03:57 myprice.ask 0.0 * Volume 5.05 * 100000 = 0.0
as you can see myprice.ask is returning 0.0 from these 2 code lines
The EA does the check below on every tick and it does not give any errors
can you explain why myprice.ask does this. is it a bug or some sort of restriction I am not aware of?Hi BigAl,
For me looks like some memory leak or similar problem, for example declare indicators inside ontick() instead of oninit().
As a suggestion, try comment all code inside ontick() and just test myprice.ask and print this value, that must be ok.
After that, put code by code again (removing comments step by step) and checking myprice.ask to detect when it goes zero.
Hi BigAl,
For me looks like some memory leak or similar problem, for example declare indicators inside ontick() instead of oninit().
As a suggestion, try comment all code inside ontick() and just test myprice.ask and print this value, that must be ok.
After that, put code by code again (removing comments step by step) and checking myprice.ask to detect when it goes zero.
Sorry for delay - been away - thanks for suggestion - will try and let you know
very strange - may be a bug? see start of my code and the associated log. The test for a valid price does not seem to work as Print statements return a zero value but execution of the EA continues instead of performing the return. Any ideas
Fix is easy I just test for myprice.ask != 0 but still would like to know why it does this itermittently
LOG:
KO 0 StaticEA (EURUSD,H1) 17:03:10 1 0.0
RR 0 StaticEA (EURUSD,H1) 17:03:10 2 0.0
EE 0 StaticEA (EURUSD,H1) 17:03:10 3 0.0
OG 0 StaticEA (EURUSD,H1) 17:03:10 After select = true
DQ 0 StaticEA (EURUSD,H1) 17:03:10 4 0.0
DE 0 StaticEA (EURUSD,H1) 17:03:10 After PositionGetDouble(POSITION_VOLUME) = 4.99
GQ 0 StaticEA (EURUSD,H1) 17:03:10 5 0.0
NG 0 StaticEA (EURUSD,H1) 17:03:10 myprice.ask 0.0 * Volume 4.99 * 100000 = 0.0
RQ 0 StaticEA (EURUSD,H1) 17:03:10 6 0.0
PI 0 StaticEA (EURUSD,H1) 17:03:10 After position = 0.0
GM 0 StaticEA (EURUSD,H1) 17:03:10 7 0.0
Hi BigAl,
1. Next time when posting code, please use SRC button till succeed.
2. You ask for advice by only showing partial of the code, you may get the answer but may not what you want
Hi BigAl,
1. Next time when posting code, please use SRC button till succeed.
2. You ask for advice by only showing partial of the code, you may get the answer but may not what you want
Hi BigAl,
1. Next time when posting code, please use SRC button till succeed.
2. You ask for advice by only showing partial of the code, you may get the answer but may not what you want