This forum is in read-only mode now. You may discuss your questions on forums of MQL4.community and MQL5.community

Help with pending order-EA


Back to topics list
avatar
1
Alex1004 2010.03.10 19:54 
hi


Below is my first own EA.

Unfortunately I have some problems with it.


How it should work: Every new (Daily)-Bar the EA should only set one sellstop and one buystop.

Prices, StopLoss and TakeProfit are all calculated by a formula using the High-,Low- and Close-Value of the privious day.


Now I have two problems:

1. The EA only sets pending orders, when I don't define the SL and TP-values in the source-code.

2. If I leave SL and TP-values by 0 SellStop and BuyStops-orders are set, but not each once a day but any time the price changes.

Actually the pending orders should only be set when a day begins i.e. a new daily candle opens.



Many thanks in advance for everyone who can help me!!!

As I said before im just starting to program so the code sure doesn't look very professional but I think (hope) the problems shouldn't

very hard to be solved for some experienced programmers.
Attached files:
  myEA1.mq4 (1.38 KB)
Back to topics list  
Download MetaTrader 5 (450 Kb, web installer) — a new terminal for financial markets