Dukascopy
 
 
Wiki JStore Search Login

export variable
 Post subject: export variable Post rating: 0   New post Posted: Thu 15 Dec, 2016, 00:31 

User rating: 0
Joined: Mon 26 Sep, 2016, 11:57
Posts: 11
Location: United Arab EmiratesUnited Arab Emirates
Hi

I have 2 EA Runs at the same time and I want to make the second Ea reads a variable from the first one

as if one strategy export a signal and the other read that signal and open order

Could you please show an example for it , I tried with the loop viewer but it wasn't good


 
 Post subject: Re: export variable Post rating: 0   New post Posted: Thu 15 Dec, 2016, 16:36 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

There is a specific way to do that in Visual JForex:
1/ Build your 1st strategy (the signal provider) and click on Compiler Build
2/ Open your 2nd strategy and from the right section go to "My Strategies" then drag and drop your strategy as it is in the workspace. Then link it your conditions and make sure the strategy used as a block is connected to the 3 start points.

Attached is an example ..


Attachments:
BollingerBand_Example.vfs [33.43 KiB]
Downloaded 97 times
Trade_Signals.vfs [28.38 KiB]
Downloaded 102 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: export variable Post rating: 0   New post Posted: Sat 17 Dec, 2016, 08:20 

User rating: 0
Joined: Mon 26 Sep, 2016, 11:57
Posts: 11
Location: United Arab EmiratesUnited Arab Emirates
Thanks Mr.amine

Could you please Explain More How The loop Function Work in general

in the example You have given we got the last signal from The Variable "Tradingsignals_Detailed" .. How we can get all the previous signal ?

can we give every signal an automatic unique new variable name .. Like " signal1 , signal2 , ... " I used to do this by adding a variable (x) to the name signal and each time I add (+1) to the name and I cant see it in vjforex


 
 Post subject: Re: export variable Post rating: 0   New post Posted: Mon 19 Dec, 2016, 11:02 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

The example I sent is based on 10mn trading period, How far is your look-back for previous signals ? in other words how many past signals you want to retrieve ?
In general, we use the shift variable to get past data; Shift 1 refers to the previous candle 2 to the one before etc..
More information regarding this in the user guide that you can find under Help menu.

Thanks


 
 Post subject: Re: export variable Post rating: 0   New post Posted: Tue 20 Dec, 2016, 08:47 

User rating: 0
Joined: Mon 26 Sep, 2016, 11:57
Posts: 11
Location: United Arab EmiratesUnited Arab Emirates
Hi

thanks for your advise .. I have read the whole guide and it was useful indeed

and I am still looking for a solution to this

1 - I want to export a " string " variable and I would like to make it readable by other strategy , to do that I would've follow the example you have given , and insert the strategy as a block
now consider I don't want to insert it as a block , if I make the " string Variable " parameter set to global would that be good ?

2 - how to make an array of variable , in this example we have a variable named String1 , now how to do the following
if string1 have value then next time go for string2 then string3, string4 ... and so on ,, usually I would go for a variable x added to the name string and make it plus 1 each time a condition meet , but I cant find it in vjforex

Thanks


Attachments:
StringExport.vfs [18.21 KiB]
Downloaded 85 times
Stringretrive.vfs [19.68 KiB]
Downloaded 87 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: export variable Post rating: 0   New post Posted: Tue 20 Dec, 2016, 14:57 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

1/ Workaround without strategies used as a block: take your signal provider strategy and define manually your signals : I believe there is not many of them such as position long, short etc .. I would think about using Boolean variable for instance that takes the value True if Long conditions are met and false for short conditions. You can use as much boolean variables as needed.
You'll have then a strategy that triggers kind of signals without effectively trading.

2/ Unfortunately the creation of custom arrays is not yet available but it is something we're currently analyzing.
In your case, I believe the use of counter could achieve the idea: IF signal1 is triggered then increment the counter by 1 and so on till you reach a certain level for your counter.
You may need to reset the counter at a given level depending on the logic of your strategy. In any case, the counter will be reset to its initial value if the strategy is stopped.


 
 Post subject: Re: export variable Post rating: 0   New post Posted: Wed 21 Dec, 2016, 10:22 

User rating: 0
Joined: Mon 26 Sep, 2016, 11:57
Posts: 11
Location: United Arab EmiratesUnited Arab Emirates
ok Thanks for your help Mr.Amine

I did try to build a strategy to retrieve information and each time I get an error

could you please tell me whats the problem

the first EA one gives info about a Boolean variable and a double variable

the second EA try to read those info

thanks in advance


Attachments:
TestExport.vfs [17.54 KiB]
Downloaded 92 times
TestRetrive.vfs [30.31 KiB]
Downloaded 97 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.
 
The Best Answer  Post subject: Re: export variable Post rating: 0   New post Posted: Wed 21 Dec, 2016, 16:00 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,
Alright, I'll check this and get back to you asap.
Thx !


 
 Post subject: Re: export variable Post rating: 0   New post Posted: Thu 22 Dec, 2016, 08:44 

User rating: 0
Joined: Mon 26 Sep, 2016, 11:57
Posts: 11
Location: United Arab EmiratesUnited Arab Emirates
Thanks Mr.Amine .. I appreciate your hard work


 
 Post subject: Re: export variable Post rating: 0   New post Posted: Thu 29 Dec, 2016, 09:52 

User rating: 0
Joined: Mon 26 Sep, 2016, 11:57
Posts: 11
Location: United Arab EmiratesUnited Arab Emirates
Still Waiting :roll:


 
 Post subject: Re: export variable Post rating: 0   New post Posted: Thu 29 Dec, 2016, 15:34 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

I found couple of issues when testing your example and this may take time to be fixed. I rely on your patience on this matter.
Meanwhile, have you tried this solution :

Quote:
1/ Workaround without strategies used as a block: take your signal provider strategy and define manually your signals : I believe there is not many of them such as position long, short etc .. I would think about using Boolean variable for instance that takes the value True if Long conditions are met and false for short conditions. You can use as much boolean variables as needed.
You'll have then a strategy that triggers kind of signals without effectively trading.

?


 
 Post subject: Re: export variable Post rating: 0   New post Posted: Sun 08 Jan, 2017, 16:15 

User rating: 0
Joined: Mon 26 Sep, 2016, 11:57
Posts: 11
Location: United Arab EmiratesUnited Arab Emirates
Thanks Mr.Amine ,, and I m still waiting for your response.

about your question .. you mean I can make tow strategy and link them by defining The same variable name in each one

like in st1 : a = 1
st2 : a = 0 , and If a=1 then open buy .. for example

it works like these ?


 
 Post subject: Re: export variable Post rating: 0   New post Posted: Wed 11 Jan, 2017, 16:59 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

Thanks for your patience in this matter.
Regarding my last post: The idea is to create Boolean variables within the same strategy and use them as kind of signals. Attached an example: If Red Candle the signal is represented with GoShort that switches to True value and vice versa in case of green candle.

I'm not anymore about your final requirement and the goal of your trading idea. Maybe there is simple ways to achieve this without going through such complex implementations.
Can you please summarize your trading idea in detail and elaborate on the need of having 2 separate strategies with one reading data from another ?


Attachments:
TriggerStrat.vfs [21.84 KiB]
Downloaded 97 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: export variable Post rating: 0   New post Posted: Sat 14 Jan, 2017, 14:02 

User rating: 0
Joined: Mon 26 Sep, 2016, 11:57
Posts: 11
Location: United Arab EmiratesUnited Arab Emirates
well it`s a sample idea that calculate the signals in the first EA and then generate the data expressed in ( String Or Double )

for the second Ea,it Reads the ( String o Double ) Data and also do more caculation , you could say the first one is just to calculate the INFO and I need it that way

waiting your response Mr Amine


 
 Post subject: Re: export variable Post rating: 0   New post Posted: Mon 16 Jan, 2017, 14:53 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,


You can replace the Boolean variable in the example sent earlier by a string or double variable type and give it any value you wish. Then to make the second strategy reading this value you have to modify the code directly in Java but I can't help you anymore at this stage. Please check the "Automated trading" section of this forum for more information;

Thx


 
 Post subject: Re: export variable Post rating: 0   New post Posted: Tue 24 Jan, 2017, 14:37 

User rating: 0
Joined: Mon 26 Sep, 2016, 11:57
Posts: 11
Location: United Arab EmiratesUnited Arab Emirates
amine_chourou wrote:
Hi,
Alright, I'll check this and get back to you asap.
Thx !


Hi

you still didnt answear my question in the fifth replay and it`s been over a month now :geek:

could you tell me what`s wrong in these examples which I did according to the one you provided in the second replay !!


Attachments:
Stringretrive.vfs [19.68 KiB]
Downloaded 99 times
StringExport.vfs [18.21 KiB]
Downloaded 110 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: export variable Post rating: 0   New post Posted: Tue 24 Jan, 2017, 16:32 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

Thanks for your patience in this matter.
Unfortunately there is still an open issue related to the example that I've sent you which blocks such implementation: When a strategy is used as a block, any custom variable is embedded and cannot be read or used unless you work with the full strategy build (Not as a single block) which is the alternative solution I proposed later after that post.

At this stage, I believe that your requirement can be only achieved with Java coding straight using a variable exported locally in your computer and another strategy reading its content. This requires "full access" to your computer for both strategies (Any remote run is forbidden when using such feature). You may find more information in the automated trading section of this forum:
https://www.dukascopy.com/swiss/english ... m.php?f=65

Else, the only solution I see currently is to use a single strategy in VJF as described earlier.

Hope this helps

Thanks


 

Jump to:  

cron
  © 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