Not logged in
Viewing 4 posts - 1 through 4 (of 4 total)
  • #114485|
    447 Posts
    package com.strategyquant.extend.WhatIf;
    import java.util.Date;
    import java.util.Iterator;
    import com.strategyquant.lib.snippets.WhatIf;
    import com.strategyquant.lib.results.SQOrderList;
    import com.strategyquant.lib.results.SQOrder;
    import com.strategyquant.lib.time.SQTime;
    public class RemoveTradesPriorYYYY extends WhatIf {
    	public RemoveTradesPriorYYYY() {
             addIntParameter("Year", "Year", 2003, 1, Integer.MAX_VALUE, 1);
            // set name of this method that will be displayed with parameter(s)
    		setFormatedName("Remove trades prior to {Year}");
    	 * Function receives list of all orders sorted by open time and it could manipulate 
    	 * the list and remove any order that matches certain filter from the list.     
    	 * Order structure is available in the documentation here:
    	 * @param originalOrders - list of original orders that can be changed. Each order has the order properties specified above
    	public void filter(SQOrderList originalOrders) throws Exception {
    		int parameter = getIntParameterValue("Year");
    int  currentYear;	
    		for(Iterator<SQOrder> i = originalOrders.listIterator(); i.hasNext();) {
    			SQOrder order =;
    			// todo - your custom action
    			// orders can be skipped or manipulated here
      SQTime dateTime = new SQTime(order.OpenTime); //order.CloseTime
      currentYear = dateTime.getFullYear();
      if(currentYear < parameter) { 
    62 Posts

    Notch, thanks for the snippet. Maybe it will help to somebody :)



    243 Posts

    Excellent Notch.
    Tamas may i ask you? In next update of QA dou you have plans to upgrade logging process? Something like console/output for reading data ? Better then java logger4?

    62 Posts

    Hello clonex,


    yes, “Debug Console” will be in the next update. Thanks for the idea ;)


    Best regards,


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.