I want to code an EA that runs continuously but takes a position not more than once per day, and am interested in how others have logically approached this. My current logic is:
if P == 0 (and other conditions are met) then take a Position and set P = 1
if current time < previous time then set P = 0
I believe this logic will work, but am interested to know if anyone 1) thinks it won't work and/or 2) has other/better logic. Thanks in advance.
It all depends on your strategy.
If for you it is right, so it is right...
If you don't know ho to program this, you should go to the Freelance section...
https://www.mql5.com/en/job
- www.mql5.com
I want to code an EA that runs continuously but takes a position not more than once per day, and am interested in how others have logically approached this. My current logic is:
if P == 0 (and other conditions are met) then take a Position and set P = 1
if current time < previous time then set P = 0
I believe this logic will work, but am interested to know if anyone 1) thinks it won't work and/or 2) has other/better logic. Thanks in advance.
You can also check your trade history to see if a trade already has been triggered for the day.
The date time can be made into a unique day string format (dd-mm-yyyy) and be used to check against the trade history iterated from present to past.
I have done the code, and the above method is the solution I have used.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I want to code an EA that runs continuously but takes a position not more than once per day, and am interested in how others have logically approached this. My current logic is:
if P == 0 (and other conditions are met) then take a Position and set P = 1
if current time < previous time then set P = 0
I believe this logic will work, but am interested to know if anyone 1) thinks it won't work and/or 2) has other/better logic. Thanks in advance.