|
How to Open Another Position in Opposite Direction when Existing Position is Loosing Money? |
JonDoe
|
Post subject: How to Open Another Position in Opposite Direction when Existing Position is Loosing Money? |
Post rating: 0
|
Posted: Wed 30 Nov, 2016, 03:22
|
|
User rating: 0
Joined: Sun 31 Jan, 2016, 23:48 Posts: 14 Location: Australia,
|
Hi I am having trouble managing multiple positions. I wonder if you can help with the attached strategy (Test2.vfs).
Conceptually, this is what I want the strategy to do:
[points 1-4 are not the problem (although the "assign" blocks could be wrong), but here as background] 1. Open a position (let's call it S) in a direction suggested by an indicator. 2. Keep the position S open until the indicator suggests a change of direction. 3. Then close position S, and open a different position (let's call it L). 4. Repeat 1 to 3
[points 5-9 I am struggling with. ] 5. In addition, if position S (while still open) is loosing money (say a market price goes above the open price for a short position) then open another position (let's call it CounterS) in the opposite direction. 6. Keep the position CounterS open until position S is making money again (e.g.: price goes below the open price for a short position). 7. If while position S is still loosing money and at some stage the indicator suggests change of direction, then close position S. 8. However, now what was position CounterS (in point 5) becomes equivalent to position L above so points 1-3 should apply [except S becomes L and vice versa in the description above]. 9. Now the strategy repeats point 5-8.
In the attached file, points 1-4 seem to work on their own. Points 5-9 I think are not correct. I have trouble isolating the positions and relating logic to specific positions.
Attachments: |
Test2.vfs [49.05 KiB]
Downloaded 192 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.
|
|
|
|
|
 |
amine_chourou
|
Post subject: Re: How to Open Another Position in Opposite Direction when Existing Position is Loosing Money? |
Post rating: 0
|
Posted: Wed 30 Nov, 2016, 09:52
|
|
Visual JForex expert at Dukascopy |  |
User rating: 288
Joined: Thu 18 Apr, 2013, 09:26 Posts: 1496 Location: Switzerland, Geneva
|
Hi,
Thanks for the detailed explanations. I checked your example and it is not obvious where to look to identify where the strategy is blocked. Could you please insert some notes in your vfs to describe where your point from 1 to 8 are located and how the implementation is made ?
it is actually much more easier for me to start something from scratch rather than trying to fix your example. Maybe the attached example would help you in implementing your idea. I've used another method to identify positions individually as you can see and added comments in each order. The comment will help you when testing especially in Jforex platform where the comments are displayed in the end-of-test report. This example is handling only one side of trades (Sell) and you can build the buy side the same way if it meets your requirements./
Thanks
Attachments: |
ExampleForum.vfs [46.15 KiB]
Downloaded 645 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.
|
|
|
|
|
 |
JonDoe
|
Post subject: Re: How to Open Another Position in Opposite Direction when Existing Position is Loosing Money? |
Post rating: 0
|
Posted: Fri 02 Dec, 2016, 14:31
|
|
User rating: 0
Joined: Sun 31 Jan, 2016, 23:48 Posts: 14 Location: Australia,
|
Amine
Many thanks! This is very helpful. I worked out most of what I needed based on your example.
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|