Dukascopy Support Board
http://www.dukascopy.com/swiss/english/forex/jforex/forum/

Please add side parameter (BID/ASK) to setTakeProfitPrice method
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=83&t=56767
Page 1 of 1

Author:  frangonve [ Wed 17 Oct, 2018, 04:14 ]
Post subject:  Please add side parameter (BID/ASK) to setTakeProfitPrice method

Please, can you add side parameter (BID/ASK) to setTakeProfitPrice method?

Cheers

Francisco

Author:  mtnfx [ Wed 17 Oct, 2018, 06:42 ]
Post subject:  Re: Please add side parameter (BID/ASK) to setTakeProfitPrice method

I'm curious what logic do you have behind this request. How this should work?

Author:  frangonve [ Wed 17 Oct, 2018, 07:41 ]
Post subject:  Re: Please add side parameter (BID/ASK) to setTakeProfitPrice method

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

Author:  mtnfx [ Wed 17 Oct, 2018, 18:41 ]
Post subject:  Re: Please add side parameter (BID/ASK) to setTakeProfitPrice method

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'.

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

Author:  frangonve [ Wed 17 Oct, 2018, 20:57 ]
Post subject:  Re: Please add side parameter (BID/ASK) to setTakeProfitPrice method

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

Author:  mtnfx [ Wed 17 Oct, 2018, 22:27 ]
Post subject:  Re: Please add side parameter (BID/ASK) to setTakeProfitPrice method

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.)

Author:  mtnfx [ Wed 17 Oct, 2018, 22:40 ]
Post subject:  Re: Please add side parameter (BID/ASK) to setTakeProfitPrice method

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 ...

Author:  frangonve [ Sun 04 Aug, 2019, 06:07 ]
Post subject:  Re: Please add side parameter (BID/ASK) to setTakeProfitPrice method

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

  Page 1 of 1