Dukascopy
 
 
Wiki JStore Search Login

How to modify order entry price?
 Post subject: How to modify order entry price? Post rating: 0   New post Posted: Tue 02 May, 2017, 09:30 
User avatar

User rating: 2
Joined: Sat 05 May, 2012, 13:08
Posts: 33
Location: ItalyItaly
Hi everyone,

cannot find a way to modify the entry price for a pending order.
Do I just need to cancel the existing order and set a new one?! Would be better to modify it....

Someone can help¿?


 
 Post subject: Re: How to modify order entry price? Post rating: 0   New post Posted: Tue 02 May, 2017, 14:13 
Visual JForex expert at Dukascopy
User avatar

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

I see ... I recommend you the use of "Assign" block as following:
- Once your Pending block setup, create a dedicated variable for your entry price and define it as per your requirement.
- when you need to change the price of the above initial entry, insert the conditions of such update and once these conditions met, use an assign block with the new price value to be assigned to the first "Entry price". Then link the chain to the Pending entry block and the job is done !

Cheers


 
 Post subject: Re: How to modify order entry price? Post rating: 0   New post Posted: Tue 02 May, 2017, 19:56 
User avatar

User rating: 2
Joined: Sat 05 May, 2012, 13:08
Posts: 33
Location: ItalyItaly
Ok thanks for the explanation! Will try and check this way!
Meanwhile I found a way through a multiple exec block, which will cancel the pending order before eventually re open it later if conditions are met. Seems working fine atm...
;)


 
 Post subject: Re: How to modify order entry price? Post rating: 0   New post Posted: Wed 03 May, 2017, 11:18 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Yes what you said is another alternative:
Use Position viewer with "Pending Positions" as input and then implement a cancel / replace with the new price entry as you said


 
 Post subject: Re: How to modify order entry price? Post rating: 0   New post Posted: Wed 03 May, 2017, 14:33 
User avatar

User rating: 2
Joined: Sat 05 May, 2012, 13:08
Posts: 33
Location: ItalyItaly
I thought would be nice to post the picture about the portion of the actual strategy.


Image

-1-
This way, there are 3 actions done everytime the code gets a new candle:
-check if there are pending sell orders and close them
-check if there are pending buy orders and close them
-go to the next step and in case conditions are met, new orders will be executed.

-2-
I know it would cost lot of work for that, and probably the function would not be used so much since most of strategies work with direct market orders... but... having a "set entry price" there.... would have been nice :P

Btw, in jforex coding, the command order.setOpenPrice() ended up in canceling the actual order and creating a new one with new parameters, that's how I came to the conclusion to simply cancel it and later create a new one.
Still had no time to test the assign block but I suspect it would somehow cancel the order and create a new one since that's what actually happens when we modify an order (I mean, from the platform).

:idea:


Attachments:
VisualJForex.png [203.06 KiB]
Downloaded 328 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: How to modify order entry price? Post rating: 0   New post Posted: Thu 04 May, 2017, 13:59 
Visual JForex expert at Dukascopy
User avatar

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

At the level of the code and the trading system it is indeed a Cancel / Replace command that is effectively executed. Please check the the example attached where I used an assign block to update the entry price.


Attachments:
CancelReplace.vfs [28.81 KiB]
Downloaded 176 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: How to modify order entry price? Post rating: 0   New post Posted: Fri 05 May, 2017, 11:35 
User avatar

User rating: 2
Joined: Sat 05 May, 2012, 13:08
Posts: 33
Location: ItalyItaly
amine_chourou wrote:
Hi there,

At the level of the code and the trading system it is indeed a Cancel / Replace command that is effectively executed. Please check the the example attached where I used an assign block to update the entry price.



Ok I see, thanks!
Considering the whole strategy concept will be better the other way, so on new candle cancel the pending order then set a new one in case conditions are met!


 

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