libKageMiscLibrary "libKageMisc"
Kage's Miscelaneous library
print(_value)
Print a numerical value in a label at last historical bar.
Parameters:
_value : (float) The value to be printed.
Returns: Nothing.
barsBackToDate(_year, _month, _day)
Get the number of bars we have to go back to get data from a specific date.
Parameters:
_year : (int) Year of the specific date.
_month : (int) Month of the specific date. Optional. Default = 1.
_day : (int) Day of the specific date. Optional. Default = 1.
Returns: (int) Number of bars to go back until reach the specific date.
bodySize(_index)
Calculates the size of the bar's body.
Parameters:
_index : (simple int) The historical index of the bar. Optional. Default = 0.
Returns: (float) The size of the bar's body in price units.
shadowSize(_direction)
Size of the current bar shadow. Either "top" or "bottom".
Parameters:
_direction : (string) Direction of the desired shadow.
Returns: (float) The size of the chosen bar's shadow in price units.
shadowBodyRatio(_direction)
Proportion of current bar shadow to the bar size
Parameters:
_direction : (string) Direction of the desired shadow.
Returns: (float) Ratio of the shadow size per body size.
bodyCloseRatio(_index)
Proportion of chosen bar body size to the close price
Parameters:
_index : (simple int) The historical index of the bar. Optional. Default = 0.()
Returns: (float) Ratio of the body size per close price.
lastDayOfMonth(_month)
Returns the last day of a month.
Parameters:
_month : (int) Month number.
Returns: (int) The number (28, 30 or 31) of the last day of a given month.
nameOfMonth(_month)
Return the short name of a month.
Parameters:
_month : (int) Month number.
Returns: (string) The short name ("Jan", "Feb"...) of a given month.
pl(_initialValue, _finalValue)
Calculate Profit/Loss between two values.
Parameters:
_initialValue : (float) Initial value.
_finalValue : (float) Final value = Initial value + delta.
Returns: (float) Profit/Loss as a percentual change.
gma(_Type, _Source, _Length)
Generalist Moving Average (GMA).
Parameters:
_Type : (string) Type of average to be used. Either "EMA", "HMA", "RMA", "SMA", "SWMA", "WMA" or "VWMA".
_Source : (series float) Series of values to process.
_Length : (simple int) Number of bars (length).
Returns: (float) The value of the chosen moving average.
xFormat(_percentValue, _minXFactor)
Transform a percentual value in a X Factor value.
Parameters:
_percentValue : (float) Percentual value to be transformed.
_minXFactor : (float) Minimum X Factor to that the conversion occurs. Optional. Default = 10.
Returns: (string) A formated string.
isLong()
Check if the open trade direction is long.
Returns: (bool) True if the open position is long.
isShort()
Check if the open trade direction is short.
Returns: (bool) True if the open position is short.
lastPrice()
Returns the entry price of the last openned trade.
Returns: (float) The last entry price.
barsSinceLastEntry()
Returns the number of bars since last trade was oppened.
Returns: (series int)
getBotNameFrosty()
Return the name of the FrostyBot Bot.
Returns: (string) A string containing the name.
getBotNameZig()
Return the name of the FrostyBot Bot.
Returns: (string) A string containing the name.
getTicksValue(_currencyValue)
Converts currency value to ticks
Parameters:
_currencyValue : (float) Value to be converted.
Returns: (float) Value converted to minticks.
getSymbol(_botName, _botCustomSymbol)
Formats the symbol string to be used with a bot
Parameters:
_botName : (string) Bot name constant. Either BOT_NAME_FROSTY or BOT_NAME_ZIG. Optional. Default is empty string.
_botCustomSymbol : (string) Custom string. Optional. Default is empy string.
Returns: (string) A string containing the symbol for the bot. If all arguments are empty, the current symbol is returned in Binance format.
showProfitLossBoard()
Calculates and shows a board of Profit/Loss through the years.
Returns: Nothing.
스크립트에서 "bot"에 대해 찾기
GRIDBOT Scalper by nnamWhat is this Indicator used for?
Made specifically for GRID Bots
note: before continuing... this indicator works on any timeframe, but it WORKS BEST ON THE 15 MINUTE TIMEFRAME
Straters and Forex Master Pattern Value Line Traders use this to help determine when the price could reverse.
This indicator is a scalping indicator that produces signals when a "potential" reversal in price is indicated. When the price moves UP and a Potential Bearish Reversal Signal occurs, traders can use this signal as a potential SHORT entry signal for their Short Grid Bot. The process is the same in reverse. After a sustained move down, a Potential Bullish Signal can be used by the trader as a potential LONG entry signal for their GridBot.
As shown in the screenshot below, lines develop on the chart (either RED or GREEN) indicating that a sustained move in one direction is currently occurring; however, there is no potential reversal signal plotted (this means that price action is currently moving in one direction only).
As shown in the screenshot below, lines can be used as a stop-loss after entering the GRIDbot. (usually, by this time, the Grid Bot is in Profit as it usually moves in the opposite direction first)
What this Indicator Does
The GRIDBOT Scalper provides information regarding potential reversals in the market after a sustained movement in one direction (either Bullish or Bearish).
The indicator is based on PRICE-ACTION ONLY and does not take into account the current state of the market (Bullish or Bearish).
Once the price moves in a particular direction for at least 14 bars , a line appears as shown in a previous screenshot. Once the price stops moving in that direction and begins moving in the opposite direction - and after a sustained run - a "signal" appears alerting the trader that a "potential" reversal could be on the horizon soon.
If price moves in one direction and plots both a line and a signal and then begins moving back in the other direction in a sustained manner, the original signal will remain even when a NEW line begins forming (the original line will disappear). (see below) This line will continue to move as the price continues to move. Not until a signal plots on the chart is the potential reversal forming. THE LINE DOES NOT SIGNAL A REVERSAL . Some traders, however, use this information to "ride the wave UP or DOWN" and exit their positions once the signal prints.
As shown below, optional input settings allow the trader to set the line at CLOSE or HIGH/LOW of the candle preceding the potential reversal.
It is suggested to use Close instead of High or Low but the setting allows one to use either.
As shown in the screenshot below, it is typical on LOWER TIME FRAMES to see the price pass the signal line. The Indicator works best on the 15 minute timeframe, as it gives the trader time to make the decisions required as the volatility is less on the 15 minute chart vs the 1 minute or 5 minute charts.
If you have any questions or suggestions for this indicator, please join our Discord. We offer free training on this Indicator on our Discord Server.
Channels Strategy [Dimkud]Channels trading Strategy. Based on "Channels Strategy" by JoseMetal.
To the original strategy added additional options and filters : Static SL/TP in percents (%), time delay between orders, ATR Filter, second Keltner Channel (Multi TimeFrame).
Interface translated to English.
Were good backtest results on many crypto tokens on 15m - 45m - 1h periods.
Mostly with configuration: Keltner Channel (optimise parameters for every token) + Static SL/TP (optimise values for every token) + "Enter Condition" = "Wick out of band".
The better is to optimise paramaters separately for Short and Long trading. And run two separate bots (in settings enable only Long or only Short.)
Tested on real automated trading on few online bot platforms. (3comm, revenuebot, veles).
Later I will make tutorial how to connect strategy to these platforms or contact me if you need help.
Grid Strategy Back Tester (Long/Short/Neutral)Preface
I'd like to send a thank you to @xxattaxx-DisDev.
The 'Line' Code, which was the most difficult to plan the Grid Indicator, was solved through the 'Grid Bot Simulator' script of @xxattaxx-DisDev.
A brief description of the indicators
These indicators are designed for backtesting of grid trading that can be opened on various exchanges.
Grid trading is a method of selling at particular intervals as prices rise and fall for gird interval price range.
This indicator is actually designed to see what the Long / Short / Neutral grid has achieved and how much it has achieved over a given period of time.
How to use
1. Lower Limit and Upper Limit are required when putting indicators on the chart.
After that, choose the 'Time' when to open the grid.
Also, select Long / Short / Neutral direction if necessary.
2. Statistics Table
Matched Grid shows how many grid pairs were engaged during the backtesting period.
The Daily Average Matching Profit is calculated based on the number of these closed grids.
Total Matching Profit is calculated as Matching Grid * Per Matching Profit.
Position Profit/Loss shows the benefits and losses from your current position.
Total Profit/Loss is sum of Total Matching Profit and Position Profit/Loss.
The Expanded APY shows the benefits of running the strategy on these terms for a year.
Max Loss of Upper is the maximum loss assumed to be directly at the top of the grid range.
BEP days (Upper) show how many days of maintenance relative to Average Matching Profit can result in greater profit than maximum loss if the grid continues to move within range.
(In the case of Long Strategy, it appears to be 'Min Profit', which shows minimal benefit if it reaches the top.)
Max Loss of Lower and BEP days (Lower) shows the opposite.
(In the case of Short Strategy, it is also referred to as 'Min Profit', which shows minimal benefit if it reaches the bottom.)
3. Grid Info
Total Grid Number, Upper Limit, and Lower Limit show the values you set in INPUT.
Grid Open Price shows the price for the period you decide to open.
Starting Position shows the number of positions that were initially held in the case of a Long / Short Strategy.
(0 for Neutral Strategy)
Per Grid qty shows how many positions are allocated to one grid
Grid Interval shows the spacing of each grid.
Per Matched Profit shows how much profit is generated when a single grid is matched.
Caution
Backtesting results for these indicators may vary depending on the time frame.
Therefore, I recommend that you use it only to compare Profit/Loss over time.
*In addition, there is a problem that all lines in the grid are not implemented, but it is independent of the backtest results.
--------------------------------------
서문
지표를 기획함에 있어서 가장 어려웠던 line 코드를 @xxattaxx-DisDev의 'Grid Bot Simulator' 스크립트를 통해 해결할 수 있었습니다.
이에 감사의 말씀을 드립니다.
해당 지표에 대한 간단한 설명
해당 지표는 다양한 거래소에서 오픈할 수 있는 그리드 매매에 대한 백테스팅을 위해 만들어졌습니다.
그리드매매는, 특정 가격 구간에 대해 가격이 오르고 내림에 따라 일정 간격에 맞춰 매매를 하는 방식입니다.
이 지표는 실질적으로 롱/숏/중립 그리드가 어떠한 성과를, 특정 기간동안 얼마나 냈는지를 확인하고자 만들어졌습니다.
사용방법
1. 인풋
지표를 차트위에 넣을 때, Lower Limit과 Upper Limit이 필요합니다.
그 후 그리드를 언제부터 오픈할 것인지를 선택하세요.
또, 필요하다면 Long / Short / Neutral의 방향을 선택하세요.
2. 그리드 통계
Matched Grid는, 백테스팅 기간동안 체결된 그리드 쌍이 몇개인지를 보여줍니다.
이 체결된 그리드의 갯수를 바탕으로 Daily Average Matched Profit이 계산됩니다.
Total Matched Profit은, Matched Grid * Per Matched Profit으로 계산됩니다.
Position Profit/Loss는, 현재 갖고 있는 포지션으로 인한 이익과 손실을 보여줍니다.
Total Matched Profit과 Position Profit/Loss를 합친 금액이 Total Profit/Loss가 됩니다.
Expcted APY는, 이러한 조건으로 전략을 1년동안 운영했을 때의 이익을 보여줍니다.
Max Loss of Upper는, 그리드 범위의 최상단에 바로 도달했을 경우를 가정한 최대 손실입니다.
BEP days(Upper)는, 그리드가 범위 내에서 계속 움직일 경우, Average Matched Profit을 기준으로 며칠동안 유지되어야 최대손실보다 더 큰 이익이 발생할 수 있는지를 보여줍니다.
(Long Strategy의 경우, ‘Min Profit’이라고 나타나는데, 최상단에 도달했을 경우 최소한의 이익을 보여줍니다)
Max Loss of Lower는 그 반대의 경우를 보여줍니다.
(Short Strategy의 경우, 역시 ‘Min Profit’이라고 나타나는데, 최하단에 도착했을 경우 최소한의 이익을 보여줍니다)
3. 그리드 정보
그리드 갯수, Upper Limt, Lower Limt은 자신이 설정한 값을 보여줍니다.
Grid Open Price는, 자신이 오픈하기로 정했던 기간의 가격을 보여줍니다.
Starting Position은, 롱/숏 그리드의 경우에 처음에 들고 시작했던 포지션의 갯수를 보여줍니다.
Neutral Strategy의 경우 0입니다.
Per Grid qty는, 하나의 그리드에 얼마만큼의 포지션이 배분되었는지를 보여주며
Grid Interval은 각 그리드의 간격을 보여줍니다.
또, Per Matched Profit은 하나의 그리드가 체결될 때 얼마만큼의 이익이 발생하는 지를 보여줍니다.
이러한 지표에 대한 역테스트 결과는 시간 프레임에 따라 달라질 수 있습니다.
따라서 시간 경과에 따른 손익을 비교할 때만 사용하는 것이 좋습니다.
*추가로, 그리드의 라인이 모두 구현되지 않는 문제가 있지만, 백테스팅 결과와는 무관합니다.
PineHelperLibrary "PineHelper"
This library provides various functions to reduce your time.
recent_opentrade_entry_bar_index()
get a recent opentrade entry bar_index
Returns: (int) bar_index
recent_closedtrade_entry_bar_index()
get a recent closedtrade entry bar_index
Returns: (int) bar_index
recent_closedtrade_exit_bar_index()
get a recent closedtrade exit bar_index
Returns: (int) bar_index
all_opnetrades_roi()
get all aopentrades roi
Returns: (float) roi
bars_since_recent_opentrade_entry()
get bars since recent opentrade entry
Returns: (int) number of bars
bars_since_recent_closedtrade_entry()
get bars since recent closedtrade entry
Returns: (int) number of bars
bars_since_recent_closedtrade_exit()
get bars since recent closedtrade exit
Returns: (int) number of bars
recent_opentrade_entry_id()
get recent opentrade entry ID
Returns: (string) entry ID
recent_closedtrade_entry_id()
get recent closedtrade entry ID
Returns: (string) entry ID
recent_closedtrade_exit_id()
get recent closedtrade exit ID
Returns: (string) exit ID
recent_opentrade_entry_price()
get recent opentrade entry price
Returns: (float) price
recent_closedtrade_entry_price()
get recent closedtrade entry price
Returns: (float) price
recent_closedtrade_exit_price()
get recent closedtrade exit price
Returns: (float) price
recent_opentrade_entry_time()
get recent opentrade entry time
Returns: (int) time
recent_closedtrade_entry_time()
get recent closedtrade entry time
Returns: (int) time
recent_closedtrade_exit_time()
get recent closedtrade exit time
Returns: (int) time
time_since_recent_opentrade_entry()
get time since recent opentrade entry
Returns: (int) time
time_since_recent_closedtrade_entry()
get time since recent closedtrade entry
Returns: (int) time
time_since_recent_closedtrade_exit()
get time since recent closedtrade exit
Returns: (int) time
recent_opentrade_size()
get recent opentrade size
Returns: (float) size
recent_closedtrade_size()
get recent closedtrade size
Returns: (float) size
all_opentrades_size()
get all opentrades size
Returns: (float) size
recent_opentrade_profit()
get recent opentrade profit
Returns: (float) profit
all_opentrades_profit()
get all opentrades profit
Returns: (float) profit
recent_closedtrade_profit()
get recent closedtrade profit
Returns: (float) profit
recent_opentrade_max_runup()
get recent opentrade max runup
Returns: (float) runup
recent_closedtrade_max_runup()
get recent closedtrade max runup
Returns: (float) runup
recent_opentrade_max_drawdown()
get recent opentrade maxdrawdown
Returns: (float) mdd
recent_closedtrade_max_drawdown()
get recent closedtrade maxdrawdown
Returns: (float) mdd
max_open_trades_drawdown()
get max open trades drawdown
Returns: (float) mdd
recent_opentrade_commission()
get recent opentrade commission
Returns: (float) commission
recent_closedtrade_commission()
get recent closedtrade commission
Returns: (float) commission
qty_by_percent_of_equity(percent)
get qty by percent of equtiy
Parameters:
percent : (series float) percent that you want to set
Returns: (float) quantity
qty_by_percent_of_position_size(percent)
get size by percent of position size
Parameters:
percent : (series float) percent that you want to set
Returns: (float) size
is_day_change()
get bool change of day
Returns: (bool) day is change or not
is_in_trade()
get bool using number of bars
Returns: (bool) allowedToTrade
discord_message(name, message)
get json format discord message
Parameters:
name : (string) name of bot
message : (string) message that you want to send
Returns: (string) json format string
telegram_message(chat_id, message)
get json format telegram message
Parameters:
chat_id : (string) chatId of bot
message : (string) message that you want to send
Returns: (string) json format string
BT-Bollinger Bands - Trend FollowingEsse script foi criado para estudo de Backtest.
O script usa as Bandas de Bollinger para indicar o início de uma tendência, a entrada é configurada quando o preço abre abaixo e fecha acima da banda superior ou para venda quando o preço abre acima e fecha abaixo da banda inferior.
Não há um stop fixo e nem alvo fixo a saída se dá quando o preço toca a média da banda.
Você pode usar uma média móvel como filtro combinado com a estratégia.
O Script também pode ser usado com algum serviço de bot como 3commas.io , basta colocar as mensagens de entrada e saída para o bot.
Autor : Credsonb - Nick: M4TR1X_BR
Neste gráfico estou usando as seguintes configurações:
Bandas Bollinger: 7
Desvio Padrão: 1.5
Time Frame: 12hs
Ticker: ETH
This script was created for Backtest study.
script uses Bollinger Bands to indicate the start of a trend, entry is set when price opens below and closes above the upper band or for short when price opens above and closes below the lower band.
There is no fixed stop and no fixed target, the exit occurs when the price touches the average of the band.
You can use a moving average as a filter combined with the strategy.
The Script can also be used with some bot service like 3commas. io , just put the input and output messages to the bot.
Author : Credsonb - Nick: M4TR1X_BR
Full Volatility Statistics and Forecast
This is a tool designed to translate the data from the expected volatility of different assets, such as for example VIX, which measures the volatility of SP500 index.
Once get the data from the volatility asset we want to measure(for this test I have used VIX), we are going to translate it the required timeframe expected move by dividing the initial value into :
252 = if we want to use the daily timeframe, since there are ~252 aproximative daily trading days
52 = if we want to use the weekly timeframe, since there 52 trading weeks in a year
12 = if we want to use the monthly timeframe, since there are 12 months in a year
For this example I have used 252 with the daily timeframe.
In this scenario, we can see that we had 5711 total cnadles which we analysed, and in this case, we had 942 crosses, where the daily movement ended up either above or below the channel made from the opening daily candle value + expected movement from the volatility, giving as a total of 16.5% of occurances that volatility was higher than expected, and in 83.5% of the times, we can see that the price stayed within our channel.
At the same time, we can see that we had 6 max losses in a row ( OUT) AND 95 max wins in a row (IN), and at the same time in those moments when the volatility crosses happen we had a 0.51% avg movements when the top crossed happened, and 0.67% avg movements when the bot happened.
Lastly on the second part of the panel, we had E which means the expected movement of today, for example it has 61.056$ , so lets say price opened on 4083, our top is 4083 + 61 and our bot is 4083 - 61 ( giving us the daily channel). At continuation we can see that overall the avg bull candle os 0.714% and avg bear candle was 0.805% .
I hope this tool will help you with your future analysis and trades !
If you have any questions please let me know !
BT-SAR Ema, Squeeze, Volatility
Esse script foi criado para estudo de Backtest.
Ele usa o SAR PARABÓLICO como indicador de sinal de entrada, você também pode combinar 3 indicadores para filtrar as entradas: Média Móvel, Squeeze Momentum e Volatility Oscilator .
Existe duas entradas, quando o SAR Parabólico vira ou pelo Breakout (usando o último preço) do SAR Parabólico antes dele virar.
As Os filtros podem ser usados de forma combinada ou individual.
O Script também pode ser usado com algum serviço de bot como 3commas.io, basta colocar as mensagens de entrada e saída para o bot.
This script was created for Backtest study.
It uses PARABOLIC SAR as input signal indicator, you can also combine 3 indicators to filter inputs: Moving Average, Squeeze Momentum and Volatility Oscillator .
There are two entries, when the Parabolic SAR turns or by Breakout (using the last price) of the Parabolic SAR before it turns.
The Filters can be used in combination or individually.
The Script can also be used with some bot service like 3commas.io, just put the input and output messages to the bot.
Percentage Range IndicatorThe Percentage Range Indicator is useful for assessing the volatility of pairs for percentage-based grid bots. The higher the percentage range for a given time period, the more trades a grid bot is likely to generate in that period. Conversely, a grid bot can be optimised by using grids that are less than the Percentage Range Indicator value.
I have been using the Percentage Range Indicator based on the one hour time period and 168 periods of smoothing (seven days based on one-hour periods).
Enjoy.
3RSI 3CCI BB 5orders DCA strategy+This strategy is just an attempt to find the indicator values for the trading bot service that I use (link in profile). Due to the use of the “request.security” function in the code, the indicators can be redrawn, but this is not important in history. The strategy used only 5 orders for the "DCA" - bot, located at the same distance in the price overlap range. I only use this strategy when trading in pairs against bitcoin.
Эта стратегия – просто попытка подобрать значения индикаторов для сервиса торговых ботов, который я использую (ссылка в профиле). Из-за использования в коде функции «request.security» возможна перерисовка индикаторов, но на истории это не важно. В стратегии использовано всего 5 ордеров для «DCA» - бота, находящихся на одинаковом расстоянии в диапазоне перекрытия цены. Я использую данную стратегию только при торговле в парах к биткоину.
Scalping Trading System ALERT Crypto and StocksThis is the alert version of the strategy with the same name.
Indicators
SImple Moving Average
Exponential Moving Average
Keltner Channels
MACD Histogram
Stochastics
Rules for entry
long= Close of the candle bigger than both moving averages and close of the candle is between the top and bot levels from Keltner . At the same time the macd histogram is negative and stochastic is below 50.
short= Close of the candle smaller than both moving averages and close of the candle is between the top and bot levels from Keltner . At the same time the macd histogram is positive and stochastic is above 50.
Rules for exit
We exit when we meet an opposite reverse order.
This strategy has no risk management inside, so use it with caution !
DiscordWebhookFunctionLibrary "DiscordWebhookFunction"
discordMarkdown(_str, _italic, _bold, _code, _strike, _under) Convert string to markdown formatting User can combine any function at the same time.
Parameters:
_str : String input
_italic : Italic
_bold : Bold
_code : Code markdown
_strike : Strikethrough
_under : Underline
Returns: string Markdown formatted string.
discordWebhookJSON(_username, _avatarImgUrl, _contentText, _bodyTitle, _descText, _bodyUrl, _embedCol, _timestamp, _authorName, _authorUrl, _authorIconUrl, _footerText, _footerIconUrl, _thumbImgUrl, _imageUrl) Convert data to JSON format for Discord Webhook Integration.
Parameters:
_username : Override bot (webhook) username string / name,
_avatarImgUrl : Override bot (webhook) avatar by image URL,
_contentText : Main content page message,
_bodyTitle : Custom Webhook's embed message body title,
_descText : Webhook's embed message body description,
_bodyUrl : Webhook's embed body direct link URL,
_embedCol : Webhook's embed color,
_timestamp : Timestamp,
_authorName : Webhook's embed author name / title,
_authorUrl : Webhook's embed author direct link URL,
_authorIconUrl : Webhook's embed author icon by image URL,
_footerText : Webhook's embed footer text / title,
_footerIconUrl : Webhook's embed footer icon by image URL,
_thumbImgUrl : Webhook's embed thumbnail image URL,
_imageUrl : Webhook's embed body image URL.
Returns: string Single-line JSON format
Mid to High daily % - MA & ThresholdPurpose of this script is to provide a metric for comparing crypto volatility in terms of the % gain that can be garnished if you buy the midpoint price of the day and sell the high***. I'm specifically using bots that buy non-stop. This metric makes it easy to compare crypto coins while also providing insight on what a take profit % should be if I want to be sure it closes often instead of getting stuck in a position.
Added a few moving averages of (Mid-range to High Daily %). When these lines starts to trend down, it's time to lower the take profit % or move on to the next coin.
Decided to add a threshold so I could easily mark where I think the (Mid-range to High Daily %) is for most days.
Ex. I can mark 10% threshold and can eyeball roughly ~75% of the days in the past month or so were at or above that level. Then I know I have plenty volatility for a bot taking 5% profit. Also if you have plenty of periodic poke-through that month (let's say once a week) you might argue that you can set it to 7% if you're willing to wait about that long. Either way this metric is conservative because it is only the middle of the range to the high, a less conservative version might provide the % gain if you bought the day low and sold the day high.
***Since this calculation only takes the middle of the range and the high of the day into account, red days are volatile against a buyer but to your advantage if you are a seller. BUT if you have plenty of safety buy orders this volatility in price only means your total purchase volume increases and when/if you reach a take profit level you sell more there.
Would like to upgrade and add a separate MA line for green days and a separate MA line for red days to discern if that particular coin has a bias. Also would like to include some statistics on how many candles are above or below threshold for a certain period instead of eyeballing.
nonoiraq indicator it's very strong i edit this indicator to connect it with my bot to auto trading and he take the info from the volume, so when he is give me a single the bot take just 0.50% to 1% for 3 - 5 trade in day and this perfect, if u use a manual trading this indicator can reach to from 10% to 80% in some point .
the indicator have 3 line
(Red , Purple, Yellow)
1- The yellow line it's high sensitivity this mean it's when rich to the -3 or 3 you can open the order when the bar is close and the signal be sure
and u need to watch the your order because in some case he is reach to 0.30% to 2% and the price reflected to loss and when you wait the price reflected to but my advice you take profit and close the order directly.
2- The purple circles it's medium sensitivity this mean when the purple hit the 2.5 or 3 from down or up in indicator with yellow line you open the order when bar close and the signal is be sure , like example in the photo
3- The red circles it's low sensitivity and this one when reach to 3.0 with any line (yellow or purple) you open directly short or long , like the example in the photo
i am sorry for my english it's not very good
please support me to share other idea or script
Take America Back Version 1.0So basically, the when the price goes down a little, it buys, and when it goes up a little it buys. The only indicators are account balances, and the price, that’s it. Now I wish that Pine Script had a function or variable in which I could recall the balances of specific portions of the portfolio, but it doesn’t. So, I had to improvise. Now for this to work accurately, all of the money needs to be in the “base” side before the bot can begin. Now, the thing about this is that it does not re-invest the amount that is “saved” to all but guarantee the balance will go up. However, as this goes up it will not add up as quickly in order to allow more wiggle room so that the bot does not work itself into a corner. If you want to keep some of your base, enter how much you want to keep it in the initial “saved” setting, as long as you allow at least enough to be equal to the default quantity value. Also, I recommend you setting the pyramiding setting to the result of the base value divided by the default quantity value. The default quantity value is how much you invest, measured in the base currency.
This would have been sooooo much easier if pine script could allow me to recall specific balances, but maybe a future one will.
Finally, THIS is why I made this program, I wanted to create something that would prevent the little ones from being stepped on by the big players who don't always play fair.
Besides, cryptocurrencies were made in response to the 2008 financial meltdown that caused a global recession. This decentralized currency is not just the money of the banks, the corporations, or the governments, but the money of the people. Use this tool to level the massive wealth inequality in my country and take America Back.
I will post more links and updates later once my reputation score goes up. I will discuss more about what influenced me to make this program and as some advise and possible future improvements as well.
Technicals Rating Strategy v420Ichimoku, HMA, RSI, Stoch, CCI, MACD, Technicals Rating Strategy is a trading Bot that looks at these chosen indicators and assigns a value to each, then calculates the result of adding each indicators result value to a overall rating, which is then compared to a user set level. Here seen on Bitcoin, it has the broker fee included in the testing result. If you choose to use it on Forex etc, perhaps remove the broker fee which is unrealistic for FX trading.
It has a Win/Loss ratio of only 40% wins, but it catches the big moves and thats the main thing, so if ELON MUSK had of used this strategy instead of BUY and HOLD, he could of made 700% instead of 7% (as is, may, 2021)
Mainly intended for use as Automated TRADE BOT.
(imagine if Elon Musk did use this bot with his 1.3 billion $ worth of BTC, the drawdown would be like, half a billion or something haha (p.s.- use smaller lotsize % to get smaller drawdown, but then smaller profit....) )
For use with any pair and timeframe. In fact there is a timeframe setting to set the strategy to look at alternative timeframe from chart, but as default will just be set to charts timeframe.
Multiple Timeframe Fib Bollinger Bands - can be used for 3commas*** This idea is based on Bollingers Bands Fibonacci ratios by Shizaru ()
** This will look less chaotic if you don't have all four time frames on at once! I left them on for the demo picture just to show them all simultaneously working.
This is the basis for most of my bot ideas - indicators from longer chart time frames laid over short time frame charts. What I mean by this is that I like the responsiveness of a 1m chart but indicators from a 1h or 4h chart. There are obviously downsides to doing this or everyone would do it, but I have consistently gotten top results using this method. This is a study, so not a strategy yet but you can use this with 3commas if you convert it to a strategy using band crossover/under points as buy and sell triggers.
That is super easy; just follow this excellent guide here which should work for this script:
kodify.net
It's not super hard if you know a little Pine but if you need help hit me up and we can figure something out.
This script by default has 15m, 30m, 1h and 4h settings that are configurable via the gear icon. You can enable or disable any time frame, change the color, etc. I will probably add accurate line labels, custom time frames and adjustable transparency soon.
It's advisable to use higher time frame indicator on a lower time frame chart, but not the other way around. I would use these indicators on a 1m chart but not a 1d chart, for example.
Have fun and I hope you get some use out of this! I use it for context more than bots but it is definitely possible to use it with both.
M4x FIB-o-matic V3.6M4x is a combination of RSI and Fibonacci components, set up with fixed values, so no worries about "original" settings...
Recommendet Bot settings:
- use one short and one long bot
- take profit 0.5%
- 6 simul trades
- 3 security orders, VolScale 1.5, StepScale 1.4
- Deviation 0.35%
- cooldown 780sec
Alerts:
- aproved Buy
- aproved Sell
- heartbeat (..check if Script is running. Gives you the possibility to get an alive Signal every minute)
(With a few "input" M4x can be changed into a highly configurable Signal Generator with menus.)
...tested successful with BTC-ETH, gl ;-)
LUBEThis is a chart meant for 30m BTCUSD but could be used for many other assets, and there are inputs to play with.
I decided on the strange title "LUBE" because I was measuring how many of the previous 500 bars had the current price level already been in. I wanted to discover when the price was in a new zone or an area that it hadn't spent much time in recently... the LUBE zone.
Think of the blue line as showing you the current level friction. If the blue line is high, price is quagmired and not moving quickly. Price could trend sideways for a while before breaking out. A high blue line is a high traffic zone for trading. When the blue line dips low, it's encountering a price zone the asset has not been observed in recently, and this could mean price could break out and move more freely and quickly when it does. We get a trade entry signal if the blue line dips below the bottom white line. The bottom white line is currently set to -10. Think about the lowest the blue line has been recently as 0, and the highest as 100. It is set by default (for BTCUSD 30m chart) to -10 meaning the blue line has to dip a little (-10%) below the lowest it has experienced recently to initiate a trade. This is the LUBE zone. The bottom white line shows that level. Again this is a level lower than the lowest amount of friction experienced in price action for the last 100 bars, but offset by 5 bars showing where that level was at 5 bars ago. We want to dip below that to initiate a trade.
The direction to trade in is determined by a very quick moving weighted moving average (variable name is "fir") to see if the recent trend is up or down. To end a trade, an arbitrary number between 0 and 100 is picked telling us when we are experiencing enough friction again to end the trade. I have it preset to 50 (think of it as 50/100 or half way between the white bars. At a 50% friction level it's time to get out of the trade.
Some shortcomings are missing the bulk of big moves, and experiencing whipsaws where price action zips up and then comes straight back down. Overall the backtest looks sweet enough to use on 2x leverage, experiencing a 17.78% max drawdown at the time of publishing. I wouldn't push the leverage any higher.
To get alerts change the word "strategy" to "study" and delete lines 60-67.
Bot traders using alerts: beware the alert conditions. If a trade goes directly from long to short (which happens rarely), without closing a trade first, it might not act properly. If you use bots to trade, for "LONG" please close any old trades first before putting in instructions to open a leveraged long. To go "SHORT" please remember to close any old trade first as well, and things *should* work out just fine.
Good luck, have fun, and feel free to mess up and butcher this code to your own liking. I'm not responsible if anything bad that happens to you if you use this trading system, or for any bugs you may encounter.
CBMA Bollinger Bands Strategy directed [ChuckBanger]I just did a Bollinger Bands script with my newly CB moving average
While I'm generally against posting strategies because it's very easy to fake performance numbers... This is just to share a cool strategy snippet. My settings are 10 contracts/order with pyramiding set to 10. You can make the profitability a lot higher if you set the order size higher. But that dosent help you getting more out of this script when u make a bot of this script. I set the order size to 10 contracts to get your attention not to showcase the performance.
When the price is going down and outside of the lower side of the band. And when the price comes back into the channel the strategy buys. Usually that means the price is going up. And when the price is going up and outside of the upper band. The strategy sells when it crosses back in to the channel.
It is a very simple strategy but it is effective. I guess you need a proper stop-loss for this script to bee really profitable in a bot environment.
3 HULLs & ICHIMOKU divided by PRICEBasically just another form of moving average, for quick swings, built for testing/use with API cryptobots, simple switch from buy to sell.
Hull MA(2 candles back) times 3 plus Ichimoku divided by price(1 candle back) = value1
Hull MA(3 candles back) times 3 plus Ichimoku divided by price(1 candle back) = value2
if value1>value2 then buy else sell
calculates price from 1 candle back, and calculates signal from 2nd and 3rd candle prices, so no repainting? so best on low timeframes.
for when use in bot, would not need 1 candle lag. Lag is for TV chartists to not have to suffer repainting.
Bots do not repaint. they are not "painting" anything, they simply open or close orders, which cannot be "repainted"
but here on TV chart, when you refresh the browser page, the script recalculates, and signals may be repainted.
hopefully this will not repaint. please test. thankyou
PT Magic Triggers So its me again. I have decided to create Trend Trigger Script for PT Magic addon for a trading bot Profit Trailer. If you do not own this bot and Addon the following explanation will not help you.
For each Trend you define number of minutes and it then calculates the percentage change between the close price now and X candles before.
Same calculation is for all 6 Triggers i beleive that is all you need :)
Hope it helps you all.
LTC: LYHj4WDN7BPu5294cSpqK3SgWSWdDX56Qt
BTC: 1NPVzeDSsenaCS9QdPro877hkMk93nRLcD
MACD, backtest 2015+ only, cut in half and doubledThis is only a slight modification to the existing "MACD Strategy" strategy plugin!
found the default MACD strategy to be lacking, although impressive for its simplicity. I added "year>2014" to the IF buy/sell conditions so it will only backtest from 2015 and beyond ** .
I also had a problem with the standard MACD trading late, per se. To that end I modified the inputs for fast/slow/signal to double. Example: my defaults are 10, 21, 10 so I put 20, 42, 20 in. This has the effect of making a 30min interval the same as 1 hour at 10,21,10. So if you want to backtest at 4hr, you would set your time interval to 2hr on the main chart. This is a handy way to make shorter time periods more useful even regardless of strategy/testing, since you can view 15min with alot less noise but a better response.
Used on BTCCNY OKcoin, with the chart set at 45 min (so really 90min in the strategy) this gave me a percent profitable of 42% and a profit factor of 1.998 on 189 trades.
Personally, I like to set the length/signals to 30,63,30. Meaning you need to triple the time, it allows for much better use of shorter time periods and the backtests are remarkably profitable. (i.e. 15min chart view = 45min on script, 30min= 1.5hr on script)
** If you want more specific time periods you need to try plugging in different bar values: replace "year" with "n" and "2014" with "5500". The bars are based on unix time I believe so you will need to play around with the number for n, with n being the numbers of bars.