+
    0.j  c                   |    R t ^ RIt^ RIHu Ht ^ RIt^ RIH	t	 ^ RI
H
t
HtHt ^ RIHt R	R R llt ! R R4      tR# )
z"Unit tests for indicators service.N)Decimal)datetimetimezone	timedelta)indicators_servicec                R    V ^8  d   QhR\         R\        R\        \        ,          /# )   count
base_pricereturn)intfloatlistdict)formats   "?C:\xampp\htdocs\tradingbinance\backend\tests\test_indicators.py__annotate__r   
   s%      C 5 tDz     c                    . pTp\        V 4       F  pV^,          ^,
          ^2,          pW5,          pVP                  R\        R^^\        P                  R7      \        VR7      ,           R\        \        V^,
          4      4      R\        \        V^d,           4      4      R\        \        V^d,
          4      4      R\        \        V4      4      R	\        \        ^dV^
,          ,           4      4      /4       K  	  V# )
   	open_timei  )tzinfo)hoursopenhighlowclosevolume)rangeappendr   r   utcr   r   str)r   r	   candlespriceichanges   &&    r   generate_candlesr%   
   s    GE5\a%!)r!$1X\\BYUVEWWGC
O,GC,-73us{+,WSZ(gc#B,/0
 	  Nr   c                   8   a  ] tR t^t o R tR tR tR tRtV t	R# )TestIndicatorsServicec                
   \        ^d4      p\        P                  ! V4      pRq3V9  qD'       g   \        P                  ! RV3RW234      R\        P
                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P
                  ! V4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR;r4Rq3V9   qD'       g   \        P                  ! RV3RW234      R\        P
                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P
                  ! V4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR;r4R	q3V9   qD'       g   \        P                  ! RV3RW234      R\        P
                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P
                  ! V4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR;r4R
q3V9   qD'       g   \        P                  ! RV3RW234      R\        P
                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P
                  ! V4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR;r4Rq3V9   qD'       g   \        P                  ! RV3RW234      R\        P
                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P
                  ! V4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR;r4Rq3V9   qD'       g   \        P                  ! RV3RW234      R\        P
                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P
                  ! V4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR;r4Rq3V9   qD'       g   \        P                  ! RV3RW234      R\        P
                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P
                  ! V4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR;r4R# )d   errorpy1py3resultassert %(py5)spy5Nrsimacdbb_upperatradxvwap)not in)z%(py1)s not in %(py3)sinz%(py1)s in %(py3)sr%   r   calculate_all
@pytest_ar_call_reprcompare	_saferepr@py_builtinslocals_should_repr_global_nameAssertionError_format_explanation)selfr!   r-   @py_assert0@py_assert2@py_format4@py_format6s   &      r   %test_calculate_all_returns_indicators;TestIndicatorsService.test_calculate_all_returns_indicators   s   "3'#11':$$$$$$$$$$$$$$$$$$$$$$$$########################r   c                   \        ^
4      p\        P                  ! V4      pRq3V9   qD'       g   \        P                  ! RV3RW234      R\        P
                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P
                  ! V4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR;r4VR,          pRqsV8H  qD'       gy   \        P                  ! RV3RW734      R\        P
                  ! V4      R	\        P
                  ! V4      /,          pR
RV/,          p	\        \        P                  ! V	4      4      hR;p;rGR# )
   r*   r+   r,   r-   r.   r/   Ninsufficient_datapy4assert %(py6)spy6r7   r9   )==)z%(py1)s == %(py4)sr:   )
rD   r!   r-   rE   rF   rG   rH   @py_assert3@py_format5@py_format7s
   &         r   test_insufficient_data,TestIndicatorsService.test_insufficient_data'   s    "2&#11':                        5555555555555555555r   c                r   \        ^d4      p\        P                  ! V4      pVR,          p. ROqCV9   qU'       gy   \        P                  ! RV3R	W434      R\        P
                  ! V4      R\        P
                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rTR# )
r)   ema_crossoverr+   rN   rO   rP   N)bullishbearishnoner7   )z%(py1)s in %(py4)s)r%   r   r;   r<   r=   r>   rB   rC   )rD   r!   r-   rE   rR   rF   rS   rT   s   &       r   test_ema_crossover_detection2TestIndicatorsService.test_ema_crossover_detection-   sU    "3'#11':HHHHHHHHHHHHHHHHHHHr   c                   \        ^d4      p\        P                  ! V4      pVR,          p\        V\        4      qD'       Eg   RRR\
        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      RR\
        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR	;r4VR
,          p\        V\        4      qD'       Eg   RRR\
        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      RR\
        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR	;r4R	# )r)   supportsz5assert %(py5)s
{%(py5)s = %(py0)s(%(py2)s, %(py3)s)
}py0
isinstancepy2r,   r   r/   Nresistances)r%   r   r;   ra   r   r?   r@   r<   rA   r>   rB   rC   )rD   r!   r-   @py_assert1@py_assert4rH   s   &     r   test_support_resistance-TestIndicatorsService.test_support_resistance2   s    "3'#11':33333333333333333333333333333333333336666666666666666666666666666666666666r    N)
__name__
__module____qualname____firstlineno__rI   rU   r\   rf   __static_attributes____classdictcell__)__classdict__s   @r   r'   r'      s     	 6I
7 7r   r'   )r)   g     j@)__doc__builtinsr?   _pytest.assertion.rewrite	assertionrewriter<   pytestdecimalr   r   r   r   app.services.indicators_servicer   r%   r'   rh   r   r   <module>rx      s*    (     2 2 >"7 7r   