String_Encoder_DecoderLibrary "String_Encoder_Decoder"
String encoder and decoder to use in internal data tranfer in script calculations.
In example, script encode 125 values once and then decode them every candle.
encode(array or values (val1,val2,val3,val4,val5,val6)
encode: encode some values into string
Parameters:
array : of values or values1, value2 (up to 6 values)
(input values must be stringified)
Returns: encoded value
decode(val)
decode: decode into string
Parameters:
val : value to decode, must be stringified
Returns: decoded array of stringified values
Encoder
Encoder DecoderLibrary "EncoderDecoder"
Simple example how to encode some values into float number and then decode it back to original values
f_calctype()
Encode parameter
Returns: encoded value
f_calctype()
Decode parameter
Returns: decoded value
f_srctype()
Encode parameter
Returns: encoded value
f_srctype()
Decode parameter
Returns: decoded value
f_encode(calc_type, src_type, tf, length)
Encodes 4 paramters into float number
Parameters:
calc_type : 1st paramter to encode (its values defined in f_calctype functions) max number of values that can be encoded = 100
src_type : 2nd paramter to encode (its values defined in f_src_type functions) max number of values that can be encoded = 100
tf : 3rd paramter to encode (may be int number with format.price precision length!)
length : 4th paramter to encode (may be any int number)
Returns: float number
f_decode()
Decodes 4 paramters into tuple
Returns: tuple
Signal_transcoder_libraryLibrary "Signal_transcoder_library"
This is my 2nd iteration for sending Signals via Plots. (first one was the 8bit Version)
Now a cleaner approach (thanks for the hints @lonesometheblue)
_16bit_encode()
Input a 16 bool Array
Outputs a Float for transmitting via Plot
_16bit_decode()
Input a Float from plot via input-mapping
Outputs a Array of 16 bools
Future Ideas:
Transmitting 2-4 Ints (-127 to 127) and Bools