TradingView
kaigouthro
27. Okt. 2022 00:50

condition 

Beschreibung

Library "condition"
True/False Condition tools and toggles for booleans and utility.
suggested use is checking if a calculation is required, or can be skipped
speeding up script calculations in realtime and historical scenarios.

isonlywihtout(_first_cond, _second_cond)
  output is true only if first true and second false
  Parameters:
    _first_cond: (bool) First Condition
    _second_cond: (bool) Second Condition
  Returns: True if coditions met

isonlywih(_first_cond, _second_cond)
  output is true only for the first condition if the second condition is also true
  Parameters:
    _first_cond: (bool) First Condition
    _second_cond: (bool) Second Condition
  Returns: True if coditions met

isactive(_cond)
  output is true active only while actively true
  Parameters:
    _cond: (bool) Condition met
  Returns: True if coditions met

isnotactive(_cond)
  output is true only while condition is not active
  Parameters:
    _cond: (bool) Condition met
  Returns: True if coditions met

isontoggle(_cond)
  output is true and holds on True activation , na input has no effect, only a false will disengage
  Parameters:
    _cond: (bool) Condition met
  Returns: True if coditions met

isofftoggle(_cond)
  output is true and holds on False activation, na input has no effect, only a true will disengage
  Parameters:
    _cond: (bool) Condition met
  Returns: True if coditions met

isnotboth(_first_cond, _second_cond)
  output is false only if both are active, either or neither pass true
  Parameters:
    _first_cond: (bool) First Condition
    _second_cond: (bool) Second Condition
  Returns: True if coditions met

isneither(_first_cond, _second_cond)
  output is false only if both are active, either or neither pass true
  Parameters:
    _first_cond: (bool) First Condition
    _second_cond: (bool) Second Condition
  Returns: True if coditions met

isbothtoggled(_first_cond, _second_cond)
  output is true and held when both trigger true, and only disengages if both are false at once
  Parameters:
    _first_cond: (bool) First Condition
    _second_cond: (bool) Second Condition
  Returns: True if coditions met
Kommentare
davewantsmoore
I follow all your libraries. You must be making some incredibly complex scripts if they rely on the all the libs you build. I hope we see them (and can't wait to, if we do).
I get a lot of pointers and tips from reading your code to use in my own... so thankyou for sharing.
kaigouthro
@davewantsmoore, thanks. =) long term plan i came up with a year ago, to build a modular system that anyone can use to pik their own ma, oscillators, etc, and basically plug in whatever indicator they want into a simple strategy builder, my conditions were that it needs minimal inputs, all my final osc and ma's must be float series length inputs and be stable to 100 ms lengths, be able to handle the full 40 tickers at a time, able to portfolio balance without input, transfer between assets not only arbitrage but stocks to futures or crypto, alerts and full equity management that accounts for unknown balances (percent based), with stop triggers for market plunges, and be able to operate on any candles desired with smart ordering at intra-bar peaks and valleys of seconds based candles even on a day candle chart.. main goal of that is to make the end system easy enough that anyone who has a bot/indicator/strategy should be able to adapt their pieces to fit with little trouble... as it goes, pieces will keep coming out, and bugs squished.. if anything is broken or you find a bug or situation where anything throws an error, or you think "wait, why doesn't it do this...".. let me know.. i try very hard to make things that even if something unexpected happens, safeguard themselves, but i am far from bulletproof, i very much value input from others. so, thanks :)
Mehr