Dukascopy
 
 
Wiki JStore Search Login

JFOREX-3326: get "changed Stop loss level" message
 Post subject: JFOREX-3326: get "changed Stop loss level" message Post rating: 0   New post Posted: Wed 16 Nov, 2011, 15:02 

User rating: 0
Joined: Wed 16 Nov, 2011, 14:57
Posts: 5
Location: Hungary,
Greetings,

I need some help.

Is it possible to get the messages:
"Client ID ... changed Stop loss level from ... to ...EUR."
in my strategy?

Perhaps in the onMessage() function?

How can I do it?

Best regards,
fxdevs


 
 Post subject: Re: get "changed Stop loss level" message Post rating: 0   New post Posted: Wed 16 Nov, 2011, 15:51 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Launch the following strategy, make some manual trades and check what you receive in the strategy message tab:
package jforex.test;

import com.dukascopy.api.*;

/**
 * The strategy prints all messages that it receives and applies specific logic on
 * order fill and change messages
 *
 */
public class PrintMessages implements IStrategy {
   private IConsole console;
   
   @Override
   public void onStart(IContext context) throws JFException {
      this.console = context.getConsole();
   }

   @Override
   public void onTick(Instrument instrument, ITick tick) throws JFException {}

   @Override
   public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {}

   @Override
   public void onMessage(IMessage message) throws JFException {
      console.getOut().println(message);
      if(message.getType() == IMessage.Type.ORDER_CHANGED_OK){
         console.getOut().println("order "+message.getOrder().getLabel()+" changed: " +message.getContent());      
      } else if (message.getType() == IMessage.Type.ORDER_FILL_OK){
         console.getOut().println("order "+message.getOrder().getLabel()+" filled: " +message.getContent());      
      }
   }
   
   @Override
   public void onAccount(IAccount account) throws JFException {}
   @Override
   public void onStop() throws JFException {}

}
For example with strategy that makes orders itself, see:
https://www.dukascopy.com/wiki/index.php ... rder_State


 
 Post subject: Re: get "changed Stop loss level" message Post rating: 0   New post Posted: Wed 16 Nov, 2011, 16:38 

User rating: 0
Joined: Wed 16 Nov, 2011, 14:57
Posts: 5
Location: Hungary,
Thank you for the answer.

My question is not about the order's stop loss changes.

The question is about the Client account's stop loss change.

The owner of the Client Account can change the stop loss level of the account.
The owner of the PAMM account become a message in JForex about this activity.

I want to use the stop loss level change in my strategy.


 
 Post subject: Re: JFOREX-3326: get "changed Stop loss level" message Post rating: 0   New post Posted: Wed 16 Nov, 2011, 16:54 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
The feature will be implemented as soon as possible.


 
 Post subject: Re: JFOREX-3326: get "changed Stop loss level" message Post rating: 0   New post Posted: Wed 15 Feb, 2012, 09:17 

User rating: 0
Joined: Wed 16 Nov, 2011, 14:57
Posts: 5
Location: Hungary,
Greetings,

As I see, it is implemented in the new API.

How it works?


 
 Post subject: Re: JFOREX-3326: get "changed Stop loss level" message Post rating: 0   New post Posted: Wed 15 Feb, 2012, 11:43 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please ask it in Knowledge Base forum.


 

Jump to:  

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