PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Need Expert Help on Time Function



Chuk56
10:57,
OK. I feel like a real bonehead. For some reason, I simply cannot get my expert working. Essentially, all I want to do is to place an order every night at precisely 3:30 GMT. For whatever reason, MT4 acts as if the hour is set correctly, but, it does funny stuff with the minutes. For instance, I changed the setting to place an order at 15:55, but, it placed it at 15:52.

Does anyone have an idea of what could be happening? If I want an order down to the minute, does the expert need to be on a minute chart?

If someone is willing to take a glance through the code, I'm happy to post it.

Thanks.

Chuk56
18:02,
Did those few minutes get you in at a worse price?
Die Märkte sind zu dieser Zeit so langsam, dass es wirklich egal war. Es ist nur verwirrend für mich. Gibt es neben der Verwendung von Zeitfunktionen noch einen anderen Ansatz, um am Ende der Kerze um 3:30 Uhr eine Bestellung aufzugeben?

Oxrayclementei
19:23,
OK. I feel like a real bonehead. For some reason, I simply cannot get my expert working. Essentially, all I want to do is to place an order every night at precisely 3:30 GMT. For whatever reason, MT4 acts as if the hour is set correctly, but, it does funny stuff with the minutes. For instance, I changed the setting to place an order at 15:55, but, it placed it at 15:52. Does anyone have an idea of what could be happening? If I want an order down to the minute, does the expert need to be on a minute chart? If someone is willing to take a glance through the code, I'm happy to post it. Thanks. stockwet
stock-y ... Ich glaube, es muss auf dem Minutendiagramm stehen, da die Balkenzeit auf der Schlussminute des Balkens basiert. Da Experten Ticks ausführen und der erste Tick des 15:55-Balkens um 15:52 ausgeführt wird, wird Ihr 15:52-Balken als Ihr 15:55-Balken angezeigt (seit dem Schließen des Balkens zwischen 15:51 und 15:55 ist genau 15:55). Haben Sie diese paar Minuten zu einem schlechteren Preis reingebracht?

Chuk56
20:44,
stock-y...I believe it does have to be on the minute chart because the bar time is based on the closing minute of the bar. Furthermore, since experts execute on ticks, if the first tick of the 15:55 bar executed at 15:52, it would read your 15:52 bar as your 15:55 bar (since the close of the bar between 15:51 and 15:55 is exactly 15:55). Did those few minutes get you in at a worse price?
Now that's interesting. That's not what I thought the problem was. I'm actually using a 30 minute chart and the value I want is 3:30. This actually makes sense. Last night, my expert executed at 3:00. Based on what you said, even though the actual time was 3:01, it treated the tick as 3:30. Does that sum it up?

Oxrayclementei
22:05,
Now that's interesting. That's not what I thought the problem was. I'm actually using a 30 minute chart and the value I want is 3:30. This actually makes sense. Last night, my expert executed at 3:00. Based on what you said, even though the actual time was 3:01, it treated the tick as 3:30. Does that sum it up?
That sums it up...as far as correcting the problem, I'm sorry, I really don't know...I just remember running into the same issue with a time-based expert of mine as well (something pivots) a while back. The easiest thing for you to do would be to execute your trade by checking to see if the time is GREATER THAN 3:30. This way it would execute on the next tick past the 3:30 bar. You may lose a minute...but that shouldn't affect you that much...right?