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
I'm working this out now. I want it to close a short position when either the CCI crosses above 100 or above -100. Earlier I had success with using if(OrdersTotal()==0) to keep it from opening a million trades and I am thinking once I get the ticket error figured out the below code will work?
if((PreviousCCIReading < 100 && CurrentCCIReading > 100) || (PreviousCCIReading < -100 && CurrentCCIReading > -100))
Just add this to the top of your code
In this way the complier will tell you the error line of code. If you encounter a warning, or error description of a (string to int). You have a variable that can not be of the same type.Thank you
Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 and MetaTrader 4 - MQL4 programming forum
MagicNumber: "Magic" Identifier of the Order - MQL4 Articles
Using OrdersTotal directly and/or no Magic number filtering on your OrderSelect loop means your code is incompatible with every EA (including itself on other charts and manual trading.)
Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 and MetaTrader 4 - MQL4 programming forum
MagicNumber: "Magic" Identifier of the Order - MQL4 Articles
I've replaced the code as follows and will get back to it tomorrow.
global has "extern int MagicNumber = 1234;"
void Ontick has "OrderClose(MagicNumber,LotSize,Bid,3,Red);"
I'm assuming I need to use an order select function
Perhaps you should read the manual. What is the first argument to OrderClose?
Perhaps you should read the links provided, where they show a filtered OrderSelect loop.