Dukascopy
 
 
Wiki JStore Search Login

Strategy fails to open a trade
 Post subject: Strategy fails to open a trade Post rating: 0   New post Posted: Thu 06 Jun, 2013, 09:28 

User rating: 1
Joined: Mon 21 Jan, 2013, 09:11
Posts: 51
Location: New ZealandNew Zealand
Hi.
I have made a start developing a strategy, but the section I've completed does not open any trades.
Clearly there is an error in it, but I have not got enough understanding of the system to find a solution.
If I were to attach the vfs file would someone be able to take a look and tell me what the problem, or problems, are.
I could also send the strategy in text form, to enable you to understand what I'm trying to do .
I realise this is a big "ask" of anyone, so I am very appreciative of any help.
Thanks,
Ted


 
 Post subject: Re: Strategy fails to open a trade Post rating: 0   New post Posted: Thu 06 Jun, 2013, 10:10 
User avatar

User rating: 6
Joined: Fri 12 Apr, 2013, 14:08
Posts: 88
Location: FranceFrance
Hello

Post your .vsf and an explanation of what your strategy is suppose to do and we will check it out.


 
 Post subject: Re: Strategy fails to open a trade Post rating: 0   New post Posted: Thu 06 Jun, 2013, 10:54 

User rating: 1
Joined: Mon 21 Jan, 2013, 09:11
Posts: 51
Location: New ZealandNew Zealand
Hi.
The strategy uses the indicators DMI and Stochastic.
Instrument used is EURUSD, Period Hourly, Stochastic 5,3,SMA,3,SMS, DMI=14, and a scaling factor which I have called g with the initial value of 0.1, and the calculations should be done on the hour.

The strategy should BUY when the following conditions hold: -

+DI(now)>+DI(previous).(1+g) AND
-DI(now)<-DI(previous).(1-g) AND
%K>%D.

Close the trade if any one of these 3 conditions fails.

Thanks,
Ted


Attachments:
VJForex#8.vfs [31.82 KiB]
Downloaded 275 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: Strategy fails to open a trade Post rating: 0   New post Posted: Tue 11 Jun, 2013, 11:22 

User rating: 1
Joined: Mon 21 Jan, 2013, 09:11
Posts: 51
Location: New ZealandNew Zealand
I've gone the next step, converting the statement "Close the trade if any one of these3 conditiond fails.
That is,
if A<B, or C>D, or E < F then close the trade.

These conditions have been put into VJF boxes, as shown on the attachmen
Attachment:
VJForex#10.vfs [35.18 KiB]
Downloaded 284 times
t.


 
 Post subject: Re: Strategy fails to open a trade Post rating: 0   New post Posted: Wed 12 Jun, 2013, 08:34 
User avatar

User rating: 6
Joined: Fri 12 Apr, 2013, 14:08
Posts: 88
Location: FranceFrance
I am having a look at it.

2 things:

- try to be tidy! Just separating the modules is a challenge

- when you see a module with a red bar like this one:

Image

It means something is wrong!


Attachments:
Capture.JPG [27.04 KiB]
Downloaded 559 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: Strategy fails to open a trade Post rating: 0   New post Posted: Wed 12 Jun, 2013, 08:52 
User avatar

User rating: 6
Joined: Fri 12 Apr, 2013, 14:08
Posts: 88
Location: FranceFrance
Could you please explain that:

Image


What is gee and how its value is suppose to change? I assume it is fixes (0.1)

TemVar95 is also fixed (1).

So the result is not a variable.

ScaleUp will alwas be 1.1 and ScaleDown -0.99.

Is that what you wanted to do?


Attachments:
Capture.JPG [34.3 KiB]
Downloaded 534 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: Strategy fails to open a trade Post rating: 0   New post Posted: Wed 12 Jun, 2013, 09:03 
User avatar

User rating: 6
Joined: Fri 12 Apr, 2013, 14:08
Posts: 88
Location: FranceFrance
Compiling a strategy is always a good way to spot bugs.


 
 Post subject: Re: Strategy fails to open a trade Post rating: 0   New post Posted: Wed 12 Jun, 2013, 10:24 
User avatar

User rating: 6
Joined: Fri 12 Apr, 2013, 14:08
Posts: 88
Location: FranceFrance
Look at the strategy attached.

Look here:

Image

If you change from "Less" to "More", the strategy will open positions.


Attachments:
Capture.JPG [25.87 KiB]
Downloaded 557 times
Capture.JPG [38.23 KiB]
Downloaded 389 times
VJForex2310.vfs [45.31 KiB]
Downloaded 264 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: Strategy fails to open a trade Post rating: 0   New post Posted: Thu 13 Jun, 2013, 05:21 

User rating: 1
Joined: Mon 21 Jan, 2013, 09:11
Posts: 51
Location: New ZealandNew Zealand
The first condition for a Buy trade is
+DI(now)>+DI(prev).(1+g), and has been transformed in VJF to
posDInow>posDIprev.(1+g),
where g is a number that is to be entered before running the strategy.
The initial value of g has been set at 0.1, so that
posDInow > 10% of the value of posDIprev. That is, I'm looking for a rising value of +DI.

The second condition for a Buy trade is
negDInow < negDIprev.(1-g), that is, I'm looking for a 10% fall in the value of -DI.

I have attached a tidied up version of the strategy, and added explanatory notes to show what I've been trying to do.
But I still have 2 boxes with red bars at the top, the Stoch and the Close and CancelPosition.
1. I cannot see where the error is in Stoch.
2. The Close and CancelPositionbox would need some ID of the opening transaction, an output variable that could be the input of the Close and Cancel.
I couldn't get anything to work.
Any help would be much appreciated.


Attachments:
VJForex#10.vfs [36.64 KiB]
Downloaded 275 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: Strategy fails to open a trade Post rating: 0   New post Posted: Fri 14 Jun, 2013, 05:23 

User rating: 1
Joined: Mon 21 Jan, 2013, 09:11
Posts: 51
Location: New ZealandNew Zealand
Thank you very much for VLForex2310, and after a minor adjustment, changing g-1 to 1-g, I can hardly wait to run it. I can't run it now because the login/password are not authenticated.

There are 2 items I do not understand.
1. In the Open at Market box, there is an Output variable, Mu_pos, which does not seem to be used anywhere else. Why then is it defined?
2. Position Viewer seems to be out of the blue, unexpected and not understood.
As well, input is Open Position, where I would have expected Mu_pos.
Thanks,
Ted


 
 Post subject: Re: Strategy fails to open a trade Post rating: 0   New post Posted: Mon 17 Jun, 2013, 12:16 
Visual JForex expert at Dukascopy
User avatar

User rating:
Joined: Mon 22 Apr, 2013, 11:30
Posts: 604
Location: UkraineUkraine
Greetings.

Open at Market box Output variable saves that opened position. Then you can use it in Set SL, Set TP or Cancel boxes.

Position Viewer is cycle box. It goes through massive of positions(All,Open or Pending) and makes something on each of of it.
Example: Cancel all Pending orders, then open Buy.
Image


Attachments:
Pic1.png [107.45 KiB]
Downloaded 549 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: Strategy fails to open a trade Post rating: 0   New post Posted: Fri 21 Jun, 2013, 12:01 
User avatar

User rating: 6
Joined: Fri 12 Apr, 2013, 14:08
Posts: 88
Location: FranceFrance
Quote:
1. In the Open at Market box, there is an Output variable, Mu_pos, which does not seem to be used anywhere else. Why then is it defined?


if it is not used anywhere, than no need to define it. This variable is not created by default.

Quote:
Position Viewer seems to be out of the blue, unexpected and not understood.


This module takes ALL open positions and "agglomerates" them into one variable. The point is to use the outpu (Open_pos) in the Close and cancel position module.
You could have more than one position opened.


 

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