Function Pseudo Random GeneratorFunction to return a pseudo random number.
you can constrict it to a range and provide a seed to step through on the same bar.
thanks to Duyck, for the link.
Function
Function Markov ProcessEXPERIMENTAL:
this is very experimental and INCOMPLETE, use at your own discretion.
thanks glaz for the help :)
Heffae Resolution Commander (RAW)This is a script to call resolutions with some math on top of your base resolution.
Using the modulo operator to quantize integer values, it works by converting the modified resolution integer to a 4 digit string value.
Use the function within your own scripts to call funny resolutions otherwise difficult to calculate.
You cannot add series expressions to the resolution value since pine does not allow "series" as a resolution for a security call
However, you could easily stack a crapload of these together and use an expression to switch the referenced security function for your purposes.
This is the raw timeframe output as integer, not string.
To go back to string outputs (for use in security calls etc) unslash line 52 //resvalue
For those interested in the verbose version of the timeframe mod function, showing all the steps, here is a pastebin:
pastebin.com
Cheers! Drop a line / comment if you enjoy or have any questions on how to integrate this into your script@!
The Modulo operator is so much fun!
Heffae Resolution CommanderThis is a script to call resolutions with some math on top of your base resolution.
THIS IS NOT AN INDICATOR TO USE ON A CHART!!! The resolution call function is really useful for your own scripting ideas!
Using the modulo operator to quantize integer values, it works by converting the modified resolution integer to a 4 digit string value.
The function within this script is what is valuable, use it within your own scripts to call funny resolutions otherwise difficult to calculate.
You cannot add series expressions to the resolution value since pine does not allow "series " as a resolution for a security call
However, you could easily stack a crapload of these together and use
an expression to switch the referenced security function for your purposes.
The SMA and plot overlay are just there to show a visual example of how the function works.
You can view the raw timeframe output integer by getting rid of tostring(x) and // out the security calls,
plotting the raw function outputs.
For those interested in the verbose version of the timeframe mod function, showing all the steps, here is a pastebin:
pastebin.com
Cheers! Drop a line / comment if you enjoy or have any questions on how to integrate this into your script@!
The Modulo operator is so much fun!
Swing IndicatorThis indicator provides some base code for looping over data to identify swings in price action. Full code commentary can be found on the backtest rookies website.
The indicator shall allow users to "analyse" a recent historical candle to detect whether it was a swing point. This will work by inputting a number to select which historical candle you want to check. The indicator will then check all candles after it until the current candle. It shall also check the same amount of candles before it. If the candle analysed has the lowest low or highest high in the complete range, then we know it was a swing point.
function bugFunctions with parameters do not work correctly: the returned value is sometimes different from the expected one.
The example script works correctly only when idx = 1 (instead of the current line 6).
Function - Integral PriceFunction to convert floating numeric price to its *integral* value, ex: 1.2345 --> 12345.
integral might not be the right name, so pardon my engrish :p.
Function - Integer Number of DigitsFunction to return number of digits in a integer up to 10 digits.
can be easily altered to support higher numbers if needed.
Function Locked Enumeratorreturns the value at index, can be used if you want to compare/select multiple values from different series and need to simulate a array/enumerator.
Function fraction_of_valuereturns the fraction of a value, example 15.07 returns 0.07 and -15.07 returns -0.07
Min/Max Value Multiple Series FunctionTrying different solutions to find the minimum/maximum value in a set of predefined series
Function - Regressively Weighted Moving AverageEXPERIMENTAL:
Weights its self value by X against 1 time the current price.
Function Mean Median Mode V0EXPERIMENTAL:
Request for GLAZ
Functions to handle Mean, Median, Mode Calculation.
[RS]Function Account Margin Call Functions V0some simple functions to handle account margin call / trailling stop for account.
[RS]Function Martingale Multiplier - MA Crossover Bias V1EXPERIMENTAL:
WARNING: Martingale is subject to HUGE drawdown spikes, use at your own risk!
updated function to also double(aply multiplier) on even trades, example with a MA's crossover.
Function 2 Point Line using UNIX TIMESTAMP V1experimental:
draws a line from 2 vectors(price, time)
update:
reformatted the function,
added automatic detection of the period multiplier by approximation(gets a bit goofy with stocks/week time),
example using timestamp() function.
offsetting is still bugged, i cant find a way around it atm.
Function Frequency of RangeFunction to derive the frequency a range is visited over time.
returns value (0 to 1) percent multiplier
[RS]RSI Inverse Fisher Transform V1RSI inverse fisher transform (fishy turbo) as described here:
autotradingstrategy.wordpress.com
forexsb.com
update:
added color conditional.