Well, the complete code is about 3000 lines. I doubt it would help to post all of that. But I should have said it differently.
When I use your file, it's working. I don't get why it's not working within my EA.
The part I posted is everything, SAR_C is used in. So why isn't it giving me the right result?
Because your code is not allowing it to work as you think it should, in other words your code is broken. I can understand you not wanting to post your code, and I have no desire to trawl through 3000 lines of somone else's code, but without seeing more detail it's hard to give much specific help.
Add a Print() immediately after this line . . .
double SAR_C = iSAR(NULL,0,0.02,0.2,1)+0.00005;
. . . is this line always called or is it part of a custom function ? or is it conditional on something else ? is your Print in the same function or a different function ?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Complete code:
This is the output:
That isnt the complete code, where is your start() function . . .
Try this code in the Strategy Tester, I get this:
That isnt the complete code, where is your start() function . . .
Try this code in the Strategy Tester, I get this:
Well, the complete code is about 3000 lines. I doubt it would help to post all of that. But I should have said it differently.
When I use your file, it's working. I don't get why it's not working within my EA.
The part I posted is everything, SAR_C is used in. So why isn't it giving me the right result?
Well, the complete code is about 3000 lines. I doubt it would help to post all of that. But I should have said it differently.
When I use your file, it's working. I don't get why it's not working within my EA.
The part I posted is everything, SAR_C is used in. So why isn't it giving me the right result?
Because your code is not allowing it to work as you think it should, in other words your code is broken. I can understand you not wanting to post your code, and I have no desire to trawl through 3000 lines of somone else's code, but without seeing more detail it's hard to give much specific help.
Add a Print() immediately after this line . . .
. . . is this line always called or is it part of a custom function ? or is it conditional on something else ? is your Print in the same function or a different function ?
Seems like I found the problem. Took me quite some time to figure out.
Thanks a lot for your help, angevoyageur and RaptorUK.
It was a mistake in the code. I forgot some brackets that made it circumvent the definition of the variable.