Dukascopy
 
 
Wiki JStore Search Login

Strategy start on first transaction
 Post subject: Strategy start on first transaction Post rating: 0   New post Posted: Wed 24 Apr, 2013, 12:15 

User rating: 0
Joined: Wed 24 Apr, 2013, 12:11
Posts: 7
Hello, I am looking for a way to start a strategy after i make a position.

Example: I buy eur/usd manually, and after this the strategy starts running by itself.


 
 Post subject: Re: Strategy start on first transaction Post rating: 0   New post Posted: Wed 24 Apr, 2013, 12:42 
Visual JForex expert at Dukascopy
User avatar

User rating: 4
Joined: Fri 06 Feb, 2009, 16:34
Posts: 130
bufferpl wrote:
Hello, I am looking for a way to start a strategy after i make a position.

Example: I buy eur/usd manually, and after this the strategy starts running by itself.

It is quite easy, see examples.
You need to create check for filling or opening the position, and set the appropriate variable "isStrategyStart".


Attachments:
checkTradebeforeStart.vfs [18.96 KiB]
Downloaded 422 times
CheckTradebeforeStart.PNG [124.91 KiB]
Downloaded 463 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 start on first transaction Post rating: 0   New post Posted: Wed 24 Apr, 2013, 18:55 

User rating: 0
Joined: Wed 24 Apr, 2013, 12:11
Posts: 7
Thanks a lot for respose. Unfortunately I'm not very good at this.
Now im trying to make the strategy set a stop loss for my manual transaction, and if that SL triggers, open a new transaction with SL and TP and so on.
I am unable to do it, so if You could provide me some kind of template for this or example i could work on, it would be great.
Cheers and thanks a lot.


 
 Post subject: Re: Strategy start on first transaction Post rating: 0   New post Posted: Thu 25 Apr, 2013, 08:47 
Visual JForex expert at Dukascopy
User avatar

User rating: 4
Joined: Fri 06 Feb, 2009, 16:34
Posts: 130
bufferpl wrote:
Now im trying to make the strategy set a stop loss for my manual transaction, and if that SL triggers, open a new transaction with SL and TP and so on.

See the examples.
The idea, that from TradeEvent you can get the message type, you can check it and do what you need with this position.


Attachments:
checkTradebeforeStart.vfs [27.51 KiB]
Downloaded 421 times
CheckTradebeforeStart2.PNG [215.99 KiB]
Downloaded 485 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 start on first transaction Post rating: 0   New post Posted: Thu 25 Apr, 2013, 12:35 

User rating: 0
Joined: Wed 24 Apr, 2013, 12:11
Posts: 7
Thanks again, now i think im slowly getting the hang of it, but i don't know how to tell the IF operator wheather my transaction ended with SL or TP. I need to open different transactions for SL and TP, and i think i got the logic correct, just don't know witch parameters to input.
I attach the example.

Image


Attachments:
forx.jpg [187.07 KiB]
Downloaded 774 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 start on first transaction Post rating: 0   New post Posted: Thu 25 Apr, 2013, 12:59 
Visual JForex expert at Dukascopy
User avatar

User rating: 4
Joined: Fri 06 Feb, 2009, 16:34
Posts: 130
bufferpl wrote:
Thanks again, now i think im slowly getting the hang of it, but i don't know how to tell the IF operator wheather my transaction ended with SL or TP. I need to open different transactions for SL and TP, and i think i got the logic correct, just don't know witch parameters to input.

Thanks for example. But as we can see the image is wrong.
1) First the Open at Market, already has definitions for SL and TP inside this block
2) You connect the "Position Fill" from Open at Market to the Multiple Action, and then you use the TradeEvent message in case Position.Reject - it can not be so, becouse the Position cant be Filled and Rejected simultaneusly.
We reccomend you to use the TradeEvent start point, if the any Position will be filled (check it with IF blocl), then set to this position needed SL and TP, with separate blocks.
We hope that this helps.


 
 Post subject: Re: Strategy start on first transaction Post rating: 0   New post Posted: Thu 25 Apr, 2013, 13:25 

User rating: 0
Joined: Wed 24 Apr, 2013, 12:11
Posts: 7
Im not sure if we understand eachother correctly.
Im not trying to set the SL or TP but if transaction ended with TP open new transaction and if it ended with SL i want to open other transaction, like in the example.
Image


Attachments:
forx.jpg [239.59 KiB]
Downloaded 818 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 start on first transaction Post rating: 0   New post Posted: Fri 26 Apr, 2013, 08:18 
Visual JForex expert at Dukascopy
User avatar

User rating: 4
Joined: Fri 06 Feb, 2009, 16:34
Posts: 130
bufferpl wrote:
Thanks again, now i think im slowly getting the hang of it, but i don't know how to tell the IF operator wheather my transaction ended with SL or TP. I need to open different transactions for SL and TP,

Let's try to figure out the strategy requirements one more time. As you wrote above, you need to open one "type" of order
if a previous order was closed by a stop loss price, and another "type" of order if a previous order was closed by a take profit price.
If you make first order manually and then your strategy has to manage SL or TP, you have to use the "ProfitLoss in USD" or the "ProfitLoss in Pips" value from the TradeEvent section.
Please see the example below.
Image


Attachments:
TradeEvent.jpg [251.79 KiB]
Downloaded 770 times
TradeEvent.vfs [21.73 KiB]
Downloaded 409 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 start on first transaction Post rating: 0   New post Posted: Sun 28 Apr, 2013, 11:58 

User rating: 0
Joined: Wed 24 Apr, 2013, 12:11
Posts: 7
Thanks a lot for help. I just need two more things.

1.If closed position was BUY then the new one open SELL.
2. How to loop it all: after few transactions go back to first transaction.

Cheers and thanks again.


 
 Post subject: Re: Strategy start on first transaction Post rating: 0   New post Posted: Mon 29 Apr, 2013, 10:33 
Visual JForex expert at Dukascopy
User avatar

User rating: 4
Joined: Fri 06 Feb, 2009, 16:34
Posts: 130
bufferpl wrote:
1.If closed position was BUY then the new one open SELL.
2. How to loop it all: after few transactions go back to first transaction.

1. Check the example. You need just to use the closed position type to check it.
2. Can you describe more what exactly you need? Why you need the first transaction data?
You can use to store the data with new variable and "Assign" block.


Attachments:
TradeEvent2.vfs [21.59 KiB]
Downloaded 400 times
TradeEvent2.PNG [142.06 KiB]
Downloaded 405 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 start on first transaction Post rating: 0   New post Posted: Mon 29 Apr, 2013, 15:23 

User rating: 0
Joined: Wed 24 Apr, 2013, 12:11
Posts: 7
Thanks.

I need strategy to run forever in a loop. Like in the example.
Image


Attachments:
forex.png [18.32 KiB]
Downloaded 687 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 start on first transaction Post rating: 0   New post Posted: Mon 29 Apr, 2013, 15:47 
Visual JForex expert at Dukascopy
User avatar

User rating: 4
Joined: Fri 06 Feb, 2009, 16:34
Posts: 130
bufferpl wrote:
I need strategy to run forever in a loop. Like in the example.
Image

You already has a loop (in our example), becouse the new Transaction will generates according TradeEvent.
Or you can choose the "blue" flow outs from trading blocks.
Just try the strategy in action, on historical tester.


 

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