open and close trade at specific time
-
Hi,
I would like to open and close a trade at a specific time with the format hh:mm:ss but regardless if their is a tick or not.
For example buy 1 Lot Dax at 12000 points at 12:15:45 and close it at 16.15:30.
How do I do this?
At the moment I have an EA programmed which open and close it in a time window, when there is a tick (...with "time filter" and "on tick" slide). But when there is no tick at the specific time window, than the EA does not set a pending order or close it.
Thanks
Marc -
You can try this under "on Timer". But note that this event can't be backtested, because the Tester runs the EA by ticks

-
Thanks,
but in the help it says: "Timer event - repeats on some period of time, for example on every 60 seconds"
I don't want it do that every for example 60 seconds.
What I forgot to tell was that I want to set the pending order on a specific time, the trade is only opened, when the high of last candle is broken on current candle.
so what is the starting point of that "on timer" counter? The opening of the Trade? But therefore it is not always the same time until the trade should be closed.
thanks
-
The Timer starts with the EA normally. This is a clock and does something on a regular basis. Then it runs once on every X seconds. But it does not care about the ticks. You can have 0 ticks in 10 minutes, but the Timer will run on every X seconds.
I'm suggesting this event because you want specific time that does not depend on ticks. But I don't think that you really need it, I think that the time period can work well. Something like Time filter -> Once per bar, or the opposite.
-
Hi,
unfortunatly I'm still trying to set up an EA that sets a pending order at the high of the current bar on a specific time, lets say 16:39:55 local time independent of the time activating the EA and independent of a tick.
But I don't get it. I would be glad if anybody could help me an excample on how to do it?
Many Thanks in advance for any help!
-
Your request it's similar to my topic ("once per bar, working on open or close of a candle").
You can't set a pending order in the high of the current bar on a specific time, because you don't know the current high price, the price could rise again. it's also impossible to backtest a similar EA...the high price is that when the candle is completed. Conversely it's possible to set a pending order at the high of the previous candle (candle ID:1).
I suggest you to use "once per bar"...waiting to the confirmation in my topic... -
Yes you are right, but how to I "code" setting an pending order on the open of a candle at a specific time, lets says the candle of 10:30:00 of the timeframe 30min?
I don't get it worked...
-
Like this? http://prntscr.com/7ik1x6