Beispiel #1
0
def genMaOps(ps, ft, f, st, s):

    if ft == 'MA':
        fma = ma.calc_ma(ps, f)
    elif ft == 'EMA':
        fma = ma.calc_ema(ps, f)
    elif ft == 'SMA':
        fma = ma.calc_sma(ps, f)
    elif ft == 'LWMA':
        fma = ma.calc_lwma(ps, f)

    if st == 'MA':
        sma = ma.calc_ma(ps, s)
    elif st == 'EMA':
        sma = ma.calc_ema(ps, s)
    elif st == 'SMA':
        sma = ma.calc_sma(ps, s)
    elif st == 'LWMA':
        sma = ma.calc_lwma(ps, s)

    l = len(ps)
    ops = [0] * l
    for i in range(s, l):
        diff = fma[i] - sma[i]
        if diff > 0:
            ops[i] = 1
        elif diff < 0:
            ops[i] = -1

    return ops
Beispiel #2
0
def genMaOps(ps, ft, f, st, s):
	
	if ft == 'MA':
		fma = ma.calc_ma(ps, f)
	elif ft == 'EMA':
		fma = ma.calc_ema(ps, f)
	elif ft == 'SMA':
		fma = ma.calc_sma(ps, f)
	elif ft == 'LWMA':
		fma = ma.calc_lwma(ps, f)
		
	if st == 'MA':
		sma = ma.calc_ma(ps, s)
	elif st == 'EMA':
		sma = ma.calc_ema(ps, s)
	elif st == 'SMA':
		sma = ma.calc_sma(ps, s)
	elif st == 'LWMA':
		sma = ma.calc_lwma(ps, s)
		
	
	l = len(ps)
	ops = [0] * l
	for i in range(s, l):
		diff = fma[i] - sma[i]
		if diff > 0:
			ops[i] = 1
		elif diff < 0:
			ops[i] = -1
			
	return ops
	
Beispiel #3
0
def runStrategy(in_prices):
	global mas, emas, smas, lwmas, std, prices
	log.debug('beginning ma strategy ...')
	
	prices = in_prices
	ps = [p['close'] for p in prices]
	
	std = [0] * 51
	l = len(prices)
	for period in range(2, 51):
		std[period] = [0] * l
		for i in range(period - 1, l):
			std[period][i] = np.std(ps[i-period+1 : i+1], dtype=np.float64, ddof=0)
		
	mas = [0] * 81
	emas = [0] * 81
	smas = [0] * 81
	lwmas = [0] * 81
	for period in range(2, 81):
		mas[period] = ma.calc_ma(ps, period)
		emas[period] = ma.calc_ema(ps, period)
		smas[period] = ma.calc_sma(ps, period)
		lwmas[period] = ma.calc_lwma(ps, period)
		
	pool = Pool(100)
	#t = doTrade(pool, 25, 1.0, 'MA', 7, 'SMA', 12, 'EMA', 31, 'SMA', 7, 'MA', 12, 'MA', 13)
	#t = doTrade(pool, 25, 1.3, 'MA', 7, 'SMA', 13, 'EMA', 31, 'SMA', 7, 'MA', 12, 'MA', 13)
	#pool.showStrategies()
	#return 
	
	log.debug('running ma strategy ...')
	starttime = datetime.datetime.now() 
	matypes = ['MA', 'EMA', 'SMA', 'LWMA']
	
	farr = range(5, 20)
	s1arr = range(8, 40)
	s2arr = range(0, 80)
	
	poola = Pool(10)
	poolb = Pool(10)
	for stdPeriod in [20, ]:
		for stdGuage in [1.0, ]:
			log.debug('*** ' + str(stdPeriod) + ',' + str(stdGuage) + ' ***')
			for ft, f in [(matype, period) for matype in matypes for period in farr]:
				for s1t, s1 in [(matype, period) for matype in matypes for period in s1arr]:
					if s1 != 0 and s1 <= f: continue
					elapsed = (datetime.datetime.now() - starttime).seconds
					log.debug('== ' + str(elapsed) + ',' + ft + '_' + str(f) + ',' + s1t + '_' + str(s1) + ' ==')
					for s2t, s2 in [(matype, period) for matype in matypes for period in s2arr]:
						if s2 != 0 and s2 <= s1: continue
						if s2 == 0 and (s2t == 'EMA' or s2t == 'SMA' or s2t == 'LWMA'): continue
						
						doTrade(poola, stdPeriod, stdGuage, ft, f, s1t, s1, s2t, s2, '', 0, '', 0, '', 0)
						doTrade(poolb, stdPeriod, stdGuage, '', 0, '', 0, '', 0, ft, f, s1t, s1, s2t, s2)
						
	poola.showStrategies()
	poolb.showStrategies()
Beispiel #4
0
def getMas(matype, period):
	if matype == 'MA':
		return ma.calc_ma(ps, period)
	elif matype == 'EMA':
		return ma.calc_ema(ps, period)
	elif matype == 'SMA':
		return ma.calc_sma(ps, period)
	elif matype == 'LWMA':
		return ma.calc_lwma(ps, period)
	else:
		return None
Beispiel #5
0
def getMas(matype, period):
    if matype == 'MA':
        return ma.calc_ma(ps, period)
    elif matype == 'EMA':
        return ma.calc_ema(ps, period)
    elif matype == 'SMA':
        return ma.calc_sma(ps, period)
    elif matype == 'LWMA':
        return ma.calc_lwma(ps, period)
    else:
        return None
Beispiel #6
0
def getMas(matype, period):
    if matype == "MA":
        return ma.calc_ma(ps, period)
    elif matype == "EMA":
        return ma.calc_ema(ps, period)
    elif matype == "SMA":
        return ma.calc_sma(ps, period)
    elif matype == "LWMA":
        return ma.calc_lwma(ps, period)
    else:
        return None
Beispiel #7
0
def runVoter(in_prices):
	global mas, emas, smas, lwmas, prices
	log.debug('beginning ma voter ...')
	
	prices = in_prices
	ps = [p['close'] for p in prices]
	
	malength = 101
	mas = [0] * malength
	emas = [0] * malength
	smas = [0] * malength
	lwmas = [0] * malength
	for period in range(2, malength):
		if period % 30 == 0: print period
		mas[period] = ma.calc_ma(ps, period)
		emas[period] = ma.calc_ema(ps, period)
		smas[period] = ma.calc_sma(ps, period)
		lwmas[period] = ma.calc_lwma(ps, period)
	
	
	log.debug('running ma voter ...')
	starttime = time.time() 
	matypes = ['MA', 'EMA', 'SMA', 'LWMA']
	
	pool = VoterPool(1, prices)
	#calcTickets(pool, 'SMA', 95, 'LWMA', 240)
	#calcTickets(pool, 'SMA', 3, 'EMA', 4)
	#calcTickets(pool, 'MA', 7, 'SMA', 13)
	#pool.showVoters()
	#return
	
	
	farr = range(5, 30)[::3]
	sarr = range(10, 100)[::5]
	
	for ft, f in [(matype, period) for matype in matypes for period in farr]:
		elapsed = long(time.time() - starttime)
		log.debug('== ' + str(elapsed) + ',' + ft + '_' + str(f) + ' ==')
		for st, s in [(matype, period) for matype in matypes for period in sarr]:
			if s < f: continue
			calcTickets(pool, ft, f, st, s)
	
	pool.showVoters()
Beispiel #8
0
def runVoter(in_prices):
    global mas, emas, smas, lwmas, prices
    log.debug('beginning ma voter ...')

    prices = in_prices
    ps = [p['close'] for p in prices]

    malength = 101
    mas = [0] * malength
    emas = [0] * malength
    smas = [0] * malength
    lwmas = [0] * malength
    for period in range(2, malength):
        if period % 30 == 0: print period
        mas[period] = ma.calc_ma(ps, period)
        emas[period] = ma.calc_ema(ps, period)
        smas[period] = ma.calc_sma(ps, period)
        lwmas[period] = ma.calc_lwma(ps, period)

    log.debug('running ma voter ...')
    starttime = time.time()
    matypes = ['MA', 'EMA', 'SMA', 'LWMA']

    pool = VoterPool(1, prices)
    #calcTickets(pool, 'SMA', 95, 'LWMA', 240)
    #calcTickets(pool, 'SMA', 3, 'EMA', 4)
    #calcTickets(pool, 'MA', 7, 'SMA', 13)
    #pool.showVoters()
    #return

    farr = range(5, 30)[::3]
    sarr = range(10, 100)[::5]

    for ft, f in [(matype, period) for matype in matypes for period in farr]:
        elapsed = long(time.time() - starttime)
        log.debug('== ' + str(elapsed) + ',' + ft + '_' + str(f) + ' ==')
        for st, s in [(matype, period) for matype in matypes
                      for period in sarr]:
            if s < f: continue
            calcTickets(pool, ft, f, st, s)

    pool.showVoters()
Beispiel #9
0
def runVoter(in_prices):
	global mas, emas, smas, lwmas, prices
	log.debug('beginning ma voter ...')
	
	prices = in_prices
	ps = [p['close'] for p in prices]
	
	mas = [0] * 61
	emas = [0] * 61
	smas = [0] * 61
	lwmas = [0] * 61
	for period in range(2, 61):
		mas[period] = ma.calc_ma(ps, period)
		emas[period] = ma.calc_ema(ps, period)
		smas[period] = ma.calc_sma(ps, period)
		lwmas[period] = ma.calc_lwma(ps, period)
	
	
	log.debug('running ma voter ...')
	starttime = time.time() 
	matypes = ['MA', 'EMA', 'SMA', 'LWMA']
	
	pool = VoterPool(2, prices)
	#calcTickets(pool, 'MA', 7, 'EMA', 18)
	#calcTickets(pool, 'SMA', 3, 'EMA', 4)
	#calcTickets(pool, 'MA', 7, 'SMA', 13)
	#pool.showVoters()
	#return
	
	
	farr = range(2, 10)
	sarr = range(4, 60)
	
	for ft, f in [(matype, period) for matype in matypes for period in farr]:
		elapsed = long(time.time() - starttime)
		#log.debug('== ' + str(elapsed) + ',' + ft + '_' + str(f) + ' ==')
		for st, s in [(matype, period) for matype in matypes for period in sarr]:
			if s < f: continue
			calcTickets(pool, ft, f, st, s)
	
	pool.showVoters()
Beispiel #10
0
def runVoter(in_prices):
    global mas, emas, smas, lwmas, prices
    log.debug('beginning ma voter ...')

    prices = in_prices
    ps = [p['close'] for p in prices]

    mas = [0] * 61
    emas = [0] * 61
    smas = [0] * 61
    lwmas = [0] * 61
    for period in range(2, 61):
        mas[period] = ma.calc_ma(ps, period)
        emas[period] = ma.calc_ema(ps, period)
        smas[period] = ma.calc_sma(ps, period)
        lwmas[period] = ma.calc_lwma(ps, period)

    log.debug('running ma voter ...')
    starttime = time.time()
    matypes = ['MA', 'EMA', 'SMA', 'LWMA']

    pool = VoterPool(2, prices)
    #calcTickets(pool, 'MA', 7, 'EMA', 18)
    #calcTickets(pool, 'SMA', 3, 'EMA', 4)
    #calcTickets(pool, 'MA', 7, 'SMA', 13)
    #pool.showVoters()
    #return

    farr = range(2, 10)
    sarr = range(4, 60)

    for ft, f in [(matype, period) for matype in matypes for period in farr]:
        elapsed = long(time.time() - starttime)
        #log.debug('== ' + str(elapsed) + ',' + ft + '_' + str(f) + ' ==')
        for st, s in [(matype, period) for matype in matypes
                      for period in sarr]:
            if s < f: continue
            calcTickets(pool, ft, f, st, s)

    pool.showVoters()
Beispiel #11
0
def runStrategy(in_prices):
	global mas, emas, smas, lwmas, prices
	log.debug('beginning ma strategy ...')
	
	prices = in_prices
	ps = [p['close'] for p in prices]
	
	log.debug('generating mas ...')
	mas = [0] * 61
	emas = [0] * 61
	smas = [0] * 61
	lwmas = [0] * 61
	for period in range(2, 61):
		mas[period] = ma.calc_ma(ps, period)
		emas[period] = ma.calc_ema(ps, period)
		smas[period] = ma.calc_sma(ps, period)
		lwmas[period] = ma.calc_lwma(ps, period)
	
	pool = StrategyPool(20)
	doMaTrade(pool, 'SMA', 19, 'MA', 40, 'LWMA', 60)
	pool.showStrategies()
	return
	
	log.debug('running ma strategy ...')
	starttime = datetime.datetime.now() 
	matypes = ['MA', 'EMA', 'SMA', 'LWMA']
	pool = StrategyPool(100)
	
	for ft, f in [(matype, period) for matype in matypes for period in range(2, 10)]:
		for s1t, s1 in [(matype, period) for matype in matypes for period in range(4, 21)]:
			elapsed = (datetime.datetime.now() - starttime).seconds
			log.debug('== ' + str(elapsed) + ',' + ft + '_' + str(f) + ',' + s1t + '_' + str(s1) + ' ==')
			for s2t, s2 in [(matype, period) for matype in matypes for period in range(0, 41)]:
				if s2 != 0 and s2 <= s1: continue
				if s2 == 0 and (s2t == 'EMA' or s2t == 'SMA' or s2t == 'LWMA'): continue
				doMaTrade(pool, ft, f, s1t, s1, s2t, s2)
	
	pool.showStrategies()
Beispiel #12
0
def runStrategy(in_prices):
	global mas, emas, smas, lwmas, std, prices
	log.debug('beginning one strategy ...')
	
	prices = in_prices
	ps = [p['close'] for p in prices]
	
	std = [0] * 51
	l = len(prices)
	for period in range(20, 21):
		std[period] = [0] * l
		for i in range(period - 1, l):
			std[period][i] = round(np.std(ps[i-period+1 : i+1], dtype=np.float64, ddof=0), 3)
	
	mas = [0] * 181
	emas = [0] * 181
	smas = [0] * 181
	lwmas = [0] * 181
	for period in range(2, 181):
		mas[period] = ma.calc_ma(ps, period)
		emas[period] = ma.calc_ema(ps, period)
		smas[period] = ma.calc_sma(ps, period)
		lwmas[period] = ma.calc_lwma(ps, period)
		
	
	#pool = StrategyPool(100)
	#t = doTrade(pool, 20, 0.1, 0.2, 'SMA', 20, 'SMA', 34, 'LWMA', 40, 'SMA', 20, 'SMA', 34, 'LWMA', 120)
	#pool.showStrategies()
	#return 
	
	log.debug('running first strategy ...')
	starttime = time.time() 
	matypes = ['MA', 'EMA', 'SMA', 'LWMA']
	
	#farr = [2, 3, 4, 5, 6, 7, ]
	#s1arr = [4, 6, 8, 10, 12, 14, 16, 18, 20, ]
	#s2arr = [0, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, ]
	#farr = [20,]
	#s1arr = [40, ]
	#s2arr = [0, ]
	farr = range(40, 41)[::3]
	s1arr = range(4, 121)[::6]
	s2arr = range(0, 181)[::15]
	
	stdGuage1, stdGuage2 = 0.1, 0.2
	pool = StrategyPool(50)
	poola = StrategyPool(10)
	poolb = StrategyPool(10)
	
	for stdPeriod in [20, ]:
		for no in ['A', 'B', ]:
			for ft, f in [(matype, period) for matype in matypes for period in farr]:
				for s1t, s1 in [(matype, period) for matype in matypes for period in s1arr]:
					if s1 < f: continue
					elapsed = long(time.time() - starttime)
					log.debug('== ' + str(elapsed) + ',' + ft + '_' + str(f) + ',' + s1t + '_' + str(s1) + ' ==')
					for s2t, s2 in [(matype, period) for matype in matypes for period in s2arr]:
						if s2 != 0 and s2 <= s1: continue
						if s2 == 0 and (s2t == 'EMA' or s2t == 'SMA' or s2t == 'LWMA'): continue
						if no == 'A':
							doTrade(poola, stdPeriod, stdGuage1, stdGuage2, ft, f, s1t, s1, s2t, s2, '', 0, '', 0, '', 0)
						elif no == 'B':
							doTrade(poolb, stdPeriod, stdGuage1, stdGuage2, '', 0, '', 0, '', 0, ft, f, s1t, s1, s2t, s2)
			elapsed = long(time.time() - starttime)
			log.info('find ' + no + ' time: ' + str(elapsed) + ' ')
		
		for i in range(10):
			sa = poola.strategies[i]
			sb = poolb.strategies[i]
			t = doTrade(pool, stdPeriod, stdGuage1, stdGuage2, sa[0].args[0], sa[0].args[1], sa[0].args[2], sa[0].args[3], sa[0].args[4], sa[0].args[5], sb[0].args[6], sb[0].args[7], sb[0].args[8], sb[0].args[9], sb[0].args[10], sb[0].args[11])
			#t.generateGraph()
	
	pool.showStrategies()
Beispiel #13
0
def runStrategy(in_prices):
    global mas, emas, smas, lwmas, std, prices
    log.debug('beginning one strategy ...')

    prices = in_prices
    ps = [p['close'] for p in prices]

    std = [0] * 51
    l = len(prices)
    for period in range(5, 41):
        std[period] = [0] * l
        for i in range(period - 1, l):
            std[period][i] = round(
                np.std(ps[i - period + 1:i + 1], dtype=np.float64, ddof=0), 3)

    mas = [0] * 181
    emas = [0] * 181
    smas = [0] * 181
    lwmas = [0] * 181
    for period in range(2, 181):
        mas[period] = ma.calc_ma(ps, period)
        emas[period] = ma.calc_ema(ps, period)
        smas[period] = ma.calc_sma(ps, period)
        lwmas[period] = ma.calc_lwma(ps, period)

    #pool = StrategyPool(100)
    #t = doTrade(pool, 20, 0.1, 0.2, 'SMA', 20, 'SMA', 34, 'LWMA', 40, 'SMA', 20, 'SMA', 34, 'LWMA', 120, 'MA', 20, 'SMA', 34, 'LWMA', 120)
    #pool.showStrategies()
    #return

    log.debug('running first strategy ...')
    starttime = time.time()
    matypes = ['MA', 'EMA', 'SMA', 'LWMA']

    #farr = [2, 3, 4, 5, 6, 7, ]
    #s1arr = [4, 6, 8, 10, 12, 14, 16, 18, 20, ]
    #s2arr = [0, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, ]
    #farr = [20,]
    #s1arr = [40, ]
    #s2arr = [0, ]
    farr = range(40, 41)[::3]
    s1arr = range(4, 121)[::6]
    s2arr = range(0, 181)[::15]

    stdGuage1, stdGuage2 = 0.1, 0.2
    pool = StrategyPool(50)
    poola = StrategyPool(10)
    poolb = StrategyPool(10)
    poolc = StrategyPool(10)

    for stdPeriod in [
            20,
    ]:
        for no in ['A', 'B', 'C']:
            for ft, f in [(matype, period) for matype in matypes
                          for period in farr]:
                for s1t, s1 in [(matype, period) for matype in matypes
                                for period in s1arr]:
                    if s1 < f: continue
                    elapsed = long(time.time() - starttime)
                    log.debug('== ' + str(elapsed) + ',' + ft + '_' + str(f) +
                              ',' + s1t + '_' + str(s1) + ' ==')

                    for s2t, s2 in [(matype, period) for matype in matypes
                                    for period in s2arr]:
                        if s2 != 0 and s2 <= s1: continue
                        if s2 == 0 and (s2t == 'EMA' or s2t == 'SMA'
                                        or s2t == 'LWMA'):
                            continue
                        if no == 'A':
                            doTrade(poola, stdPeriod, stdGuage1, stdGuage2, ft,
                                    f, s1t, s1, s2t, s2, '', 0, '', 0, '', 0,
                                    '', 0, '', 0, '', 0)
                        elif no == 'B':
                            doTrade(poolb, stdPeriod, stdGuage1, stdGuage2, '',
                                    0, '', 0, '', 0, ft, f, s1t, s1, s2t, s2,
                                    '', 0, '', 0, '', 0)
                        elif no == 'C':
                            doTrade(poolc, stdPeriod, stdGuage1, stdGuage2, '',
                                    0, '', 0, '', 0, '', 0, '', 0, '', 0, ft,
                                    f, s1t, s1, s2t, s2)
            elapsed = long(time.time() - starttime)
            log.info('find ' + no + ' time: ' + str(elapsed) + ' ')

        for i in range(10):
            sa = poola.strategies[i]
            sb = poolb.strategies[i]
            sc = poolc.strategies[i]
            t = doTrade(pool, stdPeriod, stdGuage1, stdGuage2, sa[0].args[0],
                        sa[0].args[1], sa[0].args[2], sa[0].args[3],
                        sa[0].args[4], sa[0].args[5], sb[0].args[6],
                        sb[0].args[7], sb[0].args[8], sb[0].args[9],
                        sb[0].args[10], sb[0].args[11], sc[0].args[12],
                        sc[0].args[13], sc[0].args[14], sc[0].args[15],
                        sc[0].args[16], sc[0].args[17])
            #t.generateGraph()

    pool.showStrategies()
Beispiel #14
0
def runStrategy(in_prices):
    global mas, emas, smas, lwmas, std, prices
    log.debug('beginning ma strategy ...')

    prices = in_prices
    ps = [p['close'] for p in prices]

    std = [0] * 51
    l = len(prices)
    for period in range(2, 51):
        std[period] = [0] * l
        for i in range(period - 1, l):
            std[period][i] = np.std(ps[i - period + 1:i + 1],
                                    dtype=np.float64,
                                    ddof=0)

    malength = 181
    mas = [0] * malength
    emas = [0] * malength
    smas = [0] * malength
    lwmas = [0] * malength
    for period in range(2, malength):
        mas[period] = ma.calc_ma(ps, period)
        emas[period] = ma.calc_ema(ps, period)
        smas[period] = ma.calc_sma(ps, period)
        lwmas[period] = ma.calc_lwma(ps, period)

    pool = Pool(10)
    t = doTrade(pool, 12, 0.15, 'SMA', 25, 'LWMA', 48, 'SMA', 160, 'SMA', 30,
                'EMA', 58, 'SMA', 160)
    t = doTrade(pool, 12, 0.15, 'SMA', 25, 'LWMA', 48, 'SMA', 160, 'MA', 30,
                'SMA', 68, 'SMA', 100)
    t = doTrade(pool, 12, 0.15, 'SMA', 25, 'EMA', 38, 'SMA', 160, 'MA', 30,
                'SMA', 68, 'SMA', 100)
    t = doTrade(pool, 12, 0.1, 'SMA', 25, 'EMA', 38, 'SMA', 160, 'MA', 30,
                'SMA', 68, 'SMA', 100)
    t = doTrade(pool, 12, 0.12, 'SMA', 25, 'EMA', 38, 'SMA', 160, 'MA', 30,
                'SMA', 68, 'SMA', 100)
    t = doTrade(pool, 20, 0.15, 'SMA', 25, 'LWMA', 48, 'SMA', 160, 'MA', 30,
                'SMA', 68, 'SMA', 100)
    t = doTrade(pool, 20, 0.1, 'SMA', 25, 'LWMA', 48, 'SMA', 160, 'MA', 30,
                'SMA', 68, 'SMA', 100)
    t = doTrade(pool, 20, 0.12, 'SMA', 25, 'LWMA', 48, 'SMA', 160, 'MA', 30,
                'SMA', 68, 'SMA', 100)
    t = doTrade(pool, 40, 0.15, 'SMA', 25, 'LWMA', 48, 'SMA', 160, 'MA', 30,
                'SMA', 68, 'SMA', 100)
    t = doTrade(pool, 40, 0.1, 'SMA', 25, 'LWMA', 48, 'SMA', 160, 'MA', 30,
                'SMA', 68, 'SMA', 100)
    t = doTrade(pool, 40, 0.12, 'SMA', 25, 'LWMA', 48, 'SMA', 160, 'MA', 30,
                'SMA', 68, 'SMA', 100)
    #t = doTrade(pool, 25, 1.3, 'MA', 7, 'SMA', 13, 'EMA', 31, 'SMA', 7, 'MA', 12, 'MA', 13)
    pool.showStrategies()
    return

    log.debug('running ma strategy ...')
    starttime = datetime.datetime.now()
    matypes = ['MA', 'EMA', 'SMA', 'LWMA']

    farr = range(5, 40)
    s1arr = range(8, 80)
    s2arr = range(0, 180)

    poola = Pool(10)
    poolb = Pool(10)
    for stdPeriod in [
            12,
    ]:
        for stdGuage in [
                0.15,
        ]:
            log.debug('*** ' + str(stdPeriod) + ',' + str(stdGuage) + ' ***')
            for ft, f in [(matype, period) for matype in matypes
                          for period in farr]:
                for s1t, s1 in [(matype, period) for matype in matypes
                                for period in s1arr]:
                    if s1 != 0 and s1 <= f: continue
                    elapsed = (datetime.datetime.now() - starttime).seconds
                    log.debug('== ' + str(elapsed) + ',' + ft + '_' + str(f) +
                              ',' + s1t + '_' + str(s1) + ' ==')
                    for s2t, s2 in [(matype, period) for matype in matypes
                                    for period in s2arr]:
                        if s2 != 0 and s2 <= s1: continue
                        if s2 == 0 and (s2t == 'EMA' or s2t == 'SMA'
                                        or s2t == 'LWMA'):
                            continue

                        doTrade(poola, stdPeriod, stdGuage, ft, f, s1t, s1,
                                s2t, s2, '', 0, '', 0, '', 0)
                        doTrade(poolb, stdPeriod, stdGuage, '', 0, '', 0, '',
                                0, ft, f, s1t, s1, s2t, s2)

    poola.showStrategies()
    poolb.showStrategies()