This is a good working HMA EA except for one thing, it it buys or sells during the candle as it changes which could do a short then the candle turns long and at the close your short with a long trend. I would like the buy or sell desicion to take place at the end of each candle not during.
Can some one help me with this problem.
It seems like RK-MAD-Heiken_Ashi_Ma_T3_new[Alert] indicator is missing.......
I think you missed the point WHRoeder was making. All the code you want to execute only when there's a new bar must go inside the if() block. I've rearranged WHR's code a little to illustrate.
int Start(){staticdatetimeTime.newBar; bool newBar =(Time[0]>Time.newBar); if(newBar){// A new bar began.Time.newBar =Time[0];// Reset static.//... <<<< Any code here is executed only when a new bar appears
} //... <<<< Any code here is still executed every tick
I think you missed the point WHRoeder was making. All the code you want to execute only when there's a new bar must go inside the if() block. I've rearranged WHR's code a little to illustrate.
Cheers
Jellybean
WHRoeder thanks for the input and & Jellybean Thanks for the explaination. Now it works great in backtesting but fails to trade LIVE. All the false signals in the strategy tester disappeared, it increased Prof factor, Net profet and with less trades. If I remove the inputs at line 145 it will trade as usual. Any Ideas ???
WHRoeder thanks for the input and & Jellybean Thanks for the explaination. Now it works great in backtesting but fails to trade LIVE. All the false signals in the strategy tester disappeared, it increased Prof factor, Net profet and with less trades. If I remove the inputs at line 145 it will trade as usual. Any Ideas ???
Attached is the EA and the Indicator.
Thanks
Here is the indicator. How do you attach 2 files at the same time??
WHRoeder thanks for the input and & Jellybean Thanks for the explaination. Now it works great in backtesting but fails to trade LIVE. All the false signals in the strategy tester disappeared, it increased Prof factor, Net profet and with less trades. If I remove the inputs at line 145 it will trade as usual. Any Ideas ???
It appears that MQL adds letters and symbols to the file names the indicator is "RK-MAD-Heiken_Ashi_Ma_T3_new[Alert]" and the EA is "RK_MAD_Heiken Ashi MA T3-test". Maybe its me.
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.
forget how to attach
Picture of problem
This is a good working HMA EA except for one thing, it it buys or sells during the candle as it changes which could do a short then the candle turns long and at the close your short with a long trend. I would like the buy or sell desicion to take place at the end of each candle not during.
Can some one help me with this problem.
It seems like RK-MAD-Heiken_Ashi_Ma_T3_new[Alert] indicator is missing.......
It seems like RK-MAD-Heiken_Ashi_Ma_T3_new[Alert] indicator is missing.......
You can't compare Bars to a static. Once Bars reaches the maximum (in options) it won't change.
Hi
I think you missed the point WHRoeder was making. All the code you want to execute only when there's a new bar must go inside the if() block. I've rearranged WHR's code a little to illustrate.
Cheers
Jellybean
Hi
I think you missed the point WHRoeder was making. All the code you want to execute only when there's a new bar must go inside the if() block. I've rearranged WHR's code a little to illustrate.
Cheers
Jellybean
WHRoeder thanks for the input and & Jellybean Thanks for the explaination. Now it works great in backtesting but fails to trade LIVE. All the false signals in the strategy tester disappeared, it increased Prof factor, Net profet and with less trades. If I remove the inputs at line 145 it will trade as usual. Any Ideas ???
Attached is the EA and the Indicator.
Thanks
WHRoeder thanks for the input and & Jellybean Thanks for the explaination. Now it works great in backtesting but fails to trade LIVE. All the false signals in the strategy tester disappeared, it increased Prof factor, Net profet and with less trades. If I remove the inputs at line 145 it will trade as usual. Any Ideas ???
Attached is the EA and the Indicator.
Thanks
Here is the indicator. How do you attach 2 files at the same time??
WHRoeder thanks for the input and & Jellybean Thanks for the explaination. Now it works great in backtesting but fails to trade LIVE. All the false signals in the strategy tester disappeared, it increased Prof factor, Net profet and with less trades. If I remove the inputs at line 145 it will trade as usual. Any Ideas ???
Attached is the EA and the Indicator.
Thanks
Here is the EA.
Here is the EA.
It appears that MQL adds letters and symbols to the file names the indicator is "RK-MAD-Heiken_Ashi_Ma_T3_new[Alert]" and the EA is "RK_MAD_Heiken Ashi MA T3-test". Maybe its me.