1- /*
1+ /*
22MIT LICENSE
33
44Copyright 2017 Digital Ruby, LLC - http://www.digitalruby.com
@@ -119,9 +119,10 @@ public async Task ProcessHistoricalTrades()
119119 {
120120 if ( DirectionIsBackwards )
121121 {
122- // no trades found, move the whole block back
123- endDateMoving = startDateMoving . Subtract ( BlockTime ) ;
124- }
122+ // no trades found, move the whole block back
123+ endDateMoving = startDateMoving ;
124+ startDateMoving = endDateMoving . Subtract ( BlockTime ) ;
125+ }
125126 else
126127 {
127128 // no trades found, move the whole block forward
@@ -188,7 +189,6 @@ public async Task ProcessHistoricalTrades()
188189 break ;
189190 }
190191 }
191- ClampDates ( ref startDateMoving , ref endDateMoving ) ;
192192 await Task . Delay ( DelayMilliseconds ) ;
193193 }
194194 }
@@ -205,25 +205,6 @@ private void SetDates(out DateTime startDateMoving, out DateTime endDateMoving)
205205 startDateMoving = StartDate . Value ;
206206 endDateMoving = startDateMoving . Add ( BlockTime ) ;
207207 }
208- ClampDates ( ref startDateMoving , ref endDateMoving ) ;
209- }
210-
211- private void ClampDates ( ref DateTime startDateMoving , ref DateTime endDateMoving )
212- {
213- if ( DirectionIsBackwards )
214- {
215- if ( startDateMoving < StartDate . Value )
216- {
217- startDateMoving = StartDate . Value ;
218- }
219- }
220- else
221- {
222- if ( endDateMoving > EndDate . Value )
223- {
224- endDateMoving = EndDate . Value ;
225- }
226- }
227208 }
228209 }
229210 }
0 commit comments