Wiki JStore Search Login

Simple strategy to enter at certain time, with SL and TP along with clear position command
 Post subject: Simple strategy to enter at certain time, with SL and TP along with clear position command Post rating: 0   New post Posted: Sat 28 Sep, 2019, 20:22 

User rating: 0
Joined: Fri 27 Sep, 2019, 13:58
Posts: 1
Location: CanadaCanada
Hi there,

I have attempted to create a simple strategy that (1) enters with a market trade at time X, (2) with a stop loss = entry price - Y and a take profit = entry + Z and (3) a clear position trade, that clears all positions at time T.

There should only be one position entered a day (enter at X and will always be cleared by T in the same day).

I have created the attached as a simple start. However, when I run the code, and keep the period at 1 tick, I find that the simulator enters multiple positions (albeit at the right time) and exits at take profit levels that are not consistent with my inputs. This problem occurs on essentially all periods. I prefer to keep the parameter at 1 tick, to simulate realistic market conditions.

I have followed the various forum articles regarding entering positions at specific times, but none of them address the problem mentioned above (i.e., excess number of positions entered when using a granular time period parameter).

Apologies if this is a simple question, but I am just getting started.

Thanks in advance!

Timetest3.vfs [34.86 KiB]
Downloaded 56 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.

Jump to:  

  © 1998-2011 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com