PINE LIBRARY
تم تحديثه

lib_statemachine_modified

121
Library "lib_statemachine_modified"

Modified to fix bugs and create getState and priorState methods.

method step(this, before, after, condition)
  Namespace types: StateMachine
  Parameters:
    this (StateMachine)
    before (int): (int): Current state before transition
    after (int): (int): State to transition to
    condition (bool): (bool): Condition to trigger the transition
  Returns: (bool): True if the state changed, else False

method step(this, after, condition)
  Namespace types: StateMachine
  Parameters:
    this (StateMachine)
    after (int): (int): State to transition to
    condition (bool): (bool): Condition to trigger the transition
  Returns: (bool): True if the state changed, else False

method currentState(this)
  Namespace types: StateMachine
  Parameters:
    this (StateMachine)

method previousState(this)
  Namespace types: StateMachine
  Parameters:
    this (StateMachine)

method changed(this, within_bars)
  Namespace types: StateMachine
  Parameters:
    this (StateMachine)
    within_bars (int): (int): Number of bars to look back for a state change
  Returns: (bool): True if a state change occurred within the timeframe, else False

method reset(this, condition, min_occurrences)
  Namespace types: StateMachine
  Parameters:
    this (StateMachine)
    condition (bool): (bool): Condition to trigger the reset
    min_occurrences (int): (int): Minimum number of times the condition must be true to reset
  Returns: (bool): True if the state was reset, else False

StateMachine
  Fields:
    state (series int)
    neutral (series int)
    enabled (series bool)
    reset_counter (series int)
    prior_state (series int)
    last_change_bar (series int)
ملاحظات الأخبار
v2

Added:
method didWeJustChangeThisBar(this)
  Namespace types: StateMachine
  Parameters:
    this (StateMachine)

method didWeChangeFromTo(this, fromState, toState, within_bars)
  Namespace types: StateMachine
  Parameters:
    this (StateMachine)
    fromState (int)
    toState (int)
    within_bars (int)

Updated:
StateMachine
  Fields:
    state (series int)
    neutral (series int)
    enabled (series bool)
    reset_counter (series int)
    prior_state (series int)
    last_change_bar (series int)
    last_distinct_prior_state (series int)
ملاحظات الأخبار
v3

Added:
method getLatestState(this)
  Namespace types: StateMachine
  Parameters:
    this (StateMachine)

Updated:
StateMachine
  Fields:
    state (series int)
    neutral (series int)
    enabled (series bool)
    reset_counter (series int)
    prior_state (series int)
    last_change_bar (series int)
    last_distinct_prior_state (series int)
    stateHistory (array<float>)

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.