Dynamic Candle Balance Indicator (Binary)
Dynamic Candle Balance Indicator
The Dynamic Candle Balance Indicator is a powerful tool designed to identify imbalances in candle colors on a chart, which can indicate potential reversals or changes in market direction. This indicator is specifically developed for traders operating on short timeframes, such as 1-minute candles, and is particularly useful for identifying opportunities in binary options.
How to Use:
Set Parameters
Initial Position: Specify the number of initial candles to be considered for calculation.
Count: Determine the total number of candles to be analyzed, including the initial position.
Interpret Results:
Green: Indicates the number of bullish candles (where the closing price is higher than the opening price).
Red: Indicates the number of bearish candles (where the closing price is lower than the opening price).
Absent: Indicates the number of candles that were not considered due to the selected interval.
Performance Analysis:
The indicator calculates the percentage of green and red candles relative to the total number of analyzed candles, providing insights into market balance or imbalance.
Identify Trading Opportunities:
Significant imbalances between candle colors can indicate potential reversals or changes in market direction.
Traders can use this information to make informed decisions about their trading strategies, such as identifying entry or exit points.
Example:
In the last 40 candles, there were 13 green candles and 27 red candles, indicating a higher likelihood of the next candle being green.
Usage Tips:
The indicator is most effective when used on a 1-minute timeframe for binary options trading, especially during periods of high imbalance.
Adjust the parameters according to your trading strategy and the timeframe being analyzed.
Combine the Dynamic Candle Balance Indicator with other technical analysis tools to confirm trading signals.
Legal Disclaimer:
This indicator is provided for educational and informational purposes only. It represents a theory and should be used as part of a comprehensive trading strategy. Past performance is not indicative of future results. Traders should always conduct their own analysis before making trading decisions.
Try out the Dynamic Candle Balance Indicator and leverage its functionalities to identify trading opportunities on short-term charts, especially in 1-minute timeframes for binary options trading during periods of high imbalance. Remember to test the indicator on a practice account before using it on a real account.
Binary
Binary Option Strategy Tester with Martingale-Basic V.2In Binary options, strategy testing is a bit different. The strategy result depends upon expiry intervals and payout ratio.
My previous script was a try to resolve this but has some bugs in specific choices. The new version overcame those and added some new features useful for binary option strategy testing.
Assumption:
We are opening position at next candle after signal come
Chart interval is option expiry time.
We are taking the position at opening price
Our call will be profitable if we get a green candle and put will be profitable if we get a red candle
We can open only one trade at a time. So if we are in trade, subsequent signals will be ignored.
All Input Options:
Test Call/Put individually or both. Default BOTH
Select up to 5 Martingale levels. Default 2
Type of Martingale Trade. Default “SAME”
“SAME”: If you are trading CALL and incur a loss, you are taking CALL in subsequent Martingale levels.
“OPSITE”: if you are trading CALL and incur a loss, you are taking PUT in subsequent Martingale levels.
“FOLLOW CANDLE COLOR”: You are following candle color in Martingale levels, i.e if the loss candle is RED, you are taking PUT in subsequent candles.
“OPPOSITE CANDLE COLOR”: You are taking opposite candle color trade, i.e if the loss candle is RED, you are taking CALL in subsequent candle.
Select Specific Trading Session. Please select “USE SPECIFIC SESSION”. Default: TRUE
Put the investment amount per option. Default: 10
Payout ratio. Default: 80%
The strategy is taken from Vdub Binary Options SniperVX v1 (by @vdubus). I have deleted extra parts and kept only the necessary parts.
Result Table
Signal and Win Levels:
Signal and Loss:
Please note that Binary options trading is very risky. You must be aware of the risk and be willing to accept them in order to invest in binary options. Only invest what you can afford to lose. The past performance of any trading system, strategy, or methodology is not necessarily indicative of future results.
Bitwise, Encode, DecodeLibrary "Bitwise, Encode, Decode"
Bitwise, Encode, Decode, and more Library
docs()
Hover-Over Documentation for inside Text Editor
bAnd(a, b)
Returns the bitwise AND of two integers
Parameters:
a : `int` - The first integer
b : `int` - The second integer
Returns: `int` - The bitwise AND of the two integers
bOr(a, b)
Performs a bitwise OR operation on two integers.
Parameters:
a : `int` - The first integer.
b : `int` - The second integer.
Returns: `int` - The result of the bitwise OR operation.
bXor(a, b)
Performs a bitwise Xor operation on two integers.
Parameters:
a : `int` - The first integer.
b : `int` - The second integer.
Returns: `int` - The result of the bitwise Xor operation.
bNot(n)
Performs a bitwise NOT operation on an integer.
Parameters:
n : `int` - The integer to perform the bitwise NOT operation on.
Returns: `int` - The result of the bitwise NOT operation.
bShiftLeft(n, step)
Performs a bitwise left shift operation on an integer.
Parameters:
n : `int` - The integer to perform the bitwise left shift operation on.
step : `int` - The number of positions to shift the bits to the left.
Returns: `int` - The result of the bitwise left shift operation.
bShiftRight(n, step)
Performs a bitwise right shift operation on an integer.
Parameters:
n : `int` - The integer to perform the bitwise right shift operation on.
step : `int` - The number of bits to shift by.
Returns: `int` - The result of the bitwise right shift operation.
bRotateLeft(n, step)
Performs a bitwise right shift operation on an integer.
Parameters:
n : `int` - The int to perform the bitwise Left rotation on the bits.
step : `int` - The number of bits to shift by.
Returns: `int`- The result of the bitwise right shift operation.
bRotateRight(n, step)
Performs a bitwise right shift operation on an integer.
Parameters:
n : `int` - The int to perform the bitwise Right rotation on the bits.
step : `int` - The number of bits to shift by.
Returns: `int` - The result of the bitwise right shift operation.
bSetCheck(n, pos)
Checks if the bit at the given position is set to 1.
Parameters:
n : `int` - The integer to check.
pos : `int` - The position of the bit to check.
Returns: `bool` - True if the bit is set to 1, False otherwise.
bClear(n, pos)
Clears a particular bit of an integer (changes from 1 to 0) passes if bit at pos is 0.
Parameters:
n : `int` - The integer to clear a bit from.
pos : `int` - The zero-based index of the bit to clear.
Returns: `int` - The result of clearing the specified bit.
bFlip0s(n)
Flips all 0 bits in the number to 1.
Parameters:
n : `int` - The integer to flip the bits of.
Returns: `int` - The result of flipping all 0 bits in the number.
bFlip1s(n)
Flips all 1 bits in the number to 0.
Parameters:
n : `int` - The integer to flip the bits of.
Returns: `int` - The result of flipping all 1 bits in the number.
bFlipAll(n)
Flips all bits in the number.
Parameters:
n : `int` - The integer to flip the bits of.
Returns: `int` - The result of flipping all bits in the number.
bSet(n, pos, newBit)
Changes the value of the bit at the given position.
Parameters:
n : `int` - The integer to modify.
pos : `int` - The position of the bit to change.
newBit : `int` - na = flips bit at pos reguardless 1 or 0 | The new value of the bit (0 or 1).
Returns: `int` - The modified integer.
changeDigit(n, pos, newDigit)
Changes the value of the digit at the given position.
Parameters:
n : `int` - The integer to modify.
pos : `int` - The position of the digit to change.
newDigit : `int` - The new value of the digit (0-9).
Returns: `int` - The modified integer.
bSwap(n, i, j)
Switch the position of 2 bits of an int
Parameters:
n : `int` - int to manipulate
i : `int` - bit pos to switch with j
j : `int` - bit pos to switch with i
Returns: `int` - new int with bits switched
bPalindrome(n)
Checks to see if the binary form is a Palindrome (reads the same left to right and vice versa)
Parameters:
n : `int` - int to check
Returns: `bool` - result of check
bEven(n)
Checks if n is Even
Parameters:
n : `int` - The integer to check.
Returns: `bool` - result.
bOdd(n)
checks if n is Even if not even Odd
Parameters:
n : `int` - The integer to check.
Returns: `bool` - result.
bPowerOfTwo(n)
Checks if n is a Power of 2.
Parameters:
n : `int` - number to check.
Returns: `bool` - result.
bCount(n, to_count)
Counts the number of bits that are equal to 1 in an integer.
Parameters:
n : `int` - The integer to count the bits in.
to_count `string` - the bits to count
Returns: `int` - The number of bits that are equal to 1 in n.
GCD(a, b)
Finds the greatest common divisor (GCD) of two numbers.
Parameters:
a : `int` - The first number.
b : `int` - The second number.
Returns: `int` - The GCD of a and b.
LCM(a, b)
Finds the least common multiple (LCM) of two integers.
Parameters:
a : `int` - The first integer.
b : `int` - The second integer.
Returns: `int` - The LCM of a and b.
aLCM(nums)
Finds the LCM of an array of integers.
Parameters:
nums : `int ` - The list of integers.
Returns: `int` - The LCM of the integers in nums.
adjustedLCM(nums, LCM)
adjust an array of integers to Least Common Multiple (LCM)
Parameters:
nums : `int ` - The first integer
LCM : `int` - The second integer
Returns: `int ` - array of ints with LCM
charAt(str, pos)
gets a Char at a given position.
Parameters:
str : `string` - string to pull char from.
pos : `int` - pos to get char from string (left to right index).
Returns: `string` - char from pos of string or "" if pos is not within index range
decimalToBinary(num)
Converts a decimal number to binary
Parameters:
num : `int` - The decimal number to convert to binary
Returns: `string` - The binary representation of the decimal number
decimalToBinary(num, to_binary_int)
Converts a decimal number to binary
Parameters:
num : `int` - The decimal number to convert to binary
to_binary_int : `bool` - bool to convert to int or to string (true for int, false for string)
Returns: `string` - The binary representation of the decimal number
binaryToDecimal(binary)
Converts a binary number to decimal
Parameters:
binary : `string` - The binary number to convert to decimal
Returns: `int` - The decimal representation of the binary number
decimal_len(n)
way of finding decimal length using arithmetic
Parameters:
n `float` - floating decimal point to get length of.
Returns: `int` - number of decimal places
int_len(n)
way of finding number length using arithmetic
Parameters:
n : `int`- value to find length of number
Returns: `int` - lenth of nunber i.e. 23 == 2
float_decimal_to_whole(n)
Converts a float decimal number to an integer `0.365 to 365`.
Parameters:
n : `string` - The decimal number represented as a string.
Returns: `int` - The integer obtained by removing the decimal point and leading zeroes from s.
fractional_part(x)
Returns the fractional part of a float.
Parameters:
x : `float` - The float to get the fractional part of.
Returns: `float` - The fractional part of the float.
form_decimal(a, b, zero_fix)
helper to form 2 ints into 1 float seperated by the decimal
Parameters:
a : `int` - a int
b : `int` - b int
zero_fix : `bool` - fix for trailing zeros being truncated when converting to float
Returns: ` ` - float = float decimal of ints | string = string version of b for future use to ref length
bEncode(n1, n2)
Encodes two numbers into one using bit OR. (fastest)
Parameters:
n1 : `int` - The first number to Encodes.
n2 : `int` - The second number to Encodes.
Returns: `int` - The result of combining the two numbers using bit OR.
bDecode(n)
Decodes an integer created by the bCombine function.(fastest)
Parameters:
n : `int` - The integer to decode.
Returns: ` ` - A tuple containing the two decoded components of the integer.
Encode(a, b)
Encodes by seperating ints into left and right of decimal float
Parameters:
a : `int` - a int
b : `int` - b int
Returns: `float` - new float of encoded ints one on left of decimal point one on right
Decode(encoded)
Decodes float of 2 ints seperated by decimal point
Parameters:
encoded : `float` - the encoded float value
Returns: ` ` - tuple of the 2 ints from encoded float
encode_heavy(a, b)
Encodes by combining numbers and tracking size in the
decimal of a floating number (slowest)
Parameters:
a : `int` - a int
b : `int` - b int
Returns: `float` - new decimal of encoded ints
decode_heavy(encoded)
Decodes encoded float that tracks size of ints in float decimal
Parameters:
encoded : `float` - encoded float
Returns: ` ` - tuple of decoded ints
decimal of float (slowest)
Parameters:
encoded : `float` - the encoded float value
Returns: ` ` - tuple of the 2 ints from encoded float
Bitwise, Encode, Decode Docs
In the documentation you may notice the word decimal
not used as normal this is because when referring to
binary a decimal number is a number that
can be represented with base 10 numbers 0-9
(the wiki below explains better)
A rule of thumb for the two integers being
encoded it to keep both numbers
less than 65535 this is because anything lower uses 16 bits or less
this will maintain 100% accuracy when decoding
although it is possible to do numbers up to 2147483645 with
this library doesnt seem useful enough
to explain or demonstrate.
The functions provided work within this 32-bit range,
where the highest number is all 1s and
the lowest number is all 0s. These functions were created
to overcome the lack of built-in bitwise functions in Pinescript.
By combining two integers into a single number,
the code can access both values i.e when
indexing only one array index
for a matrices row/column, thus improving execution time.
This technique can be applied to various coding
scenarios to enhance performance.
Bitwise functions are a way to use integers in binary form
that can be used to speed up several different processes
most languages have operators to perform these function such as
`<<, >>, &, ^, |, ~`
en.wikipedia.org
BinaryDecimalConversionLibrary "BinaryDecimalConversion"
Converts decimal to and from binary.
to_binary(number) convert integer to binary string
Parameters:
number : int, value to convert.
Returns: string
to_decimal(binary) Converts a binary in a string to decimal.
Parameters:
binary : string, binary number in a string.
Returns: int
Binary Option Strategy Tester with MartingaleIn Binary options, strategy testing is a bit different. The script is just a try to test Binary options strategies.
Assumption:
We are opening position at next candle after signal come
We are taking the position at opening price
Our call will be profitable if we get a green candle and put will be profitable if we get a red candle
We can open only one trade at a time. So if we are in trade, subsequent signals will be ignored.
The script is not counting your profit or loss, it just counting the winning and losing trades.
Input Options:
Choose long only or short only test. Default is both.
You can continue your trade with Martingale Level, up to 5. Default is 1 (no Martingale)
You can choose Martingale trade type
SAME: if call subsequent trade will be call only and vice versa
OPPOSITE: if call subsequent trade will be put
FOLLOW CANDLE COLOR: Subsequent trade will follow previous candle color
OPPOSITE CANDLE COLOR: Subsequent trade will opposite of previous candle color
You can choose trading session to test. Default is false.
The strategy is taken from Vdub Binary Options SniperVX v1 (by @vdubus) . I have deleted extra parts and kept only the necessary part.
Without Martingale
Result Table
With Martingale
I am very new to Pine script, so waiting for your comments and review.
I Ching Hexagrams Part 2IMPORTANT!
Get the other indicator I Ching Hexagrams Part 1 for the full set!
Here is the first half of the I Ching's hexagrams.
Each candle generates a hexagram at close, based on that candle and the previous 5.
A green candle is yang and a red candle is yin.
In this way, price action generates a hexagram.
Use this to generate a hexagram for the day or even to find interesting patterns to trade.
Have fun!
I Ching Hexagrams Part 1IMPORTANT!
Get the other indicator I Ching Hexagrams Part 2 for the full set!
Here is the first half of the I Ching's hexagrams.
Each candle generates a hexagram at close, based on that candle and the previous 5.
A green candle is yang and a red candle is yin.
In this way, price action generates a hexagram.
Use this to generate a hexagram for the day or even to find interesting patterns to trade.
Have fun!
Technical Ratings Pro - Pump WaveThis script uses the built in Technical Ratings indicator but interprets the data visually. It plots the results for "total", "MA" and "other" as pump waves. It uses MA to plot a trend line (can be turned off in settings) . Candles are colored to the rating strength and a percentage number was added to the results. For more informations on the Technical Ratings indicator please refer to official documentation.
Price MovementPrice indicator that shows the trend based on price movement.
The indicator determinants when an asset price is getting higher or lower by comparing the previous price highs and lows to the current price.
==Explanation==
In case current HL2 exceeds the previous HL2 HIGH then the columns will turn green.
In case current HL2 fails the previous HL2 LOW then the columns will turn red.
The trick here is that the trend CONTINUES to show the greens and reds, until a reversal happens to the opposite side.
This can be used to determinate trends and reversals.
Note: Bar colors are disabled by default.
You can set the lookback period at the indicator settings as well as the asset source (HL2,CLOSE, etc..). default is HL2
Quote that i like: “It is impossible to produce superior performance unless you do something different from the majority.” – John Templeton
Enjoy and like if you like :)
BO - CCI Arrow with AlertBO - CCI Arrow with Alert base on CCI indicator to get signal for trade Binary Option.
Rules of BO - CCI Arrow with Alert below:
A. Setup Menu
1. cciLength:
* Default CCI lenght = 14
2. Linear Regression Length:
* Periods to calculate Linear Regression of CCI,
* Default value = 5
3. Extreme Level:
* Default top extreme level = 100
* Default bottom extreme level = -100
4. Filter Length:
* Periods to define highest or lowest Linear Regression
* Default value = 6
B. Rule Of Alert Bar
1. Put Alert Bar
* Current Linear Regression Line created temporrary peak
* Peak of Linear Regression Line greater than Top Extreme Level (100)
* Previous Linear Regression is highest of Filter Length (6)
* Previous Linear Regression is greater than previous peak of Linear Regression Line
* Current price greater than previous low
* CCI(14) less than Linear Regression Line
2. Call Alert Bar
* Current Linear Regression Line created temporrary bottom
* Bottom of Linear Regression Line less than Bottom Extreme Level (-100)
* Previous Linear Regression is lowest of Filter Length (6)
* Previous Linear Regression is less than previous bottom of Linear Regression Line
* Current price less than previous lhigh
* CCI(14) greater than Linear Regression Line
B. Rule Of Entry Bar and Epiry.
1. Put Entry with expiry 3 bars:
* After Put Alert Bar close with signal confirmed, put Arrow appear, and after 3 bars, result label will appear to show win trade, loss trade or draw trade
2. Call Entry with expiry 3 bars:
* After Call Alert Bar close with signal confirmed, call Arrow appear, and after 3 bars, result label will appear to show win trade, loss trade or draw trade.
3. While 1 trade is opening no more any signal
C. Popup Alert/Mobile Alert
1. Signal alert: Put Alert or Call Alert will send to mobile or show popup on chart
2. Put Alert: only Put Alert will send to mobile or show popup on chart
3. Call Alert: only Call Alert will send to mobile or show popup on chart
BO - Bar's direction Signal - BacktestingBO - Bar's direction Signal - Backtesting Options:
A. Factors Calculate probability of x bars same direction
1. Periods Counting: Data to count From day/month/year To day/month/year
2. Trading Time: only cases occurred in trading time were counted.
B. Timezone
1. Trading time depend on Time zone and specified chart.
2. Enable Highlight Trading Time to check your period time is correct
C. Date Backtesting
* Only cases occurred in Date Backtesting were reported.
D. Setup Options & Rule
1. Reversal after 2 bars same direction
* Probability of 3 bars same direction < 50
* 2 bars same direction is start of series
2. Reversal after 3 bars same direction
* Probability of 4 bars same direction < 50
* 3 bars same direction is start of series
3. Reversal after 4 bars same direction
* Probability of 4 bars same direction < 50
* 3 bars same direction is start of series
4. Reversal after 5 bars same direction
* Probability of 5 bars same direction < 50
* 4 bars same direction is start of series
5. Reversal after 6 bars same direction
* Probability of 6 bars same direction < 50
* 5 bars same direction is start of series
Emulating binary operations and several values in one variableBinary operations and storing several numbers in one variable.
It's useful when you need to pass a values numbers to another study. Study-on-study (SOS) in Tradingview allows passing only one value, which is not always convinient. So if we put all those numbers in one - we can pass more values from one study to another.
In Pine we can use up to 52 bits for our data. Because of that we can put 6 1-byte (8-bit) values in one float. Or 12 4-bit values. Or 52 1-bit values.
BO - Bar M15 2/3 SignalBO - Bar M15 2/3 Signal show the signal to trade Binary Option with rule below:
A. Indicator
* Bollinger Band (20,2): avoid waterfall
B. Rule of Signal
1. Rule1: Split Bar M15 to 3 part and load them on M5 chart (recommend use M5 IDC chart)
2. Rule 2: Delay 10' after bar M15 open => wait for price's pattern
3. Rule 3: Put Signal row 30-32
* Delay 10' after bar M15 open.
* Direction of 1/3 and 2/3 Bar M15 is upward
* close of 2/3 Bar M15 below upper band Bb(20,2) on M5 chart => avoid strong buy
4. Rule 4: Call Signal row 36-38
* Delay 10' after bar M15 open.
* Direction of 1/3 and 2/3 Bar M15 is downward
* close of 2/3 Bar M15 above lower band Bb(20,2) on M5 chart => avoid strong sell
C. Recommend Expiry time: Bar M15 close
* We try to catch the shadow of Bar M15 but dont trade when price run on the upper or lower band of BB(20,2,M5)
BO - Bar M15 Signal* This script show the signal base on volatility of previous bar M15 to trade Binary Option.
* Rule of Signal is below:
A. Rule 1: Wait for prices created temporary peak and bottom
Row 18: 10 minutes till close
B. Rule 2: Reversal previous bar's direction
1. Put Signal - Row 22 - 25:
- Delay 5' after bar M15 open
- previous bar's direction is upward
- price less than previous close
- temporary bottom greater than previous open
2. Call Signal - Row 29 - 32:
- Delay 5' after bar M15 open
- previous bar's direction is downward
- price greater than previous close
- temporary peak less than previous open
C. Rule 3: Follow previous bar's direction
1. Put Signal - Row 37 - 40:
- Delay 5' after bar M15 open
- previous bar's direction is downward
- price greater than previous open
- temporary peak less than previous peak
2. Call Signal - Row 43 - 46:
- Delay 5' after bar M15 open
- previous bar's direction is upward
- price less than previous open
- temporary bottom greater than previous bottom
BO - KBSignalBO - KBSignal show Put or Call Signal inoder to trade Binary Option.
A. Indicators
1. Keltner Channel %K (indicator was published in my scripts)
2. OBV's %B (indicator was published in my scripts)
B. Rule of Signal
1. Rule 1: No Signal
- %K is the highest of 3 periods => Possible a Pivot High
- %K is the lowest of 3 periods => Possible a Pivot Low
- Previous %K is greater than or equal 0.8 => Touch Resistance Zone
- Previous %K is less than or equal 0.2 => Touch Support zone
2. Rule 2: Sell and Buy Zone depend on 2 Indicators mentioned in A
- Sell zone = %K<0.45 and Obv's %B <0.45
- Buy zone = %K>0.55 and Obv's %B >0.55
3. Rule 3: Put and Call Signal
- Put Signal = Sell zone and not No Signal
- Call Signal = Buy zone and not No Signal
C. Alert
1. Signal alert = Put Signal or Call Signal alert
2. Put alert = Put Signal alert
3. call alert = Call Signal alert
Function Decimal To Binary/Binary To DecimalNOTE: Experimental. Pinescript implementation of Decimal to Binary and Binary to Decimal that is intended for use in the development of a neural network proof of concept.
Intended for use in as subcomponent in the development of a more complex/highly experimental prototype.
Protection/logic for edge cases above 11111111/255 (8bits) is NOT implemented.
Do NOT use this in any trading system or component without edge case testing/unit tests.
// Decimal to Binary, Binary to Decimal Reference:
// diwasfamily.com
// www.wikihow.com
//
// www.khanacademy.org
RSI Binary StrategyAnother basic strategy most people learn at the beginning of their trading carreer (like me) is the RSI strategy. This is an adaptation of the built-in RSI strategy for use in binary options. Who knows, maybe one day i will graduate to CFD trading, but my time for trading in general is limited at the moment and I am very much still at the beginning of this entire topic.
The rather specific values for the RSI bounds and length I saved have been developed for the EURUSD short term (5min.) interval, giving the highest amount of winning vs. loosing trades as of the publishing date of this script, which is the only important factor for binary options in my understanding. Use at your own risk.
Feel free to comment, give me pointers and/or recommendations.
Channel Break Out Binary StrategyI am learning pine script at the moment and this is my first attempt at creating an expire time based strategy for binary options based on a simple example like the built-in Channel Break Out Strategy.
Stochastic RSI StrategyThis is an an adaption of Binary option 1 minute by Maxim Chechel to a strategy. I have had success with this on FCT/BTC on Poloniex.
Binary Options Tester w/ Vdubus money managementAdded implementation of vdubus's money management strategy to binary options tester. As before, the entry/exit strategy is just there for an example, modify go_down and go_up for your strategy as the short and long entry points. Also as before, do not use present variables (i.e. close, close , ema_6_min in the example) in go_up and go_down, as this is akin to having future information. Calling past forms of compound present variables (ema(close,6) ) is fine.