示例#1
0
def test_run_trade_wexpire(pair, start, type, SL, TP, entry, entered):
    '''
    This test checks the run_trade method with the 'expires' parameter
    '''
    td = Trade(start=start,
               entry=entry,
               SL=SL,
               TP=TP,
               pair=pair,
               type=type,
               timeframe="D",
               strat="counter_b2",
               id="test",
               settingf="../../data/settings.ini")

    td.run_trade(expires=2)
    assert td.entered == entered
示例#2
0
def test_run_trade_4hrs(pair, start, type, SL, TP, entry, outcome):
    '''
    This test checks the run_trade method with the 'expires' parameter
    '''
    td = Trade(start=start,
               entry=entry,
               SL=SL,
               TP=TP,
               pair=pair,
               type=type,
               timeframe="H4",
               strat="counter_b2",
               id="test",
               settingf="../../data/settings.ini")

    td.run_trade()
    assert td.outcome == outcome
示例#3
0
def test_run_trade(pair, start, type, SL, TP, entry, outcome):
    '''
    This test checks the progression of the Trade
    and checks if the outcome attribute is correctly
    defined.
    '''
    td = Trade(start=start,
               entry=entry,
               SL=SL,
               TP=TP,
               pair=pair,
               type=type,
               timeframe="D",
               strat="counter_b2",
               id="test",
               settingf="../../data/settings.ini")

    td.run_trade()
    assert td.outcome == outcome