myBPV)
        todaysEquity = todaysOTE + totProfit
        equity.setEquityInfo(myDate[i], equItm, todaysCTE, todaysOTE)
    if mp >= 1:
        price = myClose[i]
        tradeName = "L-EOD"
        exitDate = myDate[i]
        numShares = curShares
        exitQuant.append(numShares)
        profit, trades, curShares = exitPos(price, myDate[i], tradeName,
                                            numShares)
        listOfTrades.append(trades)
    if mp <= -1:
        price = myClose[i]
        tradeName = "S-EOD"
        exitDate = myDate[i]
        numShares = curShares
        exitQuant.append(numShares)
        profit, trades, curShares = exitPos(price, myDate[i], tradeName,
                                            numShares)
        listOfTrades.append(trades)
    systemMarket.setSysMarkInfo(sysName, myComName, listOfTrades, equity)
    systemMarketList.append(systemMarket)
    numRuns = numRuns + 1

if numMarkets > 0:
    portfolio.setPortfolioInfo("PortfolioTest", systemMarketList)
    calcSystemResults(systemMarketList)
if numMarkets == 0:
    print("No markets selected : terminating!")
Exemple #2
0
    if mp >= 1:
        price = myClose[i]
        tradeName = "L-EOD"
        exitDate =myDate[i]
        numShares = curShares
        exitQuant.append(numShares)
        profit,trades,curShares = exitPos(price,myDate[i],tradeName,numShares)
        listOfTrades.append(trades)
    if mp <= -1:
        price = myClose[i]
        tradeName = "S-EOD"
        exitDate =myDate[i]
        numShares = curShares
        exitQuant.append(numShares)
        profit,trades,curShares = exitPos(price,myDate[i],tradeName,numShares)
        listOfTrades.append(trades)
    systemMarket.setSysMarkInfo(sysName,myComName,listOfTrades,equity)
    systemMarketList.append(systemMarket)
    numRuns = numRuns + 1

if numMarkets > 0:
    portfolio.setPortfolioInfo("PortfolioTest",systemMarketList)
    calcSystemResults(systemMarketList)
if numMarkets == 0: print("No markets selected : terminating!")