Dukascopy
 
 
Wiki JStore Search Login

How to have the strategy wait for some time before opening a new position
 Post subject: How to have the strategy wait for some time before opening a new position Post rating: 0   New post Posted: Thu 23 May, 2013, 03:45 
User avatar

User rating: 0
Joined: Sat 04 May, 2013, 16:08
Posts: 17
Location: ItalyItaly
Hello everybody, hello support.
I really need some help with this, I can't figure out how to do it.
I'm going to explain step by step

-the strategy looks at the beginning of actual candle (hourly) how was the previous candle
-if the previous candle meet my requests, a position is opened (pending or market). Stop Loss and Profit are set as PRICE LEVELS.
-during the actual candle, the price goes either to my stop or to my target. So the position is closed.
-now there are no open positions anymore, and previous candle is still the one that has my characteristics, because actual candle is not over yet
-so the strategy opens another order/position, but it stops right away.
-again and again, till the actual candle is over.

Now, I am tryin hard to understand how set the strategy to wait until actual candle is over before placing a new order. But how??

In the attached picture is my last try, I'm gonna explain what i think:

-If in last trading event - position is closed
-get the time unit of "close time" and set it as a variable
- add 1hour (3600000 milliseconds) to the "close time" and set the result as a "newtime"
- if last tick bid is equal or more as "newtime", go ahead with the strategy.

the beginning "on tick" is for the indicators, but the orders begin "on candle", because it looks how was previous candle.

Where is my mistake, or how can I get this result?

thank you very much

nic


Attachments:
cattura1.JPG [166.03 KiB]
Downloaded 427 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.
 
 Post subject: Re: How to have the strategy wait for some time before opening a new position Post rating: 0   New post Posted: Thu 23 May, 2013, 04:19 
User avatar

User rating: 0
Joined: Sat 04 May, 2013, 16:08
Posts: 17
Location: ItalyItaly
OK I got it finally

All I had to do is to put an "if" block after the "on candle" beginning, and set the candle period as hourly.


 
 Post subject: Re: How to have the strategy wait for some time before opening a new position Post rating: 0   New post Posted: Sat 25 May, 2013, 00:57 
User avatar

User rating: 7
Joined: Wed 04 Jul, 2012, 02:40
Posts: 109
Location: Australia, Melbourne
Hi Nic,

Can you share your strategy & picture here to help everyone with this?

Thanks
DoC


 

Jump to:  

cron
  © 1998-2024 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