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
Ok! Thanks
So this is how far Ive come after reading the icustom page.
int ergodictrend;
double ergodic1,ergodic2,ErgodicBuffer,Signal_Buffer;
ergodic1 = iCustom(NULL, 0, "Ergodic Osc",ErgodicBuffer,0,0);
ergodic2 = iCustom(NULL, 0, "Ergodic Osc",Signal_Buffer,0,1);
if(ergodic1>ergodic2) ergodictrend = 1;
if(ergodic1<ergodic2) ergodictrend = -1;
But now it only opens sell orders.
What am I doing wrong?
So this is how far Ive come after reading the icustom page.
int ergodictrend;
double ergodic1,ergodic2,ErgodicBuffer,Signal_Buffer;
ergodic1 = iCustom(NULL, 0, "Ergodic Osc",ErgodicBuffer,0,0);
ergodic2 = iCustom(NULL, 0, "Ergodic Osc",Signal_Buffer,0,1);
if(ergodic1>ergodic2) ergodictrend = 1;
if(ergodic1<ergodic2) ergodictrend = -1;
But now it only opens sell orders.
What am I doing wrong?It depends on the rest of the code
The code you posted seems OK
It depends on the rest of the code The code you posted seems OK
Im using a simple (ergodictrend0) for buyorders.
Without them the EA is doing buy and sell orders as it should. I just added this to make it follow the trend of the ergodic, buy orders when ergodic-line is over the signal-line and sell orders when the ergodic-line is under the signal-line.
If i follow the indicator on the chart, it doesnt do the sell and buy orders it should do, instead it only opens the sell orders.
Im using a simple (ergodictrend0) for buyorders.
Without them the EA is doing buy and sell orders as it should. I just added this to make it follow the trend of the ergodic, buy orders when ergodic-line is over the signal-line and sell orders when the ergodic-line is under the signal-line.
If i follow the indicator on the chart, it doesnt do the sell and buy orders it should do, instead it only opens the sell orders.Why don't you use (ergodictrend==-1) for sellorder and (ergodictrend==1) for buyorder?
Why don't you use (ergodictrend==-1) for sellorder and (ergodictrend==1) for buyorder?
If I do that the backtest takes longer time and it doesnt do any buy or sell.
Strange, isnt that the same as my way of writing it?
If I do that the backtest takes longer time and it doesnt do any buy or sell. Strange, isnt that the same as my way of writing it?
Check the rest of the code
Those conditions should not slow down the EA and are OK
Check the rest of the code Those conditions should not slow down the EA and are OK
If I dont use the ergodictrend at all, it doesnt slow down. Only when i write (ergodictrend==1) and (ergodictrend==-1)
I could be wrong though. Eather way it doesnt make any buy orders when it should when I use (ergodictrend0) and it doesnt make any buy or sell orders at all when I do it your way.
Is it something in the Ergodic Indicator that doesnt work with my EA.
Dont know how to upload the indicator here for you to see it, but maybe you have it allready?
If I dont use the ergodictrend at all, it doesnt slow down. Only when i write (ergodictrend==1) and (ergodictrend==-1)
That part of the code can not slow down the EA
Please, as I told you, check the rest of your code and what is done in it
All the best
That part of the code can not slow down the EA
Please, as I told you, check the rest of your code and what is done in it
All the bestOk!
Thanks for the help, will look in to it and see if I can find the problem.