Dukascopy
 
 
Wiki JStore Search Login

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

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

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

SL Manager
 Post subject: SL Manager Post rating: 0   New post Posted: Tue 27 Sep, 2011, 10:19 

User rating: 0
Joined: Thu 02 Jun, 2011, 16:02
Posts: 2
Location: FR
Hi, can anyone help me with adding a set SL/TP and move stop to BE after so many pips to this strategy please? Or how would I re write it with using the bearish. Bullish crosses and remove the adx part and add a SL>TP Manager?

Thanks


Attachments:
File comment: Found it in the contest section so I guess we can use?
MAcross01-1.java [5.05 KiB]
Downloaded 291 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: SL Manager Post rating: 0   New post Posted: Wed 28 Sep, 2011, 10:02 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Value of one pip can be obtained using Instrument.getPipScale();.
The code could modified be as follows:
double pip = myInstrument.getPipValue();
TP = pip * 3;


Also, please consider using askBar prices instead of bidBar, to calculate more accurate stop loss and take profit prices:
engine.submitOrder("Order" + orderNumber, instrument,IEngine.OrderCommand.SELL, lot, 0, 1, askBar.getClose() + SL, askBar.getClose() - TP);


Please, give more details on how do you would like to change the strategy, what is the algorithm?


 

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