Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Submit JForex API function requests in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

Please add side parameter (BID/ASK) to setTakeProfitPrice method
 Post subject: Please add side parameter (BID/ASK) to setTakeProfitPrice method Post rating: 0   New post Posted: Wed 17 Oct, 2018, 04:14 
User avatar

User rating: 2
Joined: Fri 27 Jul, 2012, 07:04
Posts: 82
Location: Spain, Paracuellos de Jarama
Please, can you add side parameter (BID/ASK) to setTakeProfitPrice method?

Cheers

Francisco


 
 Post subject: Re: Please add side parameter (BID/ASK) to setTakeProfitPrice method Post rating: 0   New post Posted: Wed 17 Oct, 2018, 06:42 

User rating: 18
Joined: Thu 20 Apr, 2017, 22:42
Posts: 165
Location: Russian Federation,
I'm curious what logic do you have behind this request. How this should work?


 
 Post subject: Re: Please add side parameter (BID/ASK) to setTakeProfitPrice method Post rating: 0   New post Posted: Wed 17 Oct, 2018, 07:41 
User avatar

User rating: 2
Joined: Fri 27 Jul, 2012, 07:04
Posts: 82
Location: Spain, Paracuellos de Jarama
It goes like this:

I work with Bid charts, my calculations only use Bid prices:

I set my entry levels using Bid price:
When Bid price reach X level I enter buying
When Bid price reach Y level I enter selling

I set my stop loss levels using Bid price:
When Bid price reach W level stop loss is triggered

But I can't use a Bid price to set my exit level with profit when I have a short trade as the TakeProfit of a short trade is triggered by Ask price.

Cheers
Francisco


 
 Post subject: Re: Please add side parameter (BID/ASK) to setTakeProfitPrice method Post rating: 0   New post Posted: Wed 17 Oct, 2018, 18:41 

User rating: 18
Joined: Thu 20 Apr, 2017, 22:42
Posts: 165
Location: Russian Federation,
Oh, I see your background but i think you'll need to adjust you calculations for using 'asks' :) ...
Take a look a the picture below - BUY is closed at Bid price. In reverse direction - SELL is closed at Ask price (was opened at Bid). It is how Forex and all trading works, it does not come from Dukascopy.
What you are asking actually is 'close my SELL at Bid price and forget about your dummy spread just for me'.

https://learningcenter.fxstreet.com/education/learning-center/unit-1/chapter-3/measuring-the-trade/index.html
Image


 
 Post subject: Re: Please add side parameter (BID/ASK) to setTakeProfitPrice method Post rating: 0   New post Posted: Wed 17 Oct, 2018, 20:57 
User avatar

User rating: 2
Joined: Fri 27 Jul, 2012, 07:04
Posts: 82
Location: Spain, Paracuellos de Jarama
<<What you are asking actually is 'close my SELL at Bid price and forget about your dummy spread just for me'.>>

No.

I know that my short trade will be closed at the ask price. But I want the closing order triggered when the Bid price of my election is reached.

Just like when I use: argument_1.setStopLossPrice(stopLoss, OfferSide.BID)

So I will pay the spread available at closing time.

Cheers

Francisco


 
 Post subject: Re: Please add side parameter (BID/ASK) to setTakeProfitPrice method Post rating: 0   New post Posted: Wed 17 Oct, 2018, 22:27 

User rating: 18
Joined: Thu 20 Apr, 2017, 22:42
Posts: 165
Location: Russian Federation,
Ok, got it.

So, to be 'complete' and 'correctly understood', your very first post should be something like
Quote:
Please, add side parameter (BID/ASK) to setTakeProfitPrice() method with the logic similar to the one already available in IOrder.setStopLossPrice(double price, OfferSide side) and IOrder.getStopLossSide().

(PS: since such method was not created initially and was not yet added for rather loong time - probably Dukascopy has some reasoning behind it.)


 
 Post subject: Re: Please add side parameter (BID/ASK) to setTakeProfitPrice method Post rating: 0   New post Posted: Wed 17 Oct, 2018, 22:40 

User rating: 18
Joined: Thu 20 Apr, 2017, 22:42
Posts: 165
Location: Russian Federation,
Side note: actually this approach looks somewhat dangerous to me. There are times at market when spread become really unhealthy - just before closing for weekends and before major news. It may happen that with 'TP by bid for SELLs' you'll lose rather many pips at such moments ...


 
 Post subject: Re: Please add side parameter (BID/ASK) to setTakeProfitPrice method Post rating: 0   New post Posted: Sun 04 Aug, 2019, 06:07 
User avatar

User rating: 2
Joined: Fri 27 Jul, 2012, 07:04
Posts: 82
Location: Spain, Paracuellos de Jarama
Thanks for your post.

mtnfx wrote:
Side note: actually this approach looks somewhat dangerous to me. There are times at market when spread become really unhealthy - just before closing for weekends and before major news. It may happen that with 'TP by bid for SELLs' you'll lose rather many pips at such moments ...


If my feature request is implemented I can send an IOrder.setTakeProfitPrice(double price, OfferSide.ASK) command when a big spread is detected/expected to reduce that risk.

Cheers
Francisco
Last bumped by frangonve on Sun 04 Aug, 2019, 06:07.

 

Jump to:  

  © 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