Dukascopy
 
 
Wiki JStore Search Login

open hedge position
 Post subject: open hedge position Post rating: 0   Post Posted: Tue 04 Feb, 2014, 17:54 
User avatar

User rating: 0
Joined: Wed 25 Sep, 2013, 17:33
Posts: 28
Hey Guys,

I'm trying to get a strategy done that will hedge instead of using a SL. Still struggling with a way of compiling it so that for example when a Position gets 20Pips negative, the strategy would open a hedging position.

What would be the easiest way of compiling it?


Thanks in advance!
Artur


 
 Post subject: Re: open hedge position Post rating: 0   Post Posted: Tue 04 Feb, 2014, 18:40 
User avatar

User rating: 0
Joined: Wed 25 Sep, 2013, 17:33
Posts: 28
Thought about something like that, but this one seems not to work...


Attachments:
hedge.vfs [28.62 KiB]
Downloaded 340 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: open hedge position Post rating: 0   Post Posted: Wed 05 Feb, 2014, 09:06 
Visual JForex expert at Dukascopy
User avatar

User rating: 27
Joined: Fri 03 May, 2013, 18:25
Posts: 366
Location: GermanyGermany
Greetings!

The problem is: what do you want to do when the hedged position is also in loss by 20 Pips?
This is one way to implement it, but I am pretty sure that you have to change your logic a bit when you want to add some components - it roughly depends on the logic of the strategy.

In addition to that, you have to know, TradeEvent startpoint generates only signals if a trade event took place (SL, TP, placed trade, open at market...) - therefore, very low amount of signals (usually).
Maybe you can explain if your strategy is just for fast market movement purposes or if it is a component of a whole strategy?


Attachments:
hedge1.vfs [28.41 KiB]
Downloaded 374 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: open hedge position Post rating: 0   Post Posted: Wed 05 Feb, 2014, 10:53 
User avatar

User rating: 0
Joined: Wed 25 Sep, 2013, 17:33
Posts: 28
hey thanks, it's more a part of a much bigger strategy, don't know yet how it'll work out but thank you anyway!

I'll keep working on it, if I encounter any other difficulties i'll come back ... :)


 
 Post subject: Re: open hedge position Post rating: 0   Post Posted: Wed 05 Feb, 2014, 13:36 
User avatar

User rating: 0
Joined: Wed 25 Sep, 2013, 17:33
Posts: 28
Since I've received such a fast response, instead of wasting more time experimenting around I'll just post my strategy and hope this way to move on faster.

Could someone please check where exactly the problem is.

The strategy is supposed to check the Stochastic Indicator on the 30m and the 5m Chart, when both are in the overbought sector the strategy sells with a 10 pip TP, when both indicators are in the oversold the strategy buys with a 10 pip TP.

Now for the Stop I wanted the strategy to open a hedging position instead, always when the strategy encounters a negative position of -15 pips.
The hedging position should have a 15 pip TP and a twice as big position size and if TP hits, the strategy is supposed to close all the open positions. If the hedging position goes -15 pips, an other hedging position should open, now 3 times the initial position size, again with a 15 pip TP and as soon as this one gets hit, the strategy is supposed to close all the open positions.

And so on...

My strategy does open hedging positions now, but it opens a huge amount of positions and it wouldn't close all the open position when it hits TP.

Any thoughts?

Thanks,
Artur


Attachments:
Scalping_Stoch_hedge.vfs [45.35 KiB]
Downloaded 380 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: open hedge position Post rating: 0   Post Posted: Fri 07 Feb, 2014, 10:31 
Visual JForex expert at Dukascopy
User avatar

User rating: 27
Joined: Fri 03 May, 2013, 18:25
Posts: 366
Location: GermanyGermany
Greetings!

So you want to set up a kind of martingale, correct?

If so please have a look at this:


Attachments:
MartinGaleUser2.vfs [57.34 KiB]
Downloaded 369 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: open hedge position Post rating: 0   Post Posted: Fri 07 Feb, 2014, 13:50 
User avatar

User rating: 0
Joined: Wed 25 Sep, 2013, 17:33
Posts: 28
yes, basically that would be what i was looking for. thank you!


 
 Post subject: Re: open hedge position Post rating: 0   Post Posted: Fri 07 Feb, 2014, 15:44 
User avatar

User rating: 0
Joined: Wed 25 Sep, 2013, 17:33
Posts: 28
actually what I was planning to create was a little bit similar though upside down in a sense. I'll try to use your strategy to learn out of and being able to modify mine.

Looking for the easiest way of making my strategy to, if a position is down a certain amount, open a counterposition and repeat that until one of the TP gets hit, in that case the strategy would close all the open positions.

If there is a much easier way to get this implemented that I don't see, please advice!


 
 Post subject: Re: open hedge position Post rating: 0   Post Posted: Mon 17 Feb, 2014, 20:28 
User avatar

User rating: 0
Joined: Wed 25 Sep, 2013, 17:33
Posts: 28
Sorry for bothering you guys but I have an other question.

How can I just implement a martingale element into a simple strategy... My idea goes as follows:

Every time price hits SL, my position size gets multiplied by for example 1.5.
As soon as price hits TP, my position size returns back to normal.

My idea behind it is to reduce losses.

For example,
- my strategy opens first position of 0.01L, 10pip TP, 10pip SL -- price reaches TP, nothing happens
- second position, same L and TP and SL -- price reaches SL, L times 1.5 (0.01*1.5)
- third position of 0.015L, same TP and SL -- price reaches SL, L times 1.5 (0.015*1.5)/price hits TP, L back to 0.01
- forth position if previous one a loss 0.0225L, if previous one profitable 0.01L
- and so on...


Id'll be great if you could help me!


 
 Post subject: Re: open hedge position Post rating: 0   Post Posted: Thu 20 Feb, 2014, 10:58 
User avatar

User rating: 0
Joined: Wed 25 Sep, 2013, 17:33
Posts: 28
thoughts? ideas?... anyone please!


 
 Post subject: Re: open hedge position Post rating: 0   Post Posted: Fri 21 Feb, 2014, 12:57 
Visual JForex expert at Dukascopy
User avatar

User rating: 27
Joined: Fri 03 May, 2013, 18:25
Posts: 366
Location: GermanyGermany
Greetings!

Actually, it is pretty easy: Please have a look at the component attached


Attachments:
multiplier_Amount.vfs [26.91 KiB]
Downloaded 366 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: open hedge position Post rating: 0   Post Posted: Fri 21 Feb, 2014, 14:03 
User avatar

User rating: 0
Joined: Wed 25 Sep, 2013, 17:33
Posts: 28
I thought it should be simple though somehow it did not work the way I was tryin it. Thanks a lot, now it makes sense!


 
 Post subject: Re: open hedge position Post rating: 0   Post Posted: Fri 21 Feb, 2014, 15:43 
User avatar

User rating: 0
Joined: Wed 25 Sep, 2013, 17:33
Posts: 28
Don't know why anytime i try to implement that part to a strategy, the strategy stops completely opening positions when I run it on the strategy tester...

I'll post an example strategy where I tried it, would be nice if you could take a look at it.


Attachments:
ScalpBB.vfs [39.14 KiB]
Downloaded 349 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: open hedge position Post rating: 0   Post Posted: Mon 24 Feb, 2014, 13:19 
Visual JForex expert at Dukascopy
User avatar

User rating: 27
Joined: Fri 03 May, 2013, 18:25
Posts: 366
Location: GermanyGermany
2 things:

- The "Lot Amount" variable is not the same, that is why there were no open positions at all
- You need to calculate the lotsize once, after that the "TradeEvent" start point will calculate the further sizes (in case of losses).


Attachments:
ScalpBB_mod.vfs [42.03 KiB]
Downloaded 341 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: open hedge position Post rating: 0   Post Posted: Mon 24 Feb, 2014, 15:28 
User avatar

User rating: 0
Joined: Wed 25 Sep, 2013, 17:33
Posts: 28
thanks, it's all still quiet complicated for me... sometimes struggling a lot with understanding how exactly the logic works.


 
 Post subject: Re: open hedge position Post rating: 0   Post Posted: Mon 24 Feb, 2014, 17:29 
User avatar

User rating: 0
Joined: Wed 25 Sep, 2013, 17:33
Posts: 28
dirk_r1 wrote:
Greetings!

So you want to set up a kind of martingale, correct?

If so please have a look at this:


hey Dirk,
a different question about the martingale strategy you posted. I tried running it on my Demo account and noticed a few problems JForex is having with the strategy. I noticed system messages like "Order REJECTED: CONDITIONAL SELL EUR/USD, REASON: Invalid price format - please use increments of 0.1 pip" appearing over and over.

Do you know why it does that and how to fix it?


 
 Post subject: Re: open hedge position Post rating: 0   Post Posted: Tue 25 Feb, 2014, 10:21 
Visual JForex expert at Dukascopy
User avatar

User rating: 27
Joined: Fri 03 May, 2013, 18:25
Posts: 366
Location: GermanyGermany
Greetings artur,

the reason for that is the entry of each position: It is based on the EMA, which is, as you know, an irrational number (double). JForex has problems to enter at those conditions, because the usually the price has 5 digits.

In that case, not every entry will be filled - that is the reason why you receive such message.

It will be fixed, hopefully, with the release of the new version this week or next week.

Cheers


 

Jump to:  

  © 1998-2025 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