Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в Python в модуле re.
Чтобы указать флаг для компилятора нам надо указать его после передаваемой строки. Например, добавляем флаг для игнорирования переноса строки.
pattern = re.compile(r"(\w+)+")
words = pattern.search(text, re.DOTALL)
А как указать несколько флагов? Ведь явно будут ситуации когда нам потребуется больше одного. Кто читал посты по битовые операторы уже понял как.
pattern.search(text, re.DOTALL | re.VERBOSE)
А теперь смотрим исходники, что находится в этих атрибутах?
Не удивительно, степени двойки. Почему? Потому что каждое следующее значение это сдвиг единицы влево.
>>> for n in [1, 2, 4, 8, 16, 32, 64, 128, 256]:
>>>
print(bin(n))
0b1
0b10
0b100
0b1000
0b10000
0b100000
0b1000000
0b10000000
0b100000000
Чтобы было понятней, давайте напишем тоже самое но иначе, добавим ведущие нули:
000000001
000000010
000000100
000001000
000010000
000100000
001000000
010000000
100000000
Не понятно что тут происходит? Читай три поста про битовые операторы начиная с этого ➡️https://t.me/pythonotes/45
В общем, это пример применения побитовых операций в самом Python.
Теперь вы знаете Python еще немного лучше)
#tricks#regex#libs
#SPELL/USDT analysis :
#SPELL is currently in an uptrend, having demonstrated a rejection after testing the support zone. It is expected that the price will bounce back, resuming its bullish momentum and targeting higher price levels.
TF : 1D
Entry : $0.0010768
Target : $0.0020884
SL : $0.0008066
#SPELL/USDT analysis :
#SPELL has faced resistance at the 200 EMA and has broken below the trendline, indicating a continuation of its downtrend. The formation of lower lows (LLs) and lower highs (LHs) suggests this bearish trend is likely to persist until it reaches previous lows.
TF : 4h
Entry : $0.000740
Target : $0.000550
SL : $0.000865
#SPELL/USDT analysis :
#SPELL is currently in an uptrend, trading above the 200 EMA. The price is undergoing a corrective phase and is expected to test the support zone. A bounce from this level is anticipated, which would allow the price to continue its bullish momentum. It is advisable to wait for the price to retest and show signs of a bounce from the support zone before considering a long entry.
TF : 4H
Entry : $0.0007415
Target : $0.0009850
SL : $0.0006443
#SPELL/USDT analysis :
#SPELL has recently broken below the 200 EMA and previous support levels, and it has retested these levels. It is now likely to continue its bearish momentum and test the previous lows.
TF : 4h
Entry : $0.000537
Target : $0.000492
SL : $0.000561
#SPELL/USDT analysis :
#SPELL is trading in the resistance zone below the 200 EMA. It is expected that the price gonna face rejection at this level and continue moving downwards. It is advisable to wait for the price to break below the $0.000532 level for an entry.
TF : 2H
Entry : $0.000532
Target : $0.000455
SL : $0.000569
#SPELL LONG
📌Симпатично выглядит технически.
▪График слева - зеркальный уровень, мы видим как тестирует с обратной стороны несколько раз, кажется готовится прорыв.
▪График справа - готовится пробой контртрендовой линии, стоим у границы.
▪Вход: 0.000517$
▪Тейк: буду обновлять.
⚠️Cтоп: 0.00044(-14%)
пс: учитываем, что это альткоин... берем не больше 10% в сделку.
LINK - Maximus Trade|TWITTER