Dukascopy
 
 
Wiki JStore Search Login

Open order on multy cross only if open positions on each cross=0
 Post subject: Re: Open order on multy cross only if open positions on each cross=0 Post rating: 0   New post Posted: Tue 02 Jul, 2013, 09:11 
Site Administrator
User avatar

User rating:
Joined: Fri 21 Jun, 2013, 16:50
Posts: 197
Location: FranceFrance
Please ignore this message


 
 Post subject: Re: Open order on multy cross only if open positions on each cross=0 Post rating: 0   New post Posted: Tue 02 Jul, 2013, 12:21 
User avatar

User rating: 0
Joined: Fri 14 Jun, 2013, 21:26
Posts: 35
Location: Italy, Turin
test means that you are trying?


 
 Post subject: Re: Open order on multy cross only if open positions on each cross=0 Post rating: 0   New post Posted: Tue 02 Jul, 2013, 12:38 
Site Administrator
User avatar

User rating:
Joined: Fri 21 Jun, 2013, 16:50
Posts: 197
Location: FranceFrance
It was just a test mesage :) .


 
 Post subject: Re: Open order on multy cross only if open positions on each cross=0 Post rating: 0   New post Posted: Tue 02 Jul, 2013, 12:41 
Site Administrator
User avatar

User rating:
Joined: Fri 21 Jun, 2013, 16:50
Posts: 197
Location: FranceFrance
So, basically, where are you having troubles?

What function you can not work through?


 
 Post subject: Re: Open order on multy cross only if open positions on each cross=0 Post rating: 0   New post Posted: Tue 02 Jul, 2013, 15:29 
User avatar

User rating: 0
Joined: Fri 14 Jun, 2013, 21:26
Posts: 35
Location: Italy, Turin
ok, I need to set the variable if

if eurusd chain is already open, don't open new eurusd pos1

if gbpusd chain is already opene, never open new gbpusd pos1

ehya? :geek:


 
 Post subject: Re: Open order on multy cross only if open positions on each cross=0 Post rating: 0   New post Posted: Tue 02 Jul, 2013, 16:11 
Site Administrator
User avatar

User rating:
Joined: Fri 21 Jun, 2013, 16:50
Posts: 197
Location: FranceFrance
The counter will do exactly that!

IFCounter =1, THAN no more trades.


 
 Post subject: Re: Open order on multy cross only if open positions on each cross=0 Post rating: 0   New post Posted: Tue 02 Jul, 2013, 17:26 
Visual JForex expert at Dukascopy
User avatar

User rating:
Joined: Mon 22 Apr, 2013, 11:30
Posts: 604
Location: UkraineUkraine
OK. I`m Back :D

In file attached is the solution you need. And I'll add some description for it.
First, there is no counter for number of positions on specific currency pair. You need to create it in your own strategy.
Second, you need Boolean variable (can be TRUE or FALSE) in strategy to get is there any positions on eur/usd or not.
So we create these variables NoPosEUR(no positions on eur/usd) and NoPosGBP and set them TRUE.

Image

Then we use position viewer to go through all open positions and check:
If position is on eur/usd then we set NoPosEUR to FALSE
If position is on gbp/usd then we set NoPosGBP to FALSE
That means that there is at least one position on this pairs.

Image

Then we check variables we received and if it is FALSE(there is at least one position) then we do nothing if it is TRUE(no positions) then we open new position.

Image


Attachments:
Pic3.png [69.23 KiB]
Downloaded 517 times
Pic2.png [66.24 KiB]
Downloaded 552 times
Pic1.png [60.47 KiB]
Downloaded 530 times
PositionCheck.VFS [32.09 KiB]
Downloaded 310 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 order on multy cross only if open positions on each cross=0 Post rating: 0   New post Posted: Tue 02 Jul, 2013, 21:48 
User avatar

User rating: 0
Joined: Fri 14 Jun, 2013, 21:26
Posts: 35
Location: Italy, Turin
not working, look at the open date...

https://gyazo.com/3146f30c19eee6958cb0da7084f756f0


 
 Post subject: Re: Open order on multy cross only if open positions on each cross=0 Post rating: 0   New post Posted: Tue 02 Jul, 2013, 21:51 
User avatar

User rating: 0
Joined: Fri 14 Jun, 2013, 21:26
Posts: 35
Location: Italy, Turin
here is the vfs

I have also noticed that if the position 1 reach sl, it dosn't open pos2 and so on... please help me out...


Attachments:
test_new_july.vfs [94.11 KiB]
Downloaded 315 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 order on multy cross only if open positions on each cross=0 Post rating: 0   New post Posted: Wed 03 Jul, 2013, 09:15 
Site Administrator
User avatar

User rating:
Joined: Fri 21 Jun, 2013, 16:50
Posts: 197
Location: FranceFrance
The solution I have proposed (counter) was working properly, but well...
I still think it is the best option (at least the only one that does work properly).
Good luck.


 
 Post subject: Re: Open order on multy cross only if open positions on each cross=0 Post rating: 0   New post Posted: Wed 03 Jul, 2013, 13:03 
Visual JForex expert at Dukascopy
User avatar

User rating:
Joined: Mon 22 Apr, 2013, 11:30
Posts: 604
Location: UkraineUkraine
seancappone wrote:
not working, look at the open date...

https://gyazo.com/3146f30c19eee6958cb0da7084f756f0


What do I supposed to see in "open date" ?

If it is "not working" then how it should work properly?

Describe whole LOGIC of the strategy. Because nobody understands here what do you want to get from the strategy.
Until you describe it properly, nobody can help you here.


 
 Post subject: Re: Open order on multy cross only if open positions on each cross=0 Post rating: 0   New post Posted: Wed 03 Jul, 2013, 13:22 
Site Administrator
User avatar

User rating:
Joined: Fri 21 Jun, 2013, 16:50
Posts: 197
Location: FranceFrance
Quote:
nobody


Who is "nobody"? :mrgreen:


 
 Post subject: Re: Open order on multy cross only if open positions on each cross=0 Post rating: 0   New post Posted: Wed 03 Jul, 2013, 15:02 
User avatar

User rating: 0
Joined: Fri 14 Jun, 2013, 21:26
Posts: 35
Location: Italy, Turin
I thought it was clear.

ok, let's go by step

1- we got 2 chains, 1 is eurusd, the second is gbpusd
2- the chain is considered closed if there are no more position of that chain open (no eurusd position open means eurusd chain closed)
3- if pos1 eurusd reach stop loss, the strategy must open pos2 eurusd and so on... (pos3, pos4....). if pos1 reach tp, the chain is complete, and the strategy must open a new pos1 eurusd (that will start a new eurusd chain).
4- if a chain is already open, the strategy should not open 2 times the same chain (1 eurusd chain per time for example)

the strategy works between 14 and 17 on each tick, ask or bid, dosn't metter the direction.

Please tell me wich number is not clear...

I hope is clear this time. I have no other ideas about how to explain this....


 
 Post subject: Re: Open order on multy cross only if open positions on each cross=0 Post rating: 0   New post Posted: Wed 03 Jul, 2013, 15:41 
User avatar

User rating: 0
Joined: Fri 14 Jun, 2013, 21:26
Posts: 35
Location: Italy, Turin
I hope this will help you out to understand...

Image


 
 Post subject: Re: Open order on multy cross only if open positions on each cross=0 Post rating: 0   New post Posted: Wed 03 Jul, 2013, 16:43 
Site Administrator
User avatar

User rating:
Joined: Fri 21 Jun, 2013, 16:50
Posts: 197
Location: FranceFrance
I personally do not understand this
Quote:
chain
and
Quote:
pos1
things.


 
 Post subject: Re: Open order on multy cross only if open positions on each cross=0 Post rating: 0   New post Posted: Wed 03 Jul, 2013, 16:46 
Site Administrator
User avatar

User rating:
Joined: Fri 21 Jun, 2013, 16:50
Posts: 197
Location: FranceFrance
Suggestion:

First build a strategy with only one pair and one direction.

Once it works the way you want, add the other direction.

Than add the other pair.

That is the way I work.


 

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