1) Please edit your post and use the SRC-button for your code!
2) and reduce the wideness of your lines!
I am still in troubles to read your code!
To see one line totally I have to reduce the font-size so much that I can't read any more what you have written. :(
gooly:
I think that it is code from an EA builder. They always seem to have excessively wide lines
I am still in troubles to read your code!
To see one line totally I have to reduce the font-size so much that I can't read any more what you have written. :(
Actually when you see && you can always make it new line. So I am suggesting georgee do the same.
Check your return codes (OrderSelect and OrderModify) What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles | for(int cnt=0;cnt<OrdersTotal();cnt++) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if(OrderType()<=OP_SELL && OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber ) { |
You must count down when closing/deleting in a position loop. Get in the habit of always counting down. Loops and Closing or Deleting Orders - MQL4 forum |
for(int cnt=OrdersTotal()-1; cnt >= 0; --cnt) if( OrderSelect(cnt, SELECT_BY_POS) && OrderType() <= OP_SELL && OrderMagicNumber() == MagicNumber && OrderSymbol() == Symbol() ){ |
Are your books one column but two feet wide? No because that is unreadable. They are 6 inches, sometimes two columns, so you can read it easily. So should be your code. I'm not going to go scrolling back and forth trying to read it. Edit the post with formatted code and you might get additional help. Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a kludge, don't use it. It's use is always wrong
| OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(TheStopLoss,Digits), NormalizeDouble(TheTakeProfit,Digits), 0, Green);
|
| double MyPoint=Point; if(Digits==3 || Digits==5) MyPoint=Point*10; |
Current, forming bar is zero. Previous bar is 1. The unknown future is -1 | if((Close[-1]<iMA |
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
Hi, I have a problem with my EA. When I run tester in MT4, EA place TP/SL properly TP (100 pips) and SL ( 50pips) but when i try to run my EA on demo acc with same setting, it won´t open a possition due to the small TP/SL I think( if I made an order manually and place manually TP/SL with same settings, it is no problem). So here I thought that instead of placing order with TP/SL at the same time, my EA will place an order and after that, it will place TP/SL. It is an ECN broker. Sorry for my english.
Thanks in advance.
Here is the code: