Browse Source

BarAggregator: increased max time

stable
Denis Tereshkin 6 years ago
parent
commit
2e0802a2fd
  1. 2
      src/ATrade/Driver/Real.hs
  2. 2
      src/ATrade/Driver/Real/QuoteSourceThread.hs

2
src/ATrade/Driver/Real.hs

@ -311,7 +311,7 @@ barStrategyDriver mbSourceTimeframe tickFilter strategy stateRef timersRef shutd
M.fromList <$> mapM (loadTickerFromHAP ctx ((strategyHistoryProvider . strategyInstanceParams) strategy)) (tickers . strategyInstanceParams $ strategy) M.fromList <$> mapM (loadTickerFromHAP ctx ((strategyHistoryProvider . strategyInstanceParams) strategy)) (tickers . strategyInstanceParams $ strategy)
| otherwise -> | otherwise ->
M.fromList <$> mapM (loadTickerFromQHP ctx ((strategyHistoryProvider . strategyInstanceParams) strategy)) (tickers . strategyInstanceParams $ strategy) M.fromList <$> mapM (loadTickerFromQHP ctx ((strategyHistoryProvider . strategyInstanceParams) strategy)) (tickers . strategyInstanceParams $ strategy)
agg <- newIORef $ mkAggregatorFromBars historyBars [(hmsToDiffTime 6 50 0, hmsToDiffTime 21 0 0)] agg <- newIORef $ mkAggregatorFromBars historyBars [(hmsToDiffTime 6 50 0, hmsToDiffTime 21 10 0)]
bracket (startQuoteSourceThread ctx qsEp strategy eventChan agg tickFilter mbSourceTimeframe) killThread (\_ -> do bracket (startQuoteSourceThread ctx qsEp strategy eventChan agg tickFilter mbSourceTimeframe) killThread (\_ -> do
debugM "Strategy" "QuoteSource thread forked" debugM "Strategy" "QuoteSource thread forked"
bracket (startBrokerClientThread (strategyInstanceId . strategyInstanceParams $ strategy) ctx brEp ordersChan eventChan shutdownVar) killThread (\_ -> do bracket (startBrokerClientThread (strategyInstanceId . strategyInstanceParams $ strategy) ctx brEp ordersChan eventChan shutdownVar) killThread (\_ -> do

2
src/ATrade/Driver/Real/QuoteSourceThread.hs

@ -46,7 +46,7 @@ startQuoteSourceThread ctx qsEp strategy eventChan agg tickFilter maybeSourceTim
Just _ -> return () Just _ -> return ()
QDBar (incomingTf, bar) -> do QDBar (incomingTf, bar) -> do
aggValue <- readIORef agg aggValue <- readIORef agg
debugM "QSThread" $ "Incoming bar: " ++ show incomingTf ++ ": " ++ show bar -- debugM "QSThread" $ "Incoming bar: " ++ show incomingTf ++ ": " ++ show bar
case maybeSourceTimeframe of case maybeSourceTimeframe of
Just tf -> when (tf == unBarTimeframe incomingTf) $ Just tf -> when (tf == unBarTimeframe incomingTf) $
case handleBar bar aggValue of case handleBar bar aggValue of

Loading…
Cancel
Save