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.

Copy last order
 Post subject: Copy last order Post rating: 0   New post Posted: Thu 22 Sep, 2016, 21:16 
User avatar

User rating: 0
Joined: Fri 04 Sep, 2015, 19:44
Posts: 34
Location: Slovakia, KE
Hi,

I found a reading bar error, but my strategy does not work in a "loop" - after order close strategy stops.

How to "copy" order after TP (and change direction after SL) ?

Where / how to write a loop of orders - after 1 closes another starts, ... ?

On Bar does not work.

   public void onMessage(IMessage message) throws JFException {
       if(message.getType() == IMessage.Type.ORDER_CLOSE_OK)
       {
           if (message.getReasons().contains(IMessage.Reason.ORDER_CLOSED_BY_TP))  {     
               // I want to copy last opened order instead of engine.submit(blablabla...)
               ....
           }
           else if (message.getReasons().contains(IMessage.Reason.ORDER_CLOSED_BY_SL)) {
              // Change direction some quickly
         ....
          }
        ...
     }
}


May i have more IOrders ?

Thanks.


 

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