Dukascopy
 
 
Wiki JStore Search Login

Open a New Pending Order when previous close: how can I Fix it?
 Post subject: Open a New Pending Order when previous close: how can I Fix it? Post rating: 0   Post Posted: Fri 23 Aug, 2013, 12:27 
User avatar

User rating: 0
Joined: Mon 15 Jul, 2013, 11:59
Posts: 49
Location: Spain, Madrid
Hi everyone;

Just I was working hard a new strategy, and i got problems building it.

The strategy goes like that: 5 STEPS

1. calculate high and low of the previous day (yesterday´s high and low)
2. Set a pending Order Buy
3. set a stop loss
4. set a take profits
5. When the pending order had filled and close by Take profit or Stop loss, THEN AND JUST THEN OPEN A NEW PENDING ORDER THE SAME LIKE PREVIOUS (2. Set a pending Order Buy)*****

Could you help me whit this last step. I am trapped whit the estrategy. :(

see the strategy below. All the comments will be appreciate. THANKS


Attachments:
Strategynotes.vfs [58.91 KiB]
Downloaded 582 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 a New Pending Order when previous close: how can I Fix it? Post rating: 0   Post Posted: Fri 23 Aug, 2013, 12:54 
User avatar

User rating: 0
Joined: Mon 15 Jul, 2013, 11:59
Posts: 49
Location: Spain, Madrid
Sorry The file looks like break. Ill send a new one. Check that out, thanks :D


Attachments:
hlx9.vfs [58.69 KiB]
Downloaded 516 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 a New Pending Order when previous close: how can I Fix it? Post rating: 0   Post Posted: Mon 26 Aug, 2013, 08:10 
Site Administrator
User avatar

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

So basically, you want to submit a pending order if no position is open AND no pending orders.


The idea is to check that before you launch the rest of the strategy.

Image


Attachments:
Capture.JPG [50.69 KiB]
Downloaded 1058 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 a New Pending Order when previous close: how can I Fix it? Post rating: 0   Post Posted: Mon 26 Aug, 2013, 09:56 
User avatar

User rating: 0
Joined: Mon 15 Jul, 2013, 11:59
Posts: 49
Location: Spain, Madrid
Hi Bruno:

Nice to see you.


Il try like that but did not work. Could you check my strategy.

Still opening new order all the time when the price is higher than the pending order open price. I just want to open 1 order each time (untill the order finish by SL or TP) and then open a new one order...and on and on for all they long.

Thanks

Gonzalez :D
Image
Image


Attachments:
if.png [80.68 KiB]
Downloaded 890 times
if.png [76.74 KiB]
Downloaded 998 times
hlx7.vfs [58.67 KiB]
Downloaded 609 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 a New Pending Order when previous close: how can I Fix it? Post rating: 0   Post Posted: Mon 26 Aug, 2013, 10:18 
Site Administrator
User avatar

User rating:
Joined: Fri 21 Jun, 2013, 16:50
Posts: 197
Location: FranceFrance
Quote:
Il try like that but did not work.


This is to short. Could you please explain? Was it opening when not suppose to, or not opening when it should? or what?

In the strategy you ahve attached, you are NOT using the solution I have provided to you.


 
 Post subject: Re: Open a New Pending Order when previous close: how can I Fix it? Post rating: 0   Post Posted: Mon 26 Aug, 2013, 10:29 
User avatar

User rating: 0
Joined: Mon 15 Jul, 2013, 11:59
Posts: 49
Location: Spain, Madrid
Hi:


The strategy is simple, goes like that:

Calculate high and low from yesterday.

There is just a PENDING OPEN buy when the price break out the higher. Then Calculate a Stop loss and take profit prices. And That looks like fine.

But the problem is that whe i run the strategy, all the time buys new and new positions (a lot of). And should wait to buy after the order is close (by SL or TP prices). And doesnt work either with the CONDICIONALS IF. Got any Idea?


If you have any question let me know. thanks
Image


Attachments:
Ifcondicional.png [44.4 KiB]
Downloaded 923 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 a New Pending Order when previous close: how can I Fix it? Post rating: 0   Post Posted: Mon 26 Aug, 2013, 11:01 
Site Administrator
User avatar

User rating:
Joined: Fri 21 Jun, 2013, 16:50
Posts: 197
Location: FranceFrance
Quote:
Got any Idea?


My idea was to implement the 2 blocks at the beginning of the code, so it does not go forward if conditions are not set.


Image


Attachments:
Capture.JPG [47 KiB]
Downloaded 984 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 a New Pending Order when previous close: how can I Fix it? Post rating: 0   Post Posted: Mon 26 Aug, 2013, 11:09 
User avatar

User rating: 0
Joined: Mon 15 Jul, 2013, 11:59
Posts: 49
Location: Spain, Madrid
Sorry Bruno, but I dont know where implement the 2 blocks (IF)at the beginning of the code. Could you just change it in my strategy? Because I really dont know How should be conected this two blocks.

Thanks again


Attachments:
hlx7.vfs [58.67 KiB]
Downloaded 490 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 a New Pending Order when previous close: how can I Fix it? Post rating: 0   Post Posted: Tue 27 Aug, 2013, 08:22 
Site Administrator
User avatar

User rating:
Joined: Fri 21 Jun, 2013, 16:50
Posts: 197
Location: FranceFrance
I am reviewing the whole strategy.

Meanwhile:


Image

This is a very bad practise. You should always give a relevant name to the variables you create.


Attachments:
Capture.JPG [24.51 KiB]
Downloaded 853 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 a New Pending Order when previous close: how can I Fix it? Post rating: 0   Post Posted: Tue 27 Aug, 2013, 10:02 
Site Administrator
User avatar

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

Your strategy looks very complicated, is not commented, contains a lot of variables with irrelevant names ans some variables are not even defined.

Also, I could not get what is this strategy suppose to do (especially in terms of target price, stop loss and take profit).

So, the strategy attached will take the high from yesterday and set it as target price for the pending order.

A conditional order will be submitted every 10 minutes, providing no order is pending and no position open.

From here, you can add blocks to match your idea.


Attachments:
hlx7_1.vfs [29.32 KiB]
Downloaded 539 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 a New Pending Order when previous close: how can I Fix it? Post rating: 0   Post Posted: Tue 27 Aug, 2013, 12:18 
User avatar

User rating: 0
Joined: Mon 15 Jul, 2013, 11:59
Posts: 49
Location: Spain, Madrid
I run the strategy and still buying a hole bunch of orders as you can see.
Image


Attachments:
imag.png [110.04 KiB]
Downloaded 1004 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 a New Pending Order when previous close: how can I Fix it? Post rating: 0   Post Posted: Tue 27 Aug, 2013, 12:53 
Site Administrator
User avatar

User rating:
Joined: Fri 21 Jun, 2013, 16:50
Posts: 197
Location: FranceFrance
Quote:
still buying a hole bunch of orders as you can see.


So what?

You wrote that you did not want an order submitted if another one was pending or if a position was open.

You can check yourself, the condition is respected:


Image

A lot of positions are opened because the stop loss or take profit is triggered.

Remove the stop loss and take profit features and you will see: only one position is going to be opened.


Attachments:
Capture.JPG [223.18 KiB]
Downloaded 947 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 a New Pending Order when previous close: how can I Fix it? Post rating: 0   Post Posted: Tue 27 Aug, 2013, 13:29 
User avatar

User rating: 0
Joined: Mon 15 Jul, 2013, 11:59
Posts: 49
Location: Spain, Madrid
Sorry Bruno but what I wrote (because I ned it to implement in my real account) is that; When the pending order had filled and close by Take profit or Stop loss, THEN AND JUST THEN OPEN A NEW PENDING ORDER THE SAME LIKE PREVIOUS (2. Set a pending Order Buy)*****

And as you can check it out the strategy that send me Open a lot of orders and close it and didnt respect the SL 25 pibs that you set. See the picture that I sent.

;)


 
The Best Answer  Post subject: Re: Open a New Pending Order when previous close: how can I Fix it? Post rating: 1   Post Posted: Wed 28 Aug, 2013, 14:28 
Visual JForex expert at Dukascopy
User avatar

User rating:
Joined: Mon 22 Apr, 2013, 11:30
Posts: 604
Location: UkraineUkraine
RE:
When the pending order had filled and close by Take profit or Stop loss, THEN AND JUST THEN OPEN A NEW PENDING ORDER THE SAME LIKE PREVIOUS (2. Set a pending Order Buy)*****

Example will work exactly for your request :
download/file.php?mode=view&id=4400


Attachments:
TPSL_open.vfs [22.35 KiB]
Downloaded 640 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.
 

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