TradeWiseWithEase

BE_CustomFx_Library

TradeWiseWithEase Premium 업데이트됨   
Library "BE_CustomFx_Library"
A handful collection of regular functions, Custom Tools & Utility Functions could be used in regular Scripts. hope these functions can be understood by a non programmer like me too.

G_TextValOfNumber(ValueToConvert, RequiredDecimalPlaces, BeginingChar, EndChar) Function to return the String Value of Number with decimal precision with the prefix and suffix characters provided
  Parameters:
    ValueToConvert: = Number to Convert
    RequiredDecimalPlaces: = No of Decimal values Required. supports to a max of 5 decimals else defaults to 2
    BeginingChar: = Prefix character which is needed.
    EndChar: = Suffix character which is needed.
  Returns: Returns Out put with formated value of Given Number for the specified deicimal values with Prefix and suffix string

G_TradableValue(ValueToConvert, NeedCustomization, RequiredDecimalPlaces) Function to return the Tradable Value of Number
  Parameters:
    ValueToConvert: = Number to Convert
    NeedCustomization: = set to 1 if you want to customize the decimal percision values. default is No customization needed, which provides output equalent to round_to_mintick
    RequiredDecimalPlaces: = if NeedCustomization is set to 1 mention the decimal percision value required. max supported decimal is 5 else defaults to 2
  Returns: Returns Out put with formated value of Given Number

G_TxtSizeForLables(SizeValue) Function to Get size Value for text values used in Lables
  Parameters:
    SizeValue: = auto, tiny, small, normal, large, huge. specify either of these values or default value Normal will be displayed as output
  Returns: Returns Respective Text size

G_Reg_LineType(LineType) Function to Get Line Style Value for text values used in Lines
  Parameters:
    LineType: = 'solid (─)', 'dotted (┈)', 'dashed (╌)', 'arrow left (←)', 'arrow right (→)', 'arrows both (↔)' or default line style 'dotted (┈)' will be the output
  Returns: Returns Respective Line style

G_ShapeTypeForLables(ShapeType) Function to Get Shape Style Value for text values used in plot shapes
  Parameters:
    ShapeType: = 'XCross', 'Cross', 'Triangle Up', 'Triangle Down', 'Flag', 'Circle','Arrow Up', 'Arrow Down','Lable Up', 'Lable Down' or default shpae style Triangle Up will be the output
  Returns: Returns Respective Shape style

G_Indicator_Val(string, float, int, int) Gets Output of the technical analyis indicator which has length Parameter. RSI , ATR, EMA , SMA , HMA , WMA , VWMA , 'CMO', 'MOM', 'ROC','VWAP'
  Parameters:
    string: IndicatorName to be specified
    float: SrcVal for the TA indicator default is close
    int: Length for the TA indicator
    int: DecimalValue optional to specify if required formatted output with decimal percision
  Returns: Value with the given parameters

G_CandleInfo(string, bool, float, bool) function to get Candle Informarion such as both wicksize, top wick size , bottom wick size, full candle size and body size in default points
  Parameters:
    string: WhatCandleInfo, string input with either of these options "Wick" , "TWick" , "BWick" , "Candle", "Body" , "BearfbVal", "BullfbVal" , "CandleOpen" ,"CandleClose", "CandleHigh" , "CandleLow", "BodyPct"
    bool: RepaintingVersion, set to true if required data on the realtime bar else default is set to false
    float: FibValueOfCandle, set the fibo value to extract fibvalue of the candle else default is set to 38.2%
    bool: AccountforGaps, set to true if required data on considering the gap between previous and current bar else default is set to false
  Returns: Returns Respective values for the candles

G_BullBearBarCount(int, int) Counts how many green & red bars have printed recently ( ie . pullback count)
  Parameters:
    int: HowManyCandlesToCheck The lookback period to look back over
    int: BullBear The color of the bar to count (1 = Bull, -1 = Bear), Open = close candles are ignored
  Returns: The bar count of how many candles have retraced over the given lookback with specific candles

BarToStartYourCalculation(Int) function to get candle co-ordinate in order to use it further for calculating your analysis work . "Heart full Thanks to 3 Pine motivators (LonesomeTheBlue, Myank & Sriki) who helped me cracking this logic"
  Parameters:
    Int: SelectedCandleNumber (default=450) How many candles you would need to anlysie in your script from the right.
  Returns: A boolean - output is returned to say the starting point and continue to diplay true for the future candles

isHammer(float, bool, bool) Checks if the current bar is a hammer candle based on the given parameters
  Parameters:
    float: fib (default=0.382) The fib to base candle body on
    bool: colorMatch (default=false) Does the candle need to be green? (true/false)
    bool: NeedRepainting (default=false) Specify True if you need them to calculate on the realtime bars
  Returns: A boolean - true if the current bar matches the requirements of a hammer candle

isStar(float, bool, bool) Checks if the current bar is a shooting star candle based on the given parameters
  Parameters:
    float: fib (default=0.382) The fib to base candle body on
    bool: colorMatch (default=false) Does the candle need to be red? (true/false)
    bool: NeedRepainting (default=false) Specify True if you need them to calculate on the realtime bars
  Returns: A boolean - true if the current bar matches the requirements of a shooting star candle

isDoji(float, float, bool) Checks if the current bar is a doji candle based on the given parameters
  Parameters:
    float: _wickSize (default=1.5 times) The maximum allowed times can be top wick size compared to the bottom (and vice versa)
    float: _bodySize (default= 5 percent to be mentioned as 0.05) The maximum body size as a percentage compared to the entire candle size
    bool: NeedRepainting (default=false) Specify true if you need them to calculate on the realtime bars
  Returns: A boolean - true if the current bar matches the requirements of a doji candle

isBullishEC(float, float, bool, bool) Checks if the current bar is a bullish engulfing candle
  Parameters:
    float: _allowance (default=0) How many POINTS to allow the open to be off by (useful for markets with micro gaps)
    float: _rejectionWickSize (default=disabled) The maximum rejection wick size compared to the body as a percentage
    bool: _engulfWick (default=false) Does the engulfing candle require the wick to be engulfed as well?
    bool: NeedRepainting (default=false) Specify True if you need them to calculate on the realtime bars
  Returns: A boolean - true if the current bar matches the requirements of a bullish engulfing candle

isBearishEC(float, float, bool, bool) Checks if the current bar is a bearish engulfing candle
  Parameters:
    float: _allowance (default=0) How many POINTS to allow the open to be off by (useful for markets with micro gaps)
    float: _rejectionWickSize (default=disabled) The maximum rejection wick size compared to the body as a percentage
    bool: _engulfWick (default=false) Does the engulfing candle require the wick to be engulfed as well?
    bool: NeedRepainting (default=false) Specify True if you need them to calculate on the realtime bars
  Returns: A boolean - true if the current bar matches the requirements of a bearish engulfing candle

Plot_TrendLineAtDegree(float, float, int, string, bool) helps you to plot the Trendlines based on the specified angle at the defined price to bar ratio
  Parameters:
    float: Degree (default=14) angle at which Trendline to be plot
    float: price2bar_ratio (default=1e-10) The maximum rejection wick size compared to the body as a percentage
    int: Bars2Plot (default=6) Does the engulfing candle require the wick to be engulfed as well?
    string: LineStyle = 'solid (─)', 'dotted (┈)', 'dashed (╌)', 'arrow left (←)', 'arrow right (→)', 'arrows both (↔)' or default line style 'dotted (┈)' will be the output
    bool: PlotOnOpen_Close (default=false) Specify True if you need them to calculate on the Open\Close Values
  Returns: plot the Trendlines based on the specified angle at the defined price to bar ratio
릴리즈 노트: v2

Added:
G_Pct_Chng(float, float, int) Gets the percentage change between 2 float values over a given lookback period
  Parameters:
    float: value1 The first value to reference
    float: value2 The second value to reference
    int: lookback The lookback period to analyze

G_ITM(string, bool, int, bool, int) to calculate the ITM stike for the defined strike change
  Parameters:
    string: source (default='c') specify either of the source value Note: Be mindful as it may be repainted and calulation to be called on every bar
    bool: NeedRepainting (default=true) Specify false if you need them to calculate on the completed bars
    int: StrikeDiff (default=100) Specify the strike difference value. eg = Nifty = 50 and BNF = 100
    bool: ForCE (default=true) Specify false if you need them to calculate for PE option
    int: HowDeep (default=1) Specify the level.
  Returns: the strike price for the options speficied

G_OTM(string, bool, int, bool, int) to calculate the OTM stike for the defined strike change
  Parameters:
    string: source (default='c') specify either of the source value Note: Be mindful as it may be repainted and calulation to be called on every bar
    bool: NeedRepainting (default=true) Specify false if you need them to calculate on the completed bars
    int: StrikeDiff (default=100) Specify the strike difference value. eg = Nifty = 50 and BNF = 100
    bool: ForCE (default=true) Specify false if you need them to calculate for PE option
    int: HowDeep (default=1) Specify the level.
  Returns: the strike price for the options speficied

G_ATM(string, bool, int) to calculate the ATM stike for the defined strike change
  Parameters:
    string: source (default='c') specify either of the source value Note: Be mindful as it may be repainted and calulation to be called on every bar
    bool: NeedRepainting (default=true) Specify false if you need them to calculate on the completed bars
    int: StrikeDiff (default=100) Specify the strike difference value. eg = Nifty = 50 and BNF = 100
  Returns: the strike price for the options speficied

Chk_TradingTime(string) Determines if the bar's time falls within time filter range
  Parameters:
    string: SessionPeriod (default = "GMT+5:30")Opening Market peak time
  Returns: A boolean - true if the current bar falls within the given time

Updated:
isDoji(float, float, bool) Checks if the current bar is a doji candle based on the given parameters
  Parameters:
    float: wickSize (default=1.5 times) The maximum allowed times can be top wick size compared to the bottom (and vice versa)
    float: bodySize (default= 5 percent to be mentioned as 0.05) The maximum body size as a percentage compared to the entire candle size
    bool: NeedRepainting (default=false) Specify true if you need them to calculate on the realtime bars
  Returns: A boolean - true if the current bar matches the requirements of a doji candle

isBullishEC(float, float, bool, bool) Checks if the current bar is a bullish engulfing candle
  Parameters:
    float: allowance (default=0) How many POINTS to allow the open to be off by (useful for markets with micro gaps)
    float: rejectionWickSize (default=disabled) The maximum rejection wick size compared to the body as a percentage
    bool: engulfWick (default=false) Does the engulfing candle require the wick to be engulfed as well?
    bool: NeedRepainting (default=false) Specify True if you need them to calculate on the realtime bars
  Returns: A boolean - true if the current bar matches the requirements of a bullish engulfing candle

isBearishEC(float, float, bool, bool) Checks if the current bar is a bearish engulfing candle
  Parameters:
    float: allowance (default=0) How many POINTS to allow the open to be off by (useful for markets with micro gaps)
    float: rejectionWickSize (default=disabled) The maximum rejection wick size compared to the body as a percentage
    bool: engulfWick (default=false) Does the engulfing candle require the wick to be engulfed as well?
    bool: NeedRepainting (default=false) Specify True if you need them to calculate on the realtime bars
  Returns: A boolean - true if the current bar matches the requirements of a bearish engulfing candle
릴리즈 노트: v3

Added:
OperatorChk(flot, string, CompareVal1, CompareVal2) to compare the value against and provide the boolean output
  Parameters:
    flot: val2chk = Number to check
    string: OperatorTxt = Set to E for ==, NE for !=, G for >, GE for >=, L for <, LE for <= , BE for <= and >= (Between with Equal) and ather string for >< (Between with greater Lesser)
    CompareVal1: = single input to compare against Val2Chk
    CompareVal2: = incase of between scenarios thsi will be used
  Returns: Returns bool Output if compared value found to be true

Plot_TLWithZones(int, int, float, float, int, int, LineType) which plots the lines from point A to B whith specified inputs and returns the expected string Outputs
  Parameters:
    int: FrmCan - FromCandle barindex of the left point of the line
    int: ToCan - ToCandle barindex of the right point of the line
    float: FrmVal - FromValue value of the left point of trendline
    float: ToVal - ToValue value of the right point of trendline
    int: Ext - Extend (default = 1) 1 = extend right, 2 = extend both , 3 = extend none
    int: wdt - width (default = 1) line width
    LineType: = 'solid (─)', 'dotted (┈)', 'dashed (╌)', 'arrow left (←)', 'arrow right (→)', 'arrows both (↔)' or default line style 'dotted (┈)' will be the output
  Returns: Tuples with usefull informations of the trend Lines

G_HighFreqValue(bool, int, float, float, string, minTouch, ErrorRateTicks, bool, bool, bool, bool) to retrieve the highest frequency value for the given lookback period
  Parameters:
    bool: NeedMaxTouch default is true to identift the highest touched value above the filter value
    int: LookBackPeriod - default is 50
    float: FilterVal1 - default is 0 (include All)
    float: FilterVal2 - default is 0 (will be used only in between scenario)
    string: FilterValOperator - Set to E for ==, NE for !=, G for >, GE for >=, L for <, LE for <= , BE for <= and >= (Between with Equal) and ather string for >< (Between with greater Lesser)
    minTouch: = Minimum Touches to be tested (default is 3)
    ErrorRateTicks: = if in case of exact touch is not happened how much error rate can be included (default is 10 minticks)
    bool: IncludeOpen - default is true
    bool: IncludeHigh - default is true
    bool: IncludeLow - default is true
    bool: IncludeClose - default is true
  Returns: highest frequency value in tuples form

Updated:
G_CandleInfo(string, bool, float, bool, float) function to get Candle Informarion such as both wicksize, top wick size , bottom wick size, full candle size and body size in default points
  Parameters:
    string: WhatCandleInfo, string input with either of these options "Wick" , "TWick" , "BWick" , "Candle", "Body" , "BearfbVal", "BullfbVal" , "CandleOpen" ,"CandleClose", "CandleHigh" , "CandleLow", "BodyPct","ExtractVal"
    bool: RepaintingVersion, set to true if required data on the realtime bar else default is set to false
    float: FibValueOfCandle, set the fibo value to extract fibvalue of the candle else default is set to 38.2%
    bool: AccountforGaps, set to true if required data on considering the gap between previous and current bar else default is set to false
    float: MidVal, set the % value in order to extract the value for the candle
  Returns: Returns Respective values for the candles

BarToStartYourCalculation(Int) function to get candle co-ordinate in order to use it further for calculating your analysis work . "Heart full Thanks to 3 Pine motivators (LonesomeTheBlue, Myank & Sriki) who helped me cracking this logic"
  Parameters:
    Int: SelectedCandleNumber (default=450) How many candles you would need to anlysie in your script from the right.
  Returns: A boolean - output is returned to say the starting point and continue to diplay true for the future candles
릴리즈 노트: v4

Added:
G_Pivots(int, float, string, int, int, tuples) to retrieve the Pivot High and Low points (Highest Point and the latest PH and similarly Lowest Point and the latest PL)
  Parameters:
    int: StartScanFrom default is 150
    float: Source - default is close, will be used if the source is an external indicator
    string: PlotOnType - default is "HL" (possible use cases can be either "HL", "OC" or any any other string character so that it uses Source param to calculate the Pivot points)
    int: LBC - default is 4 Look Back period for Pivot points
    int: LBF - default is 2 Look forwar period for confirming the Pivot points
    tuples: with useful information regarding pivot points

Updated:
G_BullBearBarCount(int, int) Counts how many green & red bars have printed recently (ie. pullback count)
  Parameters:
    int: HowManyCandlesToCheck The lookback period to look back over
    int: BullBear The color of the bar to count (1 = Bull, -1 = Bear), Open = close candles are ignored
  Returns: The bar count of how many candles have retraced over the given lookback with specific candles

Plot_TLWithZones(int, int, float, float, int, int, LineType, bool, simple) which plots the lines from point A to B whith specified inputs and returns the expected string Outputs
  Parameters:
    int: FrmCan - FromCandle barindex of the left point of the line
    int: ToCan - ToCandle barindex of the right point of the line
    float: FrmVal - FromValue value of the left point of trendline
    float: ToVal - ToValue value of the right point of trendline
    int: Ext - Extend (default = 1) 1 = extend right, 2 = extend both , 3 = extend none
    int: wdt - width (default = 1) line width
    LineType: = 'solid (─)', 'dotted (┈)', 'dashed (╌)', 'arrow left (←)', 'arrow right (→)', 'arrows both (↔)' or default line style 'dotted (┈)' will be the output
    bool: Restructure = default (true) , while plotting TrendLine, if there are any breaks already happend then it reassigns the trendline to the correct points
    simple: string RestructureOn = "HL", possible output can be "HL" or "OC"
  Returns: Tuples with usefull informations of the trend Lines
릴리즈 노트: v5 removed some small bugs
릴리즈 노트: v6

Added:
G_Delta(int, int, simple, bool) Gets Delta Output of the technical analyis indicator
  Parameters:
    int: ShortLength to be specified default is 3
    int: LongLength to be specified default is 8
    simple: string MAType for the TA indicator supported are EMA, SMA, HMA
    bool: RepaintingVersion calculate on realtime bar? default is true.
  Returns: Value with the given parameters
릴리즈 노트: v7
minor Tweak to TLWithZones and Added MorePivots to GetPivot Function
릴리즈 노트: v8 Minor fix on Pivot Output was referring to incorrect Values.
릴리즈 노트: v9
1. Enabled Trailing Pivot for further Usage.
2. Pivot Algorithm Changed a Bit to be more constant.
3. Bug fixed for Max Bars Back Error when applied.
릴리즈 노트: v10
Minor Changes to Pivot to remove unused Pivots to speed up some calculations.
릴리즈 노트: v11

Added:
Get_TradeManagementInfo(Specify) to retrieve the Trade related informations
  Parameters:
    Specify: the ArraysOf related parameters
  Returns: tuples with useful information regarding Trades taken
릴리즈 노트: v12
Minor Bugs fixed
릴리즈 노트: v13

Updated: Included Qty Traded in Output
Get_TradeManagementInfo(Specify) to retrieve the Trade related informations
  Parameters:
    Specify: the ArraysOf related parameters
  Returns: tuples with useful information regarding Trades taken
릴리즈 노트: v14 minor bug fixed
릴리즈 노트: v15
Alogrithm changed for TradeManagementInfo
릴리즈 노트: v16
Minor Bug fixed and added Net final Position for the TradeManagement Info
릴리즈 노트: v17
Simplified OperatorCheck
릴리즈 노트: v18

Added:
TrackTradeHappening(Specify) to plot Long/Short Trade Boxes which help saving time in plotting them on chart
  Parameters:
    Specify: the values against related parameters
릴리즈 노트: v19

Updated:
TrackTradeHappening(Specify) to plot Long/Short Trade Boxes which help saving time in plotting them on chart
  Parameters:
    Specify: the values against related parameters
릴리즈 노트: v20
Minro Bug Fixed
Updated:
TrackTradeHappening(Specify) to plot Long/Short Trade Boxes which help saving time in plotting them on chart
  Parameters:
    Specify: the values against related parameters
릴리즈 노트: v21
Minor Bugs Fixed for Pivots Points
릴리즈 노트: v22
Minor Bug Fixed for PNL Values Calculation
릴리즈 노트: v23

Updated:
G_HighFreqValue(int, float, float, string, minTouch, ErrorRateTicks, bool, bool, bool, bool) to retrieve the highest frequency value for the given lookback period
  Parameters:
    int: LookBackPeriod - default is 50
    float: FilterVal1 - default is 0 (include All)
    float: FilterVal2 - default is 0 (will be used only in between scenario)
    string: FilterValOperator - Set to E for ==, NE for !=, G for >, GE for >=, L for <, LE for <= , BE for <= and >= (Between with Equal) and ather string for >< (Between with greater Lesser)
    minTouch: = Minimum Touches to be tested (default is 3)
    ErrorRateTicks: = if in case of exact touch is not happened how much error rate can be included (default is 10 minticks)
    bool: IncludeOpen - default is true
    bool: IncludeHigh - default is true
    bool: IncludeLow - default is true
    bool: IncludeClose - default is true
  Returns: tuples with MaxTouchValue and HighestRange and LowestRange
릴리즈 노트: v24

Updated:
G_TextValOfNumber(float, int, string, string) Function to return the String Value of Number with decimal precision with the prefix and suffix characters provided
  Parameters:
    float: ValueToConvert = Number to Convert
    int: RequiredDecimalPlaces = No of Decimal values Required. supports to a max of 5 decimals else defaults to 2
    string: BeginingChar = Prefix character which is needed.
    string: EndChar = Suffix character which is needed.
  Returns: Returns Out put with formated value of Given Number for the specified deicimal values with Prefix and suffix string
릴리즈 노트: v25
Minor Bug Fixed with HighFrequency Value
릴리즈 노트: v26

Minor Update for SpeedImprovement for HighFrequency
릴리즈 노트: v27

bug Fixing
릴리즈 노트: v28

Added:
IsPoweredPushBuy() To Check if the candle is a powered Push or Not

IsPoweredPushSell() To Check if the candle is a powered Push or Not
릴리즈 노트: v29
Cosmetic changes (Formattef code) done. New algorithm to publish for few function. Removed few defaults for better readability.
릴리즈 노트: v30

Added: Created CustomFx for DhanHQ Api JSON
CreateJSON()
릴리즈 노트: v31
Minor Bug Fix for JSON for DHAN_HQ
릴리즈 노트: v32

Added:
G_TablePositon()
릴리즈 노트: v33

Added:
GetTicker()

G_RespectingLineIndex()
릴리즈 노트: v34

Updated:
G_RespectingLineIndex()
릴리즈 노트: v35

Updated:
CreateJSON()
릴리즈 노트: v36

Added:
GetTickerPrfx()
릴리즈 노트: v37
Minor Bug Fix for TradeManagment.
릴리즈 노트: v38
Minor Bug Fixed
릴리즈 노트: v39

Updated:
G_ITM()

G_OTM()

G_ATM()
릴리즈 노트: v40

Updated:
G_ITM(string, bool, int, bool, int)
  to calculate the ITM stike for the defined strike change
  Parameters:
    string: source (default='c') specify either of the source value Note: Be mindful as it may be repainted and calulation to be called on every bar
    bool: NeedRepainting (default=true) Specify false if you need them to calculate on the completed bars
    int: StrikeDiff (default=100) Specify the strike difference value. eg = Nifty = 50 and BNF = 100
    bool: ForCE (default=true) Specify false if you need them to calculate for PE option
    int: HowDeep (default=1) Specify the level.
  Returns: the strike price for the options speficied

G_OTM(string, bool, int, bool, int)
  to calculate the OTM stike for the defined strike change
  Parameters:
    string: source (default='c') specify either of the source value Note: Be mindful as it may be repainted and calulation to be called on every bar
    bool: NeedRepainting (default=true) Specify false if you need them to calculate on the completed bars
    int: StrikeDiff (default=100) Specify the strike difference value. eg = Nifty = 50 and BNF = 100
    bool: ForCE (default=true) Specify false if you need them to calculate for PE option
    int: HowDeep (default=1) Specify the level.
  Returns: the strike price for the options speficied

G_ATM(string, bool, int)
  to calculate the ATM stike for the defined strike change
  Parameters:
    string: source (default='c') specify either of the source value Note: Be mindful as it may be repainted and calulation to be called on every bar
    bool: NeedRepainting (default=true) Specify false if you need them to calculate on the completed bars
    int: StrikeDiff (default=100) Specify the strike difference value. eg = Nifty = 50 and BNF = 100
  Returns: the strike price for the options speficied
릴리즈 노트: v41

Updated:
G_ITM(string, bool, int, bool, int, float, float)
  to calculate the ITM stike for the defined strike change
  Parameters:
    string: source (default='c') specify either of the source value Note: Be mindful as it may be repainted and calulation to be called on every bar
    bool: NeedRepainting (default=true) Specify false if you need them to calculate on the completed bars
    int: StrikeDiff (default=100) Specify the strike difference value. eg = Nifty = 50 and BNF = 100
    bool: ForCE (default=true) Specify false if you need them to calculate for PE option
    int: HowDeep (default=1) Specify the level.
    float: SVal (default=0) Specify the source value.
    float: CalibaratePct (default=0, min = 0 and max = 1) Specify the percentage value. eg if calibarion is set for 50% on the banknifty close price with 30030.5 ITM CE 1 deep will show 29900 how ever if close price is 30070.5 ITM CE with 1 deep will show 30000
  Returns: the strike price for the options speficied

G_OTM(string, bool, int, bool, int, float, float)
  to calculate the OTM stike for the defined strike change
  Parameters:
    string: source (default='c') specify either of the source value Note: Be mindful as it may be repainted and calulation to be called on every bar
    bool: NeedRepainting (default=true) Specify false if you need them to calculate on the completed bars
    int: StrikeDiff (default=100) Specify the strike difference value. eg = Nifty = 50 and BNF = 100
    bool: ForCE (default=true) Specify false if you need them to calculate for PE option
    int: HowDeep (default=1) Specify the level.
    float: SVal (default=0) Specify the source value.
    float: CalibaratePct (default=0, min = 0 and max = 1) Specify the percentage value. eg if calibarion is set for 50% on the banknifty close price with 30030.5 ITM CE 1 deep will show 29900 how ever if close price is 30070.5 ITM CE with 1 deep will show 30000
  Returns: the strike price for the options speficied

G_ATM(string, bool, int, float, float)
  to calculate the ATM stike for the defined strike change
  Parameters:
    string: source (default='c') specify either of the source value Note: Be mindful as it may be repainted and calulation to be called on every bar
    bool: NeedRepainting (default=true) Specify false if you need them to calculate on the completed bars
    int: StrikeDiff (default=100) Specify the strike difference value. eg = Nifty = 50 and BNF = 100
    float: SVal (default=0) Specify the source value.
    float: CalibaratePct (default=0, min = 0 and max = 1) Specify the percentage value. eg if calibarion is set for 50% on the banknifty close price with 30030.5 ITM CE 1 deep will show 29900 how ever if close price is 30070.5 ITM CE with 1 deep will show 30000
  Returns: the strike price for the options speficied
릴리즈 노트: v42

Added:
ScriptConvertor(ExpectedOutput)
  Parameters:
    ExpectedOutput: AcceptableValue = "Name", "Type", "Exp"

DiscordBasicJSON()

DiscordTradingJSON(TradeType, BuyOrSell, EqOrFutOrOp, TradeQty, ScriptName, OrderType, OrderType, OrderType, HowDeep, CEorPE, Expiry, BO_Tgt, BO_SL, CO_SL)
  Parameters:
    TradeType: acceptable Inputs are I (for MIS / Intraday), CO (for Cover Order), BO (for Bracket Order)
    BuyOrSell: acceptable Inputs are B or S
    EqOrFutOrOp: acceptable Inputs are E (for Equity), F (for Futures), O (for Options)
    TradeQty: string format (default = 25 Qty)
    ScriptName: string format
    OrderType: acceptable Inputs are "" (for Market), "XXX.XX" (143.05 to place Limit Orders at 143.05), Continued Below 2 other acceptable inputs...
    OrderType: "X.X%" (1.25% to place Limit orders at specified percentage Below Market price for BUY, and Above Market price for SELL)
    OrderType: "A X.X%" or "B X.X%" or "A 154.0" or "B 125.0" (A 0.75% to place BUY SL-Limit orders at specified percentage Above Market price for BUY, B 1.05% to place SELL SL-Limit orders at specified percentage Below Market price for SELL)
    HowDeep: acceptable Inputs are "0" (for ATM option), "1" (Positive Numbers for ITM), "-1" (Negative Numbers for OTM) or "" (for Non Expiry Orders)
    CEorPE: acceptable Inputs are CE, PE or "" (for Non Option Orders)
    Expiry: acceptable Inputs are C (for Current Expiry), N (for Next Expiry) or "" (for Non Expiry Orders)
    BO_Tgt: acceptable Inputs are "X" (5 for Rs.5 Target Point), "X.X%" (1.2% for capturing specified percentage rise in price as Target Points for BUY) or "" (for Non BO Orders)
    BO_SL: acceptable Inputs are "X" (3 for Rs.3 SL Point), "X.X%" (0.75% for specified percentage fall in price as SL Points for BUY) or "" (for Non BO Orders)
    CO_SL: acceptable Inputs are "+X" (+3 for Rs.3 above current price for Sell Trade), "-X" (-5 for Rs.5 below current price for Buy Trade), "XXX.X" (125.5 will be applied as SL Value for CO Order) or "" (for Non Expiry Orders)
릴리즈 노트: v43

Updated:
G_ATM(string, bool, int, float, float)
  to calculate the ATM stike for the defined strike change
  Parameters:
    string: source (default='c') specify either of the source value Note: Be mindful as it may be repainted and calulation to be called on every bar
    bool: NeedRepainting (default=true) Specify false if you need them to calculate on the completed bars
    int: StrikeDiff (default=100) Specify the strike difference value. eg = Nifty = 50 and BNF = 100
    float: SVal (default=0) Specify the source value.
    float: CalibaratePct (default=0, min = 0 and max = 1) Specify the percentage value. eg if calibarion is set for 50% on the banknifty close price with 30030.5 ITM CE 1 deep will show 29900 how ever if close price is 30070.5 ITM CE with 1 deep will show 30000
  Returns: the strike price for the options speficied
릴리즈 노트: v44
Minor Bug Fixed
릴리즈 노트: v45

Added:
TriggerAfter(_cond, _resetCond)
  Parameters:
    _cond: acceptable Inputs are seconds to wait and then trigger the output as NA
    _resetCond: acceptable Inputs are true or false
릴리즈 노트: v46
Minor bug fix
릴리즈 노트: v47

Updated:
ScriptConvertor(ExpectedOutput)
  Parameters:
    ExpectedOutput: AcceptableValue = "Name", "Type", "Exp"

DiscordBasicJSON()
릴리즈 노트: v48
Minor Bug Fix
릴리즈 노트: v49
Minor Bug for Discord JSON.
릴리즈 노트: v50

Added:
StrategyFx(bool, string, string, ArrayString)
  Parameters:
    bool: Deploy acceptable Inputs are true for Deploy based Strategy Alert or false for Adding Strategy Alert type
    string: StrategyShortName specify the shortname for either deploying based or Adding based
    string: StrategyFullName specify the fullname for strategy Addition
    ArrayString: LegValues specify the array containing list of Leg Values else use array.new_string(0)
릴리즈 노트: v51

Updated:
StrategyFx(bool, string, string, ArrayString)
  Parameters:
    bool: Deploy acceptable Inputs are true for Deploy based Strategy Alert or false for Adding Strategy Alert type
    string: StrategyShortName specify the shortname for either deploying based or Adding based
    string: StrategyFullName specify the fullname for strategy Addition
    ArrayString: LegValues specify the array containing list of Leg Values else use array.new_string(0)
릴리즈 노트: v52

Added:
DateFormatterFx(ForWhatTime)
  DateFormatterFx Helps you to convert the Date
  Parameters:
    ForWhatTime: Specify the time in int format to get the date related attributes
  Returns: YYYY, YY, M, MM, MMM, MMMM, D, DD

Updated:
Get_TradeManagementInfo(Specify)
  to retrieve the Trade related informations
  Parameters:
    Specify: the Name of the Array against related parameters
  Returns: tuples with useful information regarding Trades taken
릴리즈 노트: v53

Minor Updates to Trade Management to show some qualitative information on Net Position. Like what's NetPosition for Today, Yesterday, Last7days, Thisweek, ThisMonth & Last3Months
릴리즈 노트: v54
Minor Bug Fixing
릴리즈 노트: v55

Trade Management Fx is now with :
1 . Added More analysis to identify what's profitability on Long Trades and Short Trades
릴리즈 노트: v56

Minor Updates for improving performance
릴리즈 노트: v57

Just another quick fix. Missed one!!
릴리즈 노트: v58

Added:
AlgoJiIntraMKTAlert(int, string, string, string, int, string, string)
  Parameters:
    int: LineCodes - Specify the line of code you need default is 2
    string: TSym - specify the symbol name for which alert is required defualt is syminfo.tickerid
    string: EnOrEx - specify "EN" for Entry trade or "EX" for Exit trade
    string: LongOrShort - specify "L" for Long and "S" for short
    int: Qty - specify qunatitly for the trade
    string: Instrument - specify instruement type
    string: Tag - specify Strategy Tag

Updated:
G_ITM(string, bool, int, bool, int, float, float)
  to calculate the ITM stike for the defined strike change
  Parameters:
    string: source (default='c') specify either of the source value Note: Be mindful as it may be repainted and calulation to be called on every bar
    bool: NeedRepainting (default=true) Specify false if you need them to calculate on the completed bars
    int: StrikeDiff (default=100) Specify the strike difference value. eg = Nifty = 50 and BNF = 100
    bool: ForCE (default=true) Specify false if you need them to calculate for PE option
    int: HowDeep (default=1) Specify the level.
    float: SVal (default=0) Specify the source value.
    float: CalibaratePct (default=0, min = 0 and max = 1) Specify the percentage value. eg if calibarion is set for 50% on the banknifty close price with 30030.5 ITM CE 1 deep will show 29900 how ever if close price is 30070.5 ITM CE with 1 deep will show 30000
  Returns: the strike price for the options speficied

G_OTM(string, bool, int, bool, int, float, float)
  to calculate the OTM stike for the defined strike change
  Parameters:
    string: source (default='c') specify either of the source value Note: Be mindful as it may be repainted and calulation to be called on every bar
    bool: NeedRepainting (default=true) Specify false if you need them to calculate on the completed bars
    int: StrikeDiff (default=100) Specify the strike difference value. eg = Nifty = 50 and BNF = 100
    bool: ForCE (default=true) Specify false if you need them to calculate for PE option
    int: HowDeep (default=1) Specify the level.
    float: SVal (default=0) Specify the source value.
    float: CalibaratePct (default=0, min = 0 and max = 1) Specify the percentage value. eg if calibarion is set for 50% on the banknifty close price with 30030.5 ITM CE 1 deep will show 29900 how ever if close price is 30070.5 ITM CE with 1 deep will show 30000
  Returns: the strike price for the options speficied

G_ATM(string, bool, int, float, float)
  to calculate the ATM stike for the defined strike change
  Parameters:
    string: source (default='c') specify either of the source value Note: Be mindful as it may be repainted and calulation to be called on every bar
    bool: NeedRepainting (default=true) Specify false if you need them to calculate on the completed bars
    int: StrikeDiff (default=100) Specify the strike difference value. eg = Nifty = 50 and BNF = 100
    float: SVal (default=0) Specify the source value.
    float: CalibaratePct (default=0, min = 0 and max = 1) Specify the percentage value. eg if calibarion is set for 50% on the banknifty close price with 30030.5 ITM CE 1 deep will show 29900 how ever if close price is 30070.5 ITM CE with 1 deep will show 30000
  Returns: the strike price for the options speficied

CreateJSON(Secret, Qty, BasketID, Direction, ExecuteAt, TriggerPrice, OrderType)
  to retrieve the JSON Format for DhanHQ
  Parameters:
    Secret: is the API Secret Key
    Qty: is the Qty You want to trade with, default is 1
    BasketID: is the Basket Key ID from Dhan HQ default is "0"
    Direction: B for Buy | Long or S for Sell | Short
    ExecuteAt: MKT for MarketPrice or LMT for LimitPrice
    TriggerPrice: Used only if the Execution is at LMT
    OrderType: I for Intraday or C for Positional
릴리즈 노트: v59

Updated:
AlgoJiIntraMKTAlert(string, string, string, int, string, string)
  Parameters:
    string: TSym - specify the symbol name for which alert is required defualt is syminfo.tickerid
    string: EnOrEx - specify "EN" for Entry trade or "EX" for Exit trade
    string: LongOrShort - specify "L" for Long and "S" for short
    int: Qty - specify qunatitly for the trade
    string: Instrument - specify instruement type
    string: Tag - specify Strategy Tag
algoji.com/apibridge-documentation/
kb.mycoder.pro/apibridge/how-to-set-powerful-algo-alerts-in-tradingview/
릴리즈 노트: v60

Updated AlgoJi Alert to suite the requirement.
릴리즈 노트: v61

Minor Updates
릴리즈 노트: v62

Updated:
Get_TradeManagementInfo(Specify)
  to retrieve the Trade related informations
  Parameters:
    Specify: the Name of the Array against related parameters
  Returns: tuples with useful information regarding Trades taken
릴리즈 노트: v63

Updated:
Get_TradeManagementInfo(Specify)
  to retrieve the Trade related informations
  Parameters:
    Specify: the Name of the Array against related parameters
  Returns: tuples with useful information regarding Trades taken
릴리즈 노트: v64

Minor Tweaks
릴리즈 노트: v65

Added:
EntryAlertInfoText()
  to combine couple of basic Entry alert text

ExitAlertInfoText()
  to combine couple of basic Exit alert text
릴리즈 노트: v66

Updated:
EntryAlertInfoText()
  to combine couple of basic Entry alert text

ExitAlertInfoText()
  to combine couple of basic Exit alert text
릴리즈 노트: v67

Minor updates.
릴리즈 노트: v68

Minor Changes to Strike Price Calculation.
릴리즈 노트: v69

Republishing with correct version.
릴리즈 노트: v70

Learning to the new Time String fx.
릴리즈 노트: v71

Added: NextLevelBotAlertJSON - Format helps you to place orders using NextLevelBOT for Finvasia & Fyers
NLBIntraMKTAlert()
릴리즈 노트: v72

AutoStirke Calculations Updated to support NextLevel Bot.
릴리즈 노트: v73

Added: Testing the BracketOrder Capability
NLBBracketOrder()
릴리즈 노트: v74

Added:
BO_SLTP(Specify)
  to calculate Distance between Points of Entry to the points of Either SL or Target In absoulute values
  Parameters:
    Specify: the "IAO" Strike type acceptable values are {ITM, OTM, or ATM}, HowDeep (Strike Difference like BNF 100 and Nifty 50)
  Returns: Returns Calculated points in the string format.

IntraDayOrder(TradingAccount, Dir, bool, bool, float)
  to Concatenate Leg Strings
  Parameters:
    TradingAccount: Specify the string name of Accout you are trading with
    Dir: refers to Diection of the Trade (Buy or Sell), Qty refers to Qty, TSym refers to Trading Symbol, Exch refers to Exchange (NSE or NFO)
    bool: MarketOrder - if set to true then creates string for Market order for Limit Order String set the param to false
    bool: MarketPricePlus - for limit orders setting this param to true will help for creating a string with sell high trade types
    float: LimitPriceBy - whats the price difference form market price can be specified here in this param
  Returns: Returns Intraday Alert String which can be used for trigerring Alert

BracketOrder(TradingAccount, SLP, LotSize, Leverage, Dir)
  to Contstruct the Alert Syntax
  Parameters:
    TradingAccount: Specify the string name of Accout you are trading with
    SLP: & TGTP are the absolute points in string format is acceptable
    LotSize: = Lot Qty acceptable for the tradign instrument
    Leverage: = factor to contstruct string info with the Leverage information to decide on tradable qty.
    Dir: refers to Diection of the Trade (Buy or Sell), Qty refers to Qty, TSym refers to Trading Symbol, Exch refers to Exchange (NSE or NFO)
  Returns: Returns Bracket Order Alert String which can be used for trigerring Alert

CancelClose(TradingAccount, SymbolExpiry)
  to Contstruct the Alert Syntax for closing and cancelling open positions.
  Parameters:
    TradingAccount: Specify the string name of Accout you are trading with
    SymbolExpiry: Specify the string text which can include symbol name and expirt date of symbol
  Returns: Returns Close & Cancellation Alert String

LegConstructor()
  to suffix ", " to the list of string of Array values supplied.
릴리즈 노트: v75

Added:
LegScriptContructor(Calculate, IAO, F_CE, int, float, float, BotType, C_Symbol, Exc, MOrder, MPricePlus, LMTPriceBy)
  to create String concatination which can be used for trigerring Alerts.
  Parameters:
    Calculate: - true for calculation options strike string
    IAO: - for ITM or OTM or ATM strike Price
    F_CE: - true for for CALL and false for PUT
    int: SDiff (default=100) Specify the strike difference value. eg = Nifty = 50 and BNF = 100
    float: SVal (default=0) Specify the source value.
    float: C_Pct (default=0, min = 0 and max = 1) Specify the percentage value. eg if calibarion is set for 50% on the banknifty close price with 30030.5 ITM CE 1 deep will show 29900 how ever if close price is 30070.5 ITM CE with 1 deep will show 30000
    BotType: specify the BOT type, ALGOJI or NEXTLEVEL_BOT
    C_Symbol: specify the Basic Trading Symbol or WithExpiry_Symbol for FUTURES or OPTIONS
    Exc: specify the exchange symbol reference
    MOrder: - if set to true then creates string for Market order for Limit Order String set the param to false
    MPricePlus: - for limit orders setting this param to true will help for creating a string with sell high trade types
    LMTPriceBy: - whats the price difference form market price can be specified here in this param
  Returns: Returns Intraday Alert String which can be used for trigerring Alert

Updated:
IntraDayOrder(TradingAccount, Dir, bool, bool, float)
  to Concatenate Leg Strings
  Parameters:
    TradingAccount: Specify the string name of Accout you are trading with
    Dir: refers to Diection of the Trade (Buy or Sell), Qty refers to Qty, TSym refers to Trading Symbol, Exch refers to Exchange (NSE or NFO)
    bool: MarketOrder - if set to true then creates string for Market order for Limit Order String set the param to false
    bool: MarketPricePlus - for limit orders setting this param to true will help for creating a string with sell high trade types
    float: LimitPriceBy - whats the price difference form market price can be specified here in this param
  Returns: Returns Intraday Alert String which can be used for trigerring Alert
"ZERODHA", "BUY", 1, "NSE", "SBIN-EQ", true

LegConstructor()
  to suffix ", " to the list of string of Array values supplied.
릴리즈 노트: v76

Minor Bugs Fixed

TRADING MADE SIMPLE
파인 라이브러리

트레이딩뷰 정신에 따라 오써는 이 파인 코드를 오픈 소스 라이브러리로 퍼블리쉬하여 당사 커뮤니티의 다른 파인 프로그래머들이 쓸 수 있도록 하였습니다. 오써에게 찬사를! 여러분은 이 라이브러리를 프라이빗 또는 오픈 소스 퍼블리케이션에 쓸 수 있지만 퍼블리케이션에 재사용은 하우스룰을 따릅니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

이 라이브러리를 쓰시겠습니까?

텍스트를 클립보드에 카피한 뒤 님의 스크립트에 붙여 넣기.