Entry Time Problem

Posted By: trenki2

Entry Time Problem - 02/20/17 07:58

I have a script and set the following variables:

Code:
BarOffset = 15 * 60;
BarZone = WET;



I wanted the script to always trade in the afternoon. When I test the script and inspect the testtrades.csv file all the trades are in the afternoon so everything seems fine.

I now tried to trade the script live. One trade was opened in the afternoon, but the script tried to open a second trade right after the weekend ended at 23:00 while the Index CFD trading was still closed so no trade could be opened.

Why would the script try to open a trade at that time while in testmode no trades were opened on the weekend?

How can I fix this? Any hints?
Posted By: jcl

Re: Entry Time Problem - 02/20/17 10:36

Because the first bar of a week starts sunday 23:00 by default. Your script is probably trading at every bar, regardless if it's 15:00 or not.

Just check the time before entering a trade.

© 2024 lite-C Forums