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.

Stoploss Strategy
 Post subject: Stoploss Strategy Post rating: 0   New post Posted: Thu 25 Oct, 2012, 06:55 

User rating: 0
Joined: Tue 16 Oct, 2012, 12:23
Posts: 40
I am attaching a strategy. There are no errors in its compilation. In this strategy, I have set the stop loss as 10 times the current spread. I have also conformed to the following rules for setting stop-loss price :

- Stop Loss price must be divisible by 0.5 pips, otherwise the order will be rejected.
- One can not set Stop Loss price more than once within a second.

But when the strategy is started, every trade is closed as soon as it is taken. Could you please point out what I am doing wrong? If there is any other mistake regarding setting of stop-loss in the above-mentioned manner please point that out as well.


 
 Post subject: Re: Stoploss Strategy Post rating: 0   New post Posted: Thu 25 Oct, 2012, 07:47 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Consider adding logging statements to log all relevant values before the order close gets called. Such that you see which execution paths get taken and why, see:
https://www.dukascopy.com/wiki/#IConsole/Logging_values
In case the orders get closed by SL or TP make sure that you set the prices in right directions. Also consider adding logging in onMessage as it is done here:
https://www.dukascopy.com/wiki/#Set_Stop_Loss_price/Detect_close_by_Stop_Loss


 

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