Forum

Closing orders after a specified number of bars

Any chance that there's a kind person who can help me with the following pls :-) Want some code that closes orders after say 4 bars, regardless of whether the trades are profitable or not. I'm trading hourly bars, so figured if I hadn't hit a profit target or stop by 4 hours, I'd just close the

EA keeps trading even when no smile face

Has anybody experienced this before? I close down all my charts There is no smile on the chart, (as there are no charts) I've gone to tools / options and have turned off 'allow live trading' The 'expert advisor' button up the top is red, not green I am NOT logged into my account from any other PC or

Optimisation results different to backtesting results

Hi all, I just spent 3 days optimising an EA, and at the end of that I have what seems to be some decent results. Had a number of passes that came back with profit factors of 1.5, 1.6, 1.7... up to 2.1. So I then go and right click these results and select the option to "Set Input Parametres". I

EA will backtest but won't trade

Hi there, I've written an EA (Probably badly... but I did it!!) and when I run it through backtests I see all the trades it would have taken. Then I go to trade live, I've ticked all the right boxes and I even get a smile face on the top right, however the EA won't take any trades. Does anyone have

custom indicators - crossing a round number

Hi guys, Another newbee question if I may. I want to write a custom indicator that will track for each bar in the chart whether price crosses a round number. I can do the round number bit because I just go to the textbook and use the MathMod formula, but I don't know how to store this for each bar