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.

Some Warning happen When run a stategy that close all order at real market
 Post subject: Some Warning happen When run a stategy that close all order at real market Post rating: 0   New post Posted: Mon 25 Mar, 2013, 13:27 

User rating: 0
Joined: Tue 28 Aug, 2012, 14:52
Posts: 16
Some Warning happen When run a stategy that close all order at real market, as like that:
05:43:31 Strategy thread queue overloaded with tasks. Ticks in queue - 3, bars - 1612, other tasks - 417

The Strange is it don't happen at test market, but it happens all the time at real market operation.


 
 Post subject: Re: Some Warning happen When run a stategy that close all order at real market Post rating: 0   New post Posted: Mon 25 Mar, 2013, 13:35 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Most likely there is some execution logic in your strategy, which prevents the onBar method to get called. To find out the exact cause of the problem, please provide:
  1. An example strategy which replicates the case.
  2. The launch conditions - essentially, the number of subscribed instruments.


 
 Post subject: Re: Some Warning happen When run a stategy that close all order at real market Post rating: 0   New post Posted: Mon 25 Mar, 2013, 13:57 

User rating: 0
Joined: Tue 28 Aug, 2012, 14:52
Posts: 16
My Stategy is close all order which I concern. The main code is recode onStart function as follows:
public void onStart(IContext context) throws JFException {
        this.engine = context.getEngine();
        this.console = context.getConsole();
        this.history = context.getHistory();
        this.context = context;
        this.indicators = context.getIndicators();
        this.userInterface = context.getUserInterface();
       
        if (JOptionPane.showConfirmDialog(null, "Close All BUY and SELL","Close", JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION){
            // 停止执行策略
            context.stop();
            return;
        }
       
        double slippage = 2;
        java.util.List<IOrder> orderList = engine.getOrders();
        for (IOrder order : orderList) {    // 循环遍历orderList
            if (order != null){
                // 只有本策略有权限管理的订单才能管理
                if (!isStrategyManage(order.getLabel()))
                {
                    continue;
                }

                // 订单全部平仓
                order.close();
            }
        }
       
        // 停止执行策略
        context.stop();
    }


 
 Post subject: Re: Some Warning happen When run a stategy that close all order at real market Post rating: 0   New post Posted: Mon 25 Mar, 2013, 13:58 

User rating: 0
Joined: Tue 28 Aug, 2012, 14:52
Posts: 16
By the way, The launch conditions is run the stategy at real market.


 
 Post subject: Re: Some Warning happen When run a stategy that close all order at real market Post rating: 0   New post Posted: Tue 26 Mar, 2013, 14:50 

User rating: 0
Joined: Tue 28 Aug, 2012, 14:52
Posts: 16
the stategy is meant to close more than 6 trades at once.


 
 Post subject: Re: Some Warning happen When run a stategy that close all order at real market Post rating: 0   New post Posted: Tue 02 Apr, 2013, 08:36 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
If the dialog remained opened for a while, then it would explain the queueing up of the bars, as waiting on the confirmation holds on the strategy execution.


 

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