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
Phát hành các Ghi chú
⋅
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 ['o','h','l','c'] 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 ['o','h','l','c'] 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 ['o','h','l','c'] 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
Phát hành các Ghi chú
⋅
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
Phát hành các Ghi chú
⋅
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
Phát hành các Ghi chú
⋅
v5 removed some small bugs
Phát hành các Ghi chú
⋅
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
Phát hành các Ghi chú
⋅
v7 minor Tweak to TLWithZones and Added MorePivots to GetPivot Function
Phát hành các Ghi chú
⋅
v8 Minor fix on Pivot Output was referring to incorrect Values.
Phát hành các Ghi chú
⋅
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.
Phát hành các Ghi chú
⋅
v10 Minor Changes to Pivot to remove unused Pivots to speed up some calculations.
Phát hành các Ghi chú
⋅
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
Phát hành các Ghi chú
⋅
v12 Minor Bugs fixed
Phát hành các Ghi chú
⋅
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
Phát hành các Ghi chú
⋅
v14 minor bug fixed
Phát hành các Ghi chú
⋅
v15 Alogrithm changed for TradeManagementInfo
Phát hành các Ghi chú
⋅
v16 Minor Bug fixed and added Net final Position for the TradeManagement Info
Phát hành các Ghi chú
⋅
v17 Simplified OperatorCheck
Phát hành các Ghi chú
⋅
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
Phát hành các Ghi chú
⋅
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
Phát hành các Ghi chú
⋅
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
Phát hành các Ghi chú
⋅
v21 Minor Bugs Fixed for Pivots Points
Phát hành các Ghi chú
⋅
v22 Minor Bug Fixed for PNL Values Calculation
Phát hành các Ghi chú
⋅
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
Phát hành các Ghi chú
⋅
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
Phát hành các Ghi chú
⋅
v25 Minor Bug Fixed with HighFrequency Value
Phát hành các Ghi chú
⋅
v26
Minor Update for SpeedImprovement for HighFrequency
Phát hành các Ghi chú
⋅
v27
bug Fixing
Phát hành các Ghi chú
⋅
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
Phát hành các Ghi chú
⋅
v29 Cosmetic changes (Formattef code) done. New algorithm to publish for few function. Removed few defaults for better readability.
Phát hành các Ghi chú
⋅
v30
Added: Created CustomFx for DhanHQ Api JSON CreateJSON()
Phát hành các Ghi chú
⋅
v31 Minor Bug Fix for JSON for DHAN_HQ
Phát hành các Ghi chú
⋅
v32
Added: G_TablePositon()
Phát hành các Ghi chú
⋅
v33
Added: GetTicker()
G_RespectingLineIndex()
Phát hành các Ghi chú
⋅
v34
Updated: G_RespectingLineIndex()
Phát hành các Ghi chú
⋅
v35
Updated: CreateJSON()
Phát hành các Ghi chú
⋅
v36
Added: GetTickerPrfx()
Phát hành các Ghi chú
⋅
v37 Minor Bug Fix for TradeManagment.
Phát hành các Ghi chú
⋅
v38 Minor Bug Fixed
Phát hành các Ghi chú
⋅
v39
Updated: G_ITM()
G_OTM()
G_ATM()
Phát hành các Ghi chú
⋅
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 ['o','h','l','c','s'] 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 ['o','h','l','c'] 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 ['o','h','l','c'] 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
Phát hành các Ghi chú
⋅
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 ['o','h','l','c','s'] 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 ['o','h','l','c'] 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 ['o','h','l','c'] 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
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)
Phát hành các Ghi chú
⋅
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 ['o','h','l','c'] 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
Phát hành các Ghi chú
⋅
v44 Minor Bug Fixed
Phát hành các Ghi chú
⋅
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
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)
Phát hành các Ghi chú
⋅
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)
Phát hành các Ghi chú
⋅
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
Phát hành các Ghi chú
⋅
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
Phát hành các Ghi chú
⋅
v54 Minor Bug Fixing
Phát hành các Ghi chú
⋅
v55
Trade Management Fx is now with : 1 . Added More analysis to identify what's profitability on Long Trades and Short Trades
Phát hành các Ghi chú
⋅
v56
Minor Updates for improving performance
Phát hành các Ghi chú
⋅
v57
Just another quick fix. Missed one!!
Phát hành các Ghi chú
⋅
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 ['o','h','l','c','s'] 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 ['o','h','l','c'] 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 ['o','h','l','c'] 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
Phát hành các Ghi chú
⋅
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 [EQ|FUTIDX|OPTIDX] string: Tag - specify Strategy Tag algoji.com/apibridge-documentation/ kb.mycoder.pro/apibridge/how-to-set-powerful-algo-alerts-in-tradingview/
Phát hành các Ghi chú
⋅
v60
Updated AlgoJi Alert to suite the requirement.
Phát hành các Ghi chú
⋅
v61
Minor Updates
Phát hành các Ghi chú
⋅
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
Phát hành các Ghi chú
⋅
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
Phát hành các Ghi chú
⋅
v64
Minor Tweaks
Phát hành các Ghi chú
⋅
v65
Added: EntryAlertInfoText() to combine couple of basic Entry alert text
ExitAlertInfoText() to combine couple of basic Exit alert text
Phát hành các Ghi chú
⋅
v66
Updated: EntryAlertInfoText() to combine couple of basic Entry alert text
ExitAlertInfoText() to combine couple of basic Exit alert text
Phát hành các Ghi chú
⋅
v67
Minor updates.
Phát hành các Ghi chú
⋅
v68
Minor Changes to Strike Price Calculation.
Phát hành các Ghi chú
⋅
v69
Republishing with correct version.
Phát hành các Ghi chú
⋅
v70
Learning to the new Time String fx.
Phát hành các Ghi chú
⋅
v71
Added: NextLevelBotAlertJSON - Format helps you to place orders using NextLevelBOT for Finvasia & Fyers NLBIntraMKTAlert()
Phát hành các Ghi chú
⋅
v72
AutoStirke Calculations Updated to support NextLevel Bot.
Phát hành các Ghi chú
⋅
v73
Added: Testing the BracketOrder Capability NLBBracketOrder()
Phát hành các Ghi chú
⋅
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.
Phát hành các Ghi chú
⋅
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.
Phát hành các Ghi chú
⋅
v76
Minor Bugs Fixed
Phát hành các Ghi chú
⋅
v78
Updated: IntraDayOrder(TradingAccount, Dir, string, bool, float, 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), Tkn refers to Instrument Token string: OType - Acceptable strings "M", "L", "SLL", "SLM", "BO" bool: LMT_Plus or TRG_Plus - for limit orders setting this param to true will help for creating a string with sell high or buy low trade types float: LimitPriceByOrSLBO - whats the price difference form market price can be specified here in this param, can also be used for specifying SL for BO order float: TriggerPriceByOrTGTBO - whats the price difference form market price can be specified here in this param, can also be used for specifying TGT for BO order Returns: Returns Intraday Alert String which can be used for trigerring Alert
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
Removed: BracketOrder(TradingAccount, SLP, LotSize, Leverage, Dir) to Contstruct the Alert Syntax
Phát hành các Ghi chú
⋅
v79
Minor Bug Fixed
Phát hành các Ghi chú
⋅
v80
Few General Modifications to the Script.
Phát hành các Ghi chú
⋅
v81
Updated: 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.
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
Phát hành các Ghi chú
⋅
v82 Updates
Phát hành các Ghi chú
⋅
v83
Updated: 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
Phát hành các Ghi chú
⋅
v84
Minor Changes
Phát hành các Ghi chú
⋅
v85
Added:
LookUpDataInMaster(x) TODO: to Get Necessary Tuple Information with relavnt information for Date & Time Calculation Parameters: x: TODO: Specify the Date String Returns: TODO: Get Necessary Tuple Information with relavnt information
Phát hành các Ghi chú
⋅
v86
Updates...
Phát hành các Ghi chú
⋅
v87
Updates
Phát hành các Ghi chú
⋅
v88
Updates
Phát hành các Ghi chú
⋅
v89
Updates.
Phát hành các Ghi chú
⋅
v90
Updates.
Phát hành các Ghi chú
⋅
v91 Minor Changes.
Phát hành các Ghi chú
⋅
v92
Updated: CancelClose(Cancel_Close, TradingAccount, Exch_, SymbolNameAndOrExpiry, CancelType, CloseType) to Contstruct the Alert Syntax for closing and cancelling open positions. Parameters: Cancel_Close TradingAccount: Specify the string name of Accout you are trading with Exch_ SymbolNameAndOrExpiry CancelType CloseType Returns: Returns Close & Cancellation Alert String
ExitAlertInfoText(TradeName, EnPrice, ExPrice, TPNL, TQTY, LTP, ExCandle) to combine couple of basic Exit alert text Parameters: TradeName (string) EnPrice (float) ExPrice (float) TPNL (float) TQTY (float) LTP (float) ExCandle (int)
G_Pct_Chng(value1, value2, lookback) Gets the percentage change between 2 float values over a given lookback period Parameters: value1 (float) value2 (float) lookback (int)
G_Indicator_Val(IndicatorName, Length, SrcVal) Gets Output of the technical analyis indicator which has length Parameter. RSI, ATR, EMA, SMA, HMA, WMA, VWMA, 'CMO', 'MOM', 'ROC','VWAP', "Highest", "Lowest" Parameters: IndicatorName (string) Length (simple int) SrcVal (float) Returns: Value with the given parameters
G_CandleInfo(WhatCandleInfo, FibValueOfCandle, RepaintingVersion, AccountforGaps, MidVal) 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: WhatCandleInfo (simple string) FibValueOfCandle (simple float) RepaintingVersion (bool) AccountforGaps (bool) MidVal (float) Returns: Returns Respective values for the candles
Removed: G_TextValOfNumber(ValueToConvert, RequiredDecimalPlaces, EndChar, BeginingChar) Function to return the String Value of Number with decimal precision with the prefix and suffix characters provided
G_TradableValue(ValueToConvert, NeedCustomization, RequiredDecimalPlaces) Function to return the Tradable Value of Number
G_TxtSizeForLables(SizeValue) Function to Get size Value for text values used in Lables
NumAsText(ValueToConvert, RequiredDecimalPlaces, ConversionType, EndChar, BeginingChar) Function to return the String Value of Number with decimal precision with the prefix and suffix characters provided Parameters: ValueToConvert (float) RequiredDecimalPlaces (int) ConversionType (string) EndChar (string) BeginingChar (string) Returns: Returns Out put with formated value of Given Number for the specified deicimal values with Prefix and suffix string