|
How to build a simple Time and Ifs strategy? |
iskandar
|
Post subject: How to build a simple Time and Ifs strategy? |
Post rating: 0
|
Posted: Fri 27 Dec, 2013, 02:49
|
|
User rating: 1
Joined: Sun 06 May, 2012, 11:58 Posts: 8 Location: Singapore, Singapore/Jakarta
|
Hi,
I tried to figure out how to do this myself but I'm having difficulties understanding the wiki.
I wanted to create a simple algo with time and number variable, which goes like this:
Pair: Variable Time of Trade: Variable (08:05) Benchmark Price: Variable (for example 1.3700) Lot: Variable
Opening Logic: If "Current Price" is higher than benchmark by 5 pips at time 08.05, buy at market if "Current Price" is lower than benchmark by 5 pips at time 08.05, sell at market
Closing Logic: If "Long", set TP 50 pips higher than benchmark, SL 10 pips lower if "Short", set TP 50 pips lower than benchmark, SL 10 pips higher
Any help is much appreciated.
Best,
Iskandar
|
|
|
|
 |
Bruno_Grunberg
|
Post subject: Re: How to build a simple Time and Ifs strategy? |
Post rating: 0
|
Posted: Fri 27 Dec, 2013, 10:41
|
|
Site Administrator |  |
User rating: ∞
Joined: Fri 21 Jun, 2013, 16:50 Posts: 197 Location: FranceFrance
|
I hope this will answer your question.
Attachments: |
iskandar2.vfs [29.81 KiB]
Downloaded 246 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.
|
|
|
|
|
 |
iskandar
|
Post subject: Re: How to build a simple Time and Ifs strategy? |
Post rating: 0
|
Posted: Sat 28 Dec, 2013, 04:07
|
|
User rating: 1
Joined: Sun 06 May, 2012, 11:58 Posts: 8 Location: Singapore, Singapore/Jakarta
|
Hi Bruno,
Thank you very much for the help. Just one question - I notice in the vjfx the SL/TP is calculated from the position open price. How to calculate the SL/TP based on benchmark price instead? i.e. 50 pips away from the benchmark.
|
|
|
|
 |
Bruno_Grunberg
|
Post subject: Re: How to build a simple Time and Ifs strategy? |
Post rating: 0
|
Posted: Mon 06 Jan, 2014, 09:02
|
|
Site Administrator |  |
User rating: ∞
Joined: Fri 21 Jun, 2013, 16:50 Posts: 197 Location: FranceFrance
|
Make your calculation with a mathematical block and put the result in a variable. Then, use this variable as SL.
|
|
|
|
 |
iskandar
|
Post subject: Re: How to build a simple Time and Ifs strategy? |
Post rating: 0
|
Posted: Mon 06 Jan, 2014, 15:29
|
|
User rating: 1
Joined: Sun 06 May, 2012, 11:58 Posts: 8 Location: Singapore, Singapore/Jakarta
|
|
|
|
 |
Bruno_Grunberg
|
Post subject: Re: How to build a simple Time and Ifs strategy? |
Post rating: 0
|
Posted: Mon 06 Jan, 2014, 17:48
|
|
Site Administrator |  |
User rating: ∞
Joined: Fri 21 Jun, 2013, 16:50 Posts: 197 Location: FranceFrance
|
Anytime 
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|