@@ -3386,97 +3386,155 @@ def sell_under_min(self, current_profit: float, last_candle) -> tuple:
33863386 def sell_stoploss (self , current_profit : float , max_profit : float , max_loss : float , last_candle , previous_candle_1 , trade : 'Trade' , current_time : 'datetime' ) -> tuple :
33873387 # Under & near EMA200, local uptrend move
33883388 if (
3389- current_profit < - 0.05
3390- and last_candle ['close' ] < last_candle ['ema_200' ]
3391- and last_candle ['cmf' ] < 0.0
3392- and (last_candle ['ema_200' ] - last_candle ['close' ]) / last_candle ['close' ] < 0.004
3393- and last_candle ['rsi_14' ] > previous_candle_1 ['rsi_14' ]
3394- and last_candle ['rsi_14' ] > last_candle ['rsi_14_1h' ] + 10.0
3395- and last_candle ['sma_200_dec_24' ]
3396- and current_time - timedelta (minutes = 2880 ) > trade .open_date_utc
3389+ ( current_profit < - 0.05 )
3390+ and ( last_candle ['close' ] < last_candle ['ema_200' ])
3391+ and ( last_candle ['cmf' ] < 0.0 )
3392+ and ((( last_candle ['ema_200' ] - last_candle ['close' ]) / last_candle ['close' ]) < 0.004 )
3393+ and last_candle ['rsi_14' ] > previous_candle_1 ['rsi_14' ]
3394+ and ( last_candle ['rsi_14' ] > ( last_candle ['rsi_14_1h' ] + 10.0 ))
3395+ and ( last_candle ['sma_200_dec_24' ])
3396+ and ( current_time - timedelta (minutes = 2880 ) > trade .open_date_utc )
33973397 ):
33983398 return True , 'signal_stoploss_u_e_1'
33993399
34003400 # Under EMA200, local strong uptrend move
34013401 if (
3402- current_profit < - 0.08
3403- and last_candle ['close' ] < last_candle ['ema_200' ]
3404- and last_candle ['cmf' ] < 0.0
3405- and last_candle ['rsi_14' ] > previous_candle_1 ['rsi_14' ]
3406- and last_candle ['rsi_14' ] > last_candle ['rsi_14_1h' ] + 24.0
3407- and last_candle ['sma_200_dec_20' ]
3408- and last_candle ['sma_200_dec_24' ]
3409- and current_time - timedelta (minutes = 2880 ) > trade .open_date_utc
3402+ ( current_profit < - 0.08 )
3403+ and ( last_candle ['close' ] < last_candle ['ema_200' ])
3404+ and ( last_candle ['cmf' ] < 0.0 )
3405+ and last_candle ['rsi_14' ] > previous_candle_1 ['rsi_14' ]
3406+ and ( last_candle ['rsi_14' ] > ( last_candle ['rsi_14_1h' ] + 24.0 ))
3407+ and ( last_candle ['sma_200_dec_20' ])
3408+ and ( last_candle ['sma_200_dec_24' ])
3409+ and ( current_time - timedelta (minutes = 2880 ) > trade .open_date_utc )
34103410 ):
34113411 return True , 'signal_stoploss_u_e_2'
34123412
34133413 # Under EMA200, pair negative, low max rate
34143414 if (
3415- - 0.04 > current_profit > - 0.08
3416- and max_profit < 0.005
3417- and max_loss < 0.08
3418- and last_candle ['close' ] < last_candle ['ema_200' ]
3419- and last_candle ['ema_25' ] < last_candle ['ema_50' ]
3420- and last_candle ['ema_vwma_osc_32' ] < 0
3421- and last_candle ['ema_vwma_osc_64' ] < 0
3422- and last_candle ['ema_vwma_osc_96' ] < 0
3423- and last_candle ['cmf' ] < - 0.0
3424- and current_time - timedelta (minutes = 30 ) > trade .open_date_utc
3415+ (current_profit < - 0.08 )
3416+ and (max_profit < 0.04 )
3417+ and (last_candle ['close' ] < last_candle ['ema_200' ])
3418+ and (last_candle ['ema_25' ] < last_candle ['ema_50' ])
3419+ and (last_candle ['sma_200_dec_20' ])
3420+ and (last_candle ['sma_200_dec_24' ])
3421+ and (last_candle ['sma_200_dec_20_1h' ])
3422+ and (last_candle ['ema_vwma_osc_32' ] < 0.0 )
3423+ and (last_candle ['ema_vwma_osc_64' ] < 0.0 )
3424+ and (last_candle ['ema_vwma_osc_96' ] < 0.0 )
3425+ and (last_candle ['cmf' ] < - 0.0 )
3426+ and (last_candle ['cmf_1h' ] < - 0.0 )
3427+ and (last_candle ['close' ] < last_candle ['sup_level_1h' ])
3428+ and (last_candle ['btc_not_downtrend_1h' ] == False )
3429+ and (current_time - timedelta (minutes = 1440 ) > trade .open_date_utc )
34253430 ):
3426- return True , 'signal_stoploss_u_e_3 '
3431+ return True , 'signal_stoploss_u_e_doom '
34273432
34283433 # Under EMA200, pair and BTC negative, low max rate
34293434 if (
3430- - 0.05 > current_profit > - 0.09
3431- and not last_candle ['btc_not_downtrend_1h' ]
3432- and last_candle ['ema_vwma_osc_32' ] < 0
3433- and last_candle ['ema_vwma_osc_64' ] < 0
3434- and max_profit < 0.005
3435- and max_loss < 0.09
3436- and last_candle ['sma_200_dec_24' ]
3437- and last_candle ['cmf' ] < - 0.0
3438- and last_candle ['close' ] < last_candle ['ema_200' ]
3439- and last_candle ['ema_25' ] < last_candle ['ema_50' ]
3440- and last_candle ['cti' ] < - 0.8
3441- and last_candle ['r_480' ] < - 50.0
3435+ ( - 0.05 > current_profit > - 0.09 )
3436+ and ( last_candle ['btc_not_downtrend_1h' ] == False )
3437+ and ( last_candle ['ema_vwma_osc_32' ] < 0.0 )
3438+ and ( last_candle ['ema_vwma_osc_64' ] < 0.0 )
3439+ and ( max_profit < 0.005 )
3440+ and ( max_loss < 0.09 )
3441+ and ( last_candle ['sma_200_dec_24' ])
3442+ and ( last_candle ['cmf' ] < - 0.0 )
3443+ and ( last_candle ['close' ] < last_candle ['ema_200' ])
3444+ and ( last_candle ['ema_25' ] < last_candle ['ema_50' ])
3445+ and ( last_candle ['cti' ] < - 0.8 )
3446+ and ( last_candle ['r_480' ] < - 50.0 )
34423447 ):
34433448 return True , 'signal_stoploss_u_e_b_1'
34443449
3445- # Under EMA200, pair & BTC negative, CTI, downtrend , normal max rate
3446- if (
3447- - 0.1 > current_profit > - 0.2
3448- and not last_candle ['btc_not_downtrend_1h' ]
3449- and last_candle ['ema_vwma_osc_32' ] < 0
3450- and last_candle ['ema_vwma_osc_64' ] < 0
3451- and last_candle ['ema_vwma_osc_96' ] < 0
3452- and max_profit < 0.05
3453- and max_loss < 0.2
3454- and last_candle ['sma_200_dec_24' ]
3455- and last_candle ['sma_200_dec_20_1h' ]
3456- and last_candle ['cmf' ] < - 0.45
3457- and last_candle ['close' ] < last_candle ['ema_200' ]
3458- and last_candle ['ema_25' ] < last_candle ['ema_50' ]
3459- and last_candle ['cti' ] < - 0.8
3460- and last_candle ['r_480' ] < - 97.0
3450+ # Under EMA200, pair and BTC negative, CTI, Elder Ray Index negative , normal max rate
3451+ elif (
3452+ ( - 0.1 > current_profit > - 0.2 )
3453+ and ( last_candle ['btc_not_downtrend_1h' ] == False )
3454+ and ( last_candle ['ema_vwma_osc_32' ] < 0.0 )
3455+ and ( last_candle ['ema_vwma_osc_64' ] < 0.0 )
3456+ and ( last_candle ['ema_vwma_osc_96' ] < 0.0 )
3457+ and ( max_profit < 0.05 )
3458+ and ( max_loss < 0.2 )
3459+ and ( last_candle ['sma_200_dec_24' ])
3460+ and ( last_candle ['sma_200_dec_20_1h' ])
3461+ and ( last_candle ['cmf' ] < - 0.45 )
3462+ and ( last_candle ['close' ] < last_candle ['ema_200' ])
3463+ and ( last_candle ['ema_25' ] < last_candle ['ema_50' ])
3464+ and ( last_candle ['cti' ] < - 0.8 )
3465+ and ( last_candle ['r_480' ] < - 97.0 )
34613466 ):
34623467 return True , 'signal_stoploss_u_e_b_2'
34633468
34643469 # Under EMA200, pair and BTC negative, low max rate
34653470 if (
3466- - 0.04 > current_profit > - 0.07
3467- and last_candle ['ema_vwma_osc_32' ] < 0
3468- and last_candle ['ema_vwma_osc_64' ] < 0
3469- and max_profit < 0.005
3470- and max_loss < 0.07
3471- and last_candle ['sma_200_dec_24' ]
3472- and last_candle ['close' ] < last_candle ['ema_200' ]
3473- and last_candle ['ema_25' ] < last_candle ['ema_50' ]
3474- and last_candle ['cmf' ] < - 0.0
3475- and last_candle ['r_480' ] < - 50.0
3476- and not last_candle ['btc_not_downtrend_1h' ]
3471+ ( - 0.04 > current_profit > - 0.07 )
3472+ and ( last_candle ['ema_vwma_osc_32' ] < 0.0 )
3473+ and ( last_candle ['ema_vwma_osc_64' ] < 0.0 )
3474+ and ( max_profit < 0.005 )
3475+ and ( max_loss < 0.07 )
3476+ and ( last_candle ['sma_200_dec_24' ])
3477+ and ( last_candle ['close' ] < last_candle ['ema_200' ])
3478+ and ( last_candle ['ema_25' ] < last_candle ['ema_50' ])
3479+ and ( last_candle ['cmf' ] < - 0.0 )
3480+ and ( last_candle ['r_480' ] < - 50.0 )
3481+ and ( last_candle ['btc_not_downtrend_1h' ] == False )
34773482 ):
34783483 return True , 'signal_stoploss_u_e_b_3'
34793484
3485+
3486+ # Under EMA200, pair & BTC negative, low max rate, short trade duration
3487+ if (
3488+ (- 0.04 > current_profit > - 0.09 )
3489+ and (max_profit < 0.005 )
3490+ and (max_loss < 0.09 )
3491+ and (last_candle ['close' ] < last_candle ['ema_200' ])
3492+ and (last_candle ['ema_25' ] < last_candle ['ema_50' ])
3493+ and (last_candle ['ema_vwma_osc_32' ] < 0.0 )
3494+ and (last_candle ['ema_vwma_osc_64' ] < 0.0 )
3495+ and (last_candle ['ema_vwma_osc_96' ] < 0.0 )
3496+ and (last_candle ['cmf' ] < - 0.1 )
3497+ and (last_candle ['r_480' ] < - 75.0 )
3498+ and (last_candle ['close' ] < last_candle ['sup_level_1h' ])
3499+ and (current_time - timedelta (minutes = 60 ) < trade .open_date_utc )
3500+ and (last_candle ['btc_not_downtrend_1h' ] == False )
3501+ ):
3502+ return True , 'signal_stoploss_u_e_b_4'
3503+
3504+ # Under EMA200, pair & BTC negative, low max rate, short trade duration
3505+ if (
3506+ (- 0.04 > current_profit > - 0.09 )
3507+ and (max_profit < 0.015 )
3508+ and (max_loss < 0.09 )
3509+ and (last_candle ['close' ] < last_candle ['ema_200' ])
3510+ and (last_candle ['ema_25' ] < last_candle ['ema_50' ])
3511+ and (last_candle ['ema_vwma_osc_32' ] < 0.0 )
3512+ and (last_candle ['ema_vwma_osc_64' ] < 0.0 )
3513+ and (last_candle ['ema_vwma_osc_96' ] < 0.0 )
3514+ and (last_candle ['cmf' ] < - 0.2 )
3515+ and (last_candle ['close' ] < last_candle ['sup_level_1h' ])
3516+ and (current_time - timedelta (minutes = 180 ) < trade .open_date_utc )
3517+ and (last_candle ['btc_not_downtrend_1h' ] == False )
3518+ ):
3519+ return True , 'signal_stoploss_u_e_b_5'
3520+
3521+ # Under EMA200, pair & BTC negative, low max rate, short trade duration
3522+ if (
3523+ (- 0.04 > current_profit > - 0.1 )
3524+ and (max_profit < 0.015 )
3525+ and (last_candle ['close' ] < last_candle ['ema_200' ])
3526+ and (last_candle ['ema_25' ] < last_candle ['ema_50' ])
3527+ and (last_candle ['ema_vwma_osc_32' ] < 0.0 )
3528+ and (last_candle ['ema_vwma_osc_64' ] < 0.0 )
3529+ and (last_candle ['ema_vwma_osc_96' ] < 0.0 )
3530+ and (last_candle ['cmf' ] < - 0.25 )
3531+ and (last_candle ['r_480' ] < - 75.0 )
3532+ and (last_candle ['close' ] < last_candle ['sup_level_1h' ])
3533+ and (current_time - timedelta (minutes = 60 ) < trade .open_date_utc )
3534+ and (last_candle ['btc_not_downtrend_1h' ] == False )
3535+ ):
3536+ return True , 'signal_stoploss_u_e_b_6'
3537+
34803538 return False , None
34813539
34823540 def sell_pump_dec (self , current_profit : float , last_candle ) -> tuple :
0 commit comments