![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
So the user can set it for a particular time range they want to trade this EA,
Off to search the code base and reading documents again LOL
Happy coding and thanks for the help to everyone
Agent86: ...I have a lot of ideas for this and hope to make something useful for people....
I don't wanna dis-courage you or anything but your code didn't work for me. I got lots of error 130. I recommend you forget about making codes for the Masses while you're still green. Focus on creating a Universal Template for yourself first. Don't look toward Library files unless you're comfortable with your current programming style. Instead, make the Template the Library file and add a few good functions to it. Then make the trade logic an include file with it's own magic# etc in that include file. Ever wonder why new versions of software and programs keep coming up every other day? Sure there are cosmetic and monetary reasons but my guess is the biggest reason is because the programmer needs to optimize the code.
One example of a good template can be found here. It takes time so take it easy.
Now I have to work on IsTradeAllow to make some sort of time range for trading
So the user can set it for a particular time range they want to trade this EA,
Agent86: ...I have a lot of ideas for this and hope to make something useful for people....
I don't wanna dis-courage you or anything but your code didn't work for me. I got lots of error 130. I recommend you forget about making codes for the Masses while you're still green. Focus on creating a Universal Template for yourself first. Don't look toward Library files unless you're comfortable with your current programming style. Instead, make the Template the Library file and add a few good functions to it. Then make the trade logic an include file with it's own magic# etc in that include file. Ever wonder why new versions of software and programs keep coming up every other day? Sure there are cosmetic and monetary reasons but my guess is the biggest reason is because the programmer needs to optimize the code.
One example of a good template can be found here. It takes time so take it easy.
I'll research a bit further, and also this is being used on a 5 digit broker so you may have to change the extern lot = .1 to something else also ?
I think you misunderstand the function of IsTradeAllowed "Returns TRUE if the expert is allowed to trade and a thread for trading is not occupied, otherwise returns FALSE." it's not something you can set . .
I'll reread this some more and likely have to create some code to create a time range for trading such as: trade only during time range = 3am - 6am
or perhaps 6am - 1pm etc.
Hopefully it won't give me too much trouble
Close but not quite. Mql4 charts are bid charts so the values you get from ABCD are Bid values. These need to be adjusted depending on the direction of the trade.
I am using all Bid prices except for the OrderSend parts And so I may need to adjust these sl and tp by simply +/- the spread right ?
Is there where most of the problem might come in ?
I have no problem referring to a Bid price in my code as that is how it's coded and when I watch the charts I would place a trade based on what I see so this would be ok for this code.
I have to review your code some I don't really understand it but only partially.
Thanks