EMAGAIN for Profit Trailer by BotIndicatorsThis is a highly adjustable indicator for the ProfitTrailer Crypto Currency Trading Bot.
You can use it to visualize the EMAGAIN buy strategy. Here is how it works:
Set the candle size by setting your TV candle time accordingly
Set the candles used for Slow and Fast EMA Lines in the settings of this Indicator
Also set the buy value you would like to use on your bot to visualize the buy zones. You can set it either positive or negative.
The indicator will then show the Fast EMA, Slow EMA as well as the the areas where the actual price exceeds the buy value you have set and would generate a buy signal for Profit Trailer. Please keep in mind that Profit Trailer may still use trailing buy and trailing profit to optimize your buy/sell situation, this can obviously not be shown through this indicator.
Note: This is a first public release, future modifications may follow and are then shown on this site as updates. Always read this page to the end.
Recherche dans les scripts pour "bot"
SMASPREAD for Profit Trailer by BotIndicatorsThis is a highly adjustable indicator for the ProfitTrailer Crypto Currency Trading Bot.
You can use it to visualize the SMASPREAD buy strategy. Here is how it works:
Set the candle size by setting your TV candle time accordingly
Set the candles used for Slow and Fast SMA Lines in the settings of this Indicator
Also set the buy value you would like to use on your bot to visualize the buy zones. You can set it either positive or negative.
The indicator will then show the Fast SMA, Slow SMA as well as the the areas where the actual price exceeds the buy value you have set and would generate a buy signal for Profit Trailer. Please keep in mind that Profit Trailer may still use trailing buy and trailing profit to optimize your buy/sell situation, this can obviously not be shown through this indicator.
Note: This is a first public release, future modifications may follow and are then shown on this site as updates. Always read this page to the end.
EMASPREAD for Profit Trailer by BotIndicatorsThis is a highly adjustable indicator for the ProfitTrailerCrypto Currency Trading Bot.
You can use it to visualize the EMASPREAD buy strategy. Here is how it works:
Set the candle size by setting your TV candle time accordingly
Set the candles used for Slow and Fast EMA Lines in the settings of this Indicator
Also set the buy value you would like to use on your bot to visualize the buy zones. You can set it either positive or negative.
The indicator will then show the Fast EMA, Slow EMA as well as the the areas where the actual price exceeds the buy value you have set and would generate a buy signal for Profit Trailer. Please keep in mind that Profit Trailer may still use trailing buy and trailing profit to optimize your buy/sell situation, this can obviously not be shown through this indicator.
Note: This is a first public release, future modifications may follow and are then shown on this site as updates. Always read this page to the end.
BB/StochRSI Strategy Backtest For Crypto BotThumbs Up for access
Buy is triggered when the price reaches chosen percent of lower Bollinger Band, Stoch RSI is oversold and there's a K/D signal crossover. The exit is when StochRSI is Overbought or K/D Crossover (toggle) AND/OR (toggle) price is greater than or equal to Top or Mid Bollinger Band (toggle).
Use 15m charts. It works excellent for consolidating/sideways markets and good for bullish impulsive moves but takes losses during impulsive downside market moves.
Results will be better in real-time. The script calculates the price based on the close, but a bot would calculate in real-time. Entries would be better. I recommend manually testing the strategy by using the "Date and Price Range" tool in TradingView.
I'll share the source code to those who wish to collaborate for improving profitability.
Grahn Gyllene Kors [Alerts]Grahn Gyllene Kors is the companion study for the Grahn Gyllene Kors strategy...
This is an EMA / Trend Explorer & Strategy useful for identifying trends before EMA's cross and also identifying and experimenting with various EMA lengths and candle trends. There is also a companion Alerts study for this in which trend signals may be sent to the user via sms or email AND/OR buy and sell alerts may be sent to bots for automated trading of this strategy. Once you have optimized your settings and backtested with this strategy, apply your same settings into the Alerts study and create your alerts.
NOTICE: This script does not require access from me, simply open Indicators on chart and search for "Grahn". By accessing this script you acknowledge that you have read and understood that this is for research purposes only and I am not responsible for any financial losses you may incur by using this script!
EMA Fast and EMA Slow - may be adjusted in length and color.
Bullish F>S % - controls what percentage the EMA Fast should be above EMA Slow before considered bullish and is represented by the Green band on the chart.
Neutral % - is what percentage surrounding the EMA Slow should be considered neutral and is represented by the Yellow band on the chart.
Bearish F<S % - controls what percentage the EMA Fast should be below EMA Slow before considered bearish and is represented by the Red band on the chart.
Enable Trend - determines whether Trend Strength is enforced in strategy in addition to EMA divergence.
Bull Candles # - is the number of candles ranging from 0 (off) to 5 that should be consecutively higher in value before considered to be a trend.
Neut Candles # - is the number of candles that should consecutively remain in the Neutral yellow band before considered to be trending neutral for signal alerts (has no impact on strategy).
Bear Candles # - is the number of candles ranging from 0 (off) to 5 that should be consecutively lower in value before considered to be a trend.
Pump Increase % - is the rise in price that should be considered a pump for signal alerts (has no impact on strategy).
Pump Candles # - is the number of candles over which Pump Increase % should be considered (has no impact on strategy).
Dump Decrease % - is the rise in price that should be considered a pump for signal alerts (has no impact on strategy).
Dump Candles # - is the number of candles over which Dump Decrease % should be considered (has no impact on strategy).
Show EMA Fast & Slow - their display may be turned on or off.
Enable Range - may be enabled for backtesting (in strategy) a specific range of time (disabled uses default range based on period).
BTC Long vs. Short http://cryptoanalyzer.info/botThis indicator uses Longs and Shorts count to predict market divergences. 77% profitable.
Margin calls speaks for itself. Get it for free with TradingView Auto-Trader BOT
It will do not repaints, use stable data from market. Trade signals are stable as in Blue Velvet and Purple Sea
BTC MTF Directional average (1h/2h res)1h or 2h resolution
Any market without multiple weekly binary data events and enough liquidity (eg. Bitcoin)
**For bitcoin use preferably on bitfinex or an index of all exchanges and exchange volume. Most of the price manipulation occurs at bitfinex, other exchanges will often be slightly behind.
V 0.0.1
** KNOWN ISSUES
Around the time of the new daily candle (2AM GMT+1 on BTC) false signals may occur due to 24 hours being the highest resolution.
Repainting: due to the nature of tradingview's pinescript these false signals will disappear after 2-3 new candles and refreshing the page.
** UPDATES
Added browser alerts (untested)
Tip: Don't always wait for the bot to flip to risk off when volatility kicks in (eg. during wash trades).
Moonbot - Cryptocurrency Trading StrategyThis is a greatly improved upon version of my cryptoTurtle. Enough has changed I didn't think it was appropriate to just update cryptoTurtle. I will possibly be selling this bot on bitcointalk in the future, stay tuned!
Setup:
Buy: Above green line and green up arrow.
Sell: Sell when above top red line or bottom red line. Also sell if arrow turns down and red.
Blue Velvet v1.2 http://cryptoanalyzer.info/botcryptoanalyzer.info
Long only version. No short signals
GunbotThis is based on the bot found here . It isn't as smart as gunbot due to limitations of pinescript, but I am posting up for anyone using gunbot as it might help with finding good pairs to trade and good settings for those pairs as you can use this to backtest. Also, I am only guessing at some things that his strategy does, based off the instructions and examples he gave in this thread.
simple botthe AI=
value of close of candle < value of close of candle previous by 1 = sell
close > close1 = buy
closeorder on SL
closeorder on AutoProfit
closeorder on signal reverse (if openorder not in profit)
Bot MasterSqueeze 1.1 (crypt)Countertrend strategy for correction to the average value. The strategy is designed primarily for crypto.
The principle of operation is that with a rapid price change, the strategy tends to take a reverse position to return to the average value, which statistically often happens. It is enough for you to determine the percentage of the offset about the average price and the size of the averaging position as a percentage of the deposit.
With the settings, you determine how to determine the average opening price. It can be MA at the price of opening, closing, etc., and DCMA. Soon I will add a few more options for determining the average opening price
You can also choose the average price at which the transaction will try to close.
Now there are 3 methods:
- closing when returning to the average price
- closing on the first correction candle
- opening on an abnormally large candle in the direction of correction and closing on the first one is opposite
Search for the settings by the selection method for each pair separately. It is better to trade using signals via a bot.
The strategy shows itself best on volatile coins paired with the dollar for 1 hour or more.
Soon I will add new options for opening and closing deals, as well as determining the average price.
ATTENTION: the strategy involves averaging, so be careful with levers and overestimating the percentage of the transaction from the deposit. It is best to allocate no more than 25 percent to the risk of the transaction.
Bot go_up strategyHello. This strategy is based on go_up alerts.
Our task is to find the local minimum. The trade is entered on the basis of RSI and SMA according to a specific formula, which is embedded in the code. When the RSI crosses the SMA upside down, a long position is entered. You can change the length of the RSI . The longer the length, the less frequent, but more accurate the entrance, and vice versa. You can use a different time frame.
The settings have:
1) RSI length, the lower the length, the more often the entry.
2) Testing results for any period of time
3) Take profit for any percentage
4) Stop order for any percentage
5) If there is a check mark ✅, then purchases will always be made, and if not, then purchases will be made, BUT, if the next payback is lower than the previous one, it does not matter by what percentage.
6) If there is a check mark ✅, then each trace of the purchase will be made provided that it is lower by the percentage specified, even if the conditions of the purchase are triggered.
7) The filled area is made for visual display of consolidation zones
Default settings:
RSI length 15, step 1.5, take profit 15, stop order 30.
Also in the settings there is a pyramid of the order, keep this in mind. Enter a deal for a small part of the deposit, and not for all the money at once! You can remove pyramiding and see the results with one entry.
For a more visual understanding, overlay the go_up script.
You can choose a strategy for yourself based on history! If you need examples of strategies, then write to me, my contacts are in the column: instructions from the author.
Successful trades, dear friends, I am glad that you trust me!
bot strategy1分足逆張りです.この前公開したのよりは遥かに高性能(なはず)です.strategy.exitでstop使ってます.少し詳しくは英文で.
This strategy is the counter trade strategy that I am actually trying to implement, and is realized by a simple combination of 3 indicators (maybe 2 ?. eg. sma ). There is no plan to release the strategy, but it is a script that I personally expect because I am hooked on how to stop the contrarian and the timing of entry. I don't use "security" ,but using strategy.enter(limit) and strategy.exit(stop). It seems that the performance is better than the publicly available "stoploss" because it is not a specific price (eg. 500) range but a variable according to the market price. Since all entry, close, and stop values are shown in the graph, it is possible to find the value back from that value. Good luck.
※Tested environment : FXBTCJPY , 1min
Bot Study v7 OverlayShowing the direction of price, based on candlestick patterns. Working similarly as PSAR or Supertrend.
BOT O/C-EMA-SAR-ADX-ICHIMOKUIt is a study based on Open Close, crossing of EMA's, ADX, PARABOLIC SAR, RSI and VOLUME. He also has alerts and does not repaint.
MACDouble + RSI (rec. 15min-2hr intrv) Uses two sets of MACD plus an RSI to either long or short. All three indicators trigger buy/sell as one (ie it's not 'IF MACD1 OR MACD2 OR RSI > 1 = buy", its more like "IF 1 AND 2 AND RSI=buy", all 3 match required for trigger)
The MACD inputs should be tweaked depending on timeframe and what you are trading. If you are doing 1, 3, 5 min or real frequent trading then 21/44/20 and 32/66/29 or other high value MACDs should be considered. If you are doing longer intervals like 2, 3, 4hr then consider 9/19/9 and 21/44/20 for MACDs (experiment! I picked these example #s randomly).
Ideal usage for the MACD sets is to have MACD2 inputs at around 1.5x, 2x, or 3x MACD1's inputs.
Other settings to consider: try having fastlength1=macdlength1 and then (fastlength2 = macdlength2 - 2). Like 10/26/10 and 23/48/20. This seems to increase net profit since it is more likely to trigger before major price moves, but may decrease profitable trade %. Conversely, consider FL1=MCDL1 and FL2 = MCDL2 + (FL2 * 0.5). Example: 10/26/10 and 22/48/30 this can increase profitable trade %, though may cost some net profit.
Feel free to message me with suggestions or questions.
TRADINGLibrary "TRADING"
This library is a client script for making a webhook signal formatted string to PoABOT server.
entry_message(password, percent, leverage, margin_mode, kis_number)
Create a entry message for POABOT
Parameters:
password (string) : (string) The password of your bot.
percent (float) : (float) The percent for entry based on your wallet balance.
leverage (int) : (int) The leverage of entry. If not set, your levereage doesn't change.
margin_mode (string) : (string) The margin mode for trade(only for OKX). "cross" or "isolated"
kis_number (int) : (int) The number of koreainvestment account. Default 1
Returns: (string) A json formatted string for webhook message.
order_message(password, percent, leverage, margin_mode, kis_number)
Create a order message for POABOT
Parameters:
password (string) : (string) The password of your bot.
percent (float) : (float) The percent for entry based on your wallet balance.
leverage (int) : (int) The leverage of entry. If not set, your levereage doesn't change.
margin_mode (string) : (string) The margin mode for trade(only for OKX). "cross" or "isolated"
kis_number (int) : (int) The number of koreainvestment account. Default 1
Returns: (string) A json formatted string for webhook message.
close_message(password, percent, margin_mode, kis_number)
Create a close message for POABOT
Parameters:
password (string) : (string) The password of your bot.
percent (float) : (float) The percent for close based on your wallet balance.
margin_mode (string) : (string) The margin mode for trade(only for OKX). "cross" or "isolated"
kis_number (int) : (int) The number of koreainvestment account. Default 1
Returns: (string) A json formatted string for webhook message.
exit_message(password, percent, margin_mode, kis_number)
Create a exit message for POABOT
Parameters:
password (string) : (string) The password of your bot.
percent (float) : (float) The percent for exit based on your wallet balance.
margin_mode (string) : (string) The margin mode for trade(only for OKX). "cross" or "isolated"
kis_number (int) : (int) The number of koreainvestment account. Default 1
Returns: (string) A json formatted string for webhook message.
manual_message(password, exchange, base, quote, side, qty, price, percent, leverage, margin_mode, kis_number, order_name)
Create a manual message for POABOT
Parameters:
password (string) : (string) The password of your bot.
exchange (string) : (string) The exchange
base (string) : (string) The base
quote (string) : (string) The quote of order message
side (string) : (string) The side of order messsage
qty (float) : (float) The qty of order message
price (float) : (float) The price of order message
percent (float) : (float) The percent for order based on your wallet balance.
leverage (int) : (int) The leverage of entry. If not set, your levereage doesn't change.
margin_mode (string) : (string) The margin mode for trade(only for OKX). "cross" or "isolated"
kis_number (int) : (int) The number of koreainvestment account.
order_name (string) : (string) The name of order message
Returns: (string) A json formatted string for webhook message.
in_trade(start_time, end_time, hide_trade_line)
Create a trade start line
Parameters:
start_time (int) : (int) The start of time.
end_time (int) : (int) The end of time.
hide_trade_line (bool) : (bool) if true, hide trade line. Default false.
Returns: (bool) Get bool for trade based on time range.
real_qty(qty, precision, leverage, contract_size, default_qty_type, default_qty_value)
Get exchange specific real qty
Parameters:
qty (float) : (float) qty
precision (float) : (float) precision
leverage (int) : (int) leverage
contract_size (float) : (float) contract_size
default_qty_type (string)
default_qty_value (float)
Returns: (float) exchange specific qty.
method set(this, password, start_time, end_time, leverage, initial_capital, default_qty_type, default_qty_value, margin_mode, contract_size, kis_number, entry_percent, close_percent, exit_percent, fixed_qty, fixed_cash, real, auto_alert_message, hide_trade_line)
Set bot object.
Namespace types: bot
Parameters:
this (bot)
password (string) : (string) password for poabot.
start_time (int) : (int) start_time timestamp.
end_time (int) : (int) end_time timestamp.
leverage (int) : (int) leverage.
initial_capital (float)
default_qty_type (string)
default_qty_value (float)
margin_mode (string) : (string) The margin mode for trade(only for OKX). "cross" or "isolated"
contract_size (float)
kis_number (int) : (int) kis_number for poabot.
entry_percent (float) : (float) entry_percent for poabot.
close_percent (float) : (float) close_percent for poabot.
exit_percent (float) : (float) exit_percent for poabot.
fixed_qty (float) : (float) fixed qty.
fixed_cash (float) : (float) fixed cash.
real (bool) : (bool) convert qty for exchange specific.
auto_alert_message (bool) : (bool) convert alert_message for exchange specific.
hide_trade_line (bool) : (bool) if true, Hide trade line. Default false.
Returns: (void)
method print(this, message)
Print message using log table.
Namespace types: bot
Parameters:
this (bot)
message (string)
Returns: (void)
method start_trade(this)
start trade using start_time and end_time
Namespace types: bot
Parameters:
this (bot)
Returns: (void)
method entry(this, id, direction, qty, limit, stop, oca_name, oca_type, comment, alert_message, when)
It is a command to enter market position. If an order with the same ID is already pending, it is possible to modify the order. If there is no order with the specified ID, a new order is placed. To deactivate an entry order, the command strategy.cancel or strategy.cancel_all should be used. In comparison to the function strategy.order, the function strategy.entry is affected by pyramiding and it can reverse market position correctly. If both 'limit' and 'stop' parameters are 'NaN', the order type is market order.
Namespace types: bot
Parameters:
this (bot)
id (string) : (string) A required parameter. The order identifier. It is possible to cancel or modify an order by referencing its identifier.
direction (string) : (string) A required parameter. Market position direction: 'strategy.long' is for long, 'strategy.short' is for short.
qty (float) : (float) An optional parameter. Number of contracts/shares/lots/units to trade. The default value is 'NaN'.
limit (float) : (float) An optional parameter. Limit price of the order. If it is specified, the order type is either 'limit', or 'stop-limit'. 'NaN' should be specified for any other order type.
stop (float) : (float) An optional parameter. Stop price of the order. If it is specified, the order type is either 'stop', or 'stop-limit'. 'NaN' should be specified for any other order type.
oca_name (string) : (string) An optional parameter. Name of the OCA group the order belongs to. If the order should not belong to any particular OCA group, there should be an empty string.
oca_type (string) : (string) An optional parameter. Type of the OCA group. The allowed values are: "strategy.oca.none" - the order should not belong to any particular OCA group; "strategy.oca.cancel" - the order should belong to an OCA group, where as soon as an order is filled, all other orders of the same group are cancelled; "strategy.oca.reduce" - the order should belong to an OCA group, where if X number of contracts of an order is filled, number of contracts for each other order of the same OCA group is decreased by X.
comment (string) : (string) An optional parameter. Additional notes on the order.
alert_message (string) : (string) An optional parameter which replaces the {{strategy.order.alert_message}} placeholder when it is used in the "Create Alert" dialog box's "Message" field.
when (bool) : (bool) An optional parmeter. Condition, deprecated.
Returns: (void)
method order(this, id, direction, qty, limit, stop, oca_name, oca_type, comment, alert_message, when)
It is a command to place order. If an order with the same ID is already pending, it is possible to modify the order. If there is no order with the specified ID, a new order is placed. To deactivate order, the command strategy.cancel or strategy.cancel_all should be used. In comparison to the function strategy.entry, the function strategy.order is not affected by pyramiding. If both 'limit' and 'stop' parameters are 'NaN', the order type is market order.
Namespace types: bot
Parameters:
this (bot)
id (string) : (string) A required parameter. The order identifier. It is possible to cancel or modify an order by referencing its identifier.
direction (string) : (string) A required parameter. Market position direction: 'strategy.long' is for long, 'strategy.short' is for short.
qty (float) : (float) An optional parameter. Number of contracts/shares/lots/units to trade. The default value is 'NaN'.
limit (float) : (float) An optional parameter. Limit price of the order. If it is specified, the order type is either 'limit', or 'stop-limit'. 'NaN' should be specified for any other order type.
stop (float) : (float) An optional parameter. Stop price of the order. If it is specified, the order type is either 'stop', or 'stop-limit'. 'NaN' should be specified for any other order type.
oca_name (string) : (string) An optional parameter. Name of the OCA group the order belongs to. If the order should not belong to any particular OCA group, there should be an empty string.
oca_type (string) : (string) An optional parameter. Type of the OCA group. The allowed values are: "strategy.oca.none" - the order should not belong to any particular OCA group; "strategy.oca.cancel" - the order should belong to an OCA group, where as soon as an order is filled, all other orders of the same group are cancelled; "strategy.oca.reduce" - the order should belong to an OCA group, where if X number of contracts of an order is filled, number of contracts for each other order of the same OCA group is decreased by X.
comment (string) : (string) An optional parameter. Additional notes on the order.
alert_message (string) : (string) An optional parameter which replaces the {{strategy.order.alert_message}} placeholder when it is used in the "Create Alert" dialog box's "Message" field.
when (bool) : (bool) An optional parmeter. Condition, deprecated.
Returns: (void)
method close_all(this, comment, alert_message, immediately, when)
Exits the current market position, making it flat.
Namespace types: bot
Parameters:
this (bot)
comment (string) : (string) An optional parameter. Additional notes on the order.
alert_message (string) : (string) An optional parameter which replaces the {{strategy.order.alert_message}} placeholder when it is used in the "Create Alert" dialog box's "Message" field.
immediately (bool) : (bool) An optional parameter. If true, the closing order will be executed on the tick where it has been placed, ignoring the strategy parameters that restrict the order execution to the open of the next bar. The default is false.
when (bool) : (bool) An optional parmeter. Condition, deprecated.
Returns: (void)
method cancel(this, id, when)
It is a command to cancel/deactivate pending orders by referencing their names, which were generated by the functions: strategy.order, strategy.entry and strategy.exit.
Namespace types: bot
Parameters:
this (bot)
id (string) : (string) A required parameter. The order identifier. It is possible to cancel an order by referencing its identifier.
when (bool) : (bool) An optional parmeter. Condition, deprecated.
Returns: (void)
method cancel_all(this, when)
It is a command to cancel/deactivate all pending orders, which were generated by the functions: strategy.order, strategy.entry and strategy.exit.
Namespace types: bot
Parameters:
this (bot)
when (bool) : (bool) An optional parmeter. Condition, deprecated.
Returns: (void)
method close(this, id, comment, qty, qty_percent, alert_message, immediately, when)
It is a command to exit from the entry with the specified ID. If there were multiple entry orders with the same ID, all of them are exited at once. If there are no open entries with the specified ID by the moment the command is triggered, the command will not come into effect. The command uses market order. Every entry is closed by a separate market order.
Namespace types: bot
Parameters:
this (bot)
id (string) : (string) A required parameter. The order identifier. It is possible to close an order by referencing its identifier.
comment (string) : (string) An optional parameter. Additional notes on the order.
qty (float) : (float) An optional parameter. Number of contracts/shares/lots/units to exit a trade with. The default value is 'NaN'.
qty_percent (float) : (float) Defines the percentage (0-100) of the position to close. Its priority is lower than that of the 'qty' parameter. Optional. The default is 100.
alert_message (string) : (string) An optional parameter which replaces the {{strategy.order.alert_message}} placeholder when it is used in the "Create Alert" dialog box's "Message" field.
immediately (bool) : (bool) An optional parameter. If true, the closing order will be executed on the tick where it has been placed, ignoring the strategy parameters that restrict the order execution to the open of the next bar. The default is false.
when (bool) : (bool) An optional parmeter. Condition, deprecated.
Returns: (void)
ticks_to_price(ticks, from)
Converts ticks to a price offset from the supplied price or the average entry price.
Parameters:
ticks (float) : (float) Ticks to convert to a price.
from (float) : (float) A price that can be used to calculate from. Optional. The default value is `strategy.position_avg_price`.
Returns: (float) A price level that has a distance from the entry price equal to the specified number of ticks.
method exit(this, id, from_entry, qty, qty_percent, profit, limit, loss, stop, trail_price, trail_points, trail_offset, oca_name, comment, comment_profit, comment_loss, comment_trailing, alert_message, alert_profit, alert_loss, alert_trailing, when)
It is a command to exit either a specific entry, or whole market position. If an order with the same ID is already pending, it is possible to modify the order. If an entry order was not filled, but an exit order is generated, the exit order will wait till entry order is filled and then the exit order is placed. To deactivate an exit order, the command strategy.cancel or strategy.cancel_all should be used. If the function strategy.exit is called once, it exits a position only once. If you want to exit multiple times, the command strategy.exit should be called multiple times. If you use a stop loss and a trailing stop, their order type is 'stop', so only one of them is placed (the one that is supposed to be filled first). If all the following parameters 'profit', 'limit', 'loss', 'stop', 'trail_points', 'trail_offset' are 'NaN', the command will fail. To use market order to exit, the command strategy.close or strategy.close_all should be used.
Namespace types: bot
Parameters:
this (bot)
id (string) : (string) A required parameter. The order identifier. It is possible to cancel or modify an order by referencing its identifier.
from_entry (string) : (string) An optional parameter. The identifier of a specific entry order to exit from it. To exit all entries an empty string should be used. The default values is empty string.
qty (float) : (float) An optional parameter. Number of contracts/shares/lots/units to exit a trade with. The default value is 'NaN'.
qty_percent (float) : (float) Defines the percentage of (0-100) the position to close. Its priority is lower than that of the 'qty' parameter. Optional. The default is 100.
profit (float) : (float) An optional parameter. Profit target (specified in ticks). If it is specified, a limit order is placed to exit market position when the specified amount of profit (in ticks) is reached. The default value is 'NaN'.
limit (float) : (float) An optional parameter. Profit target (requires a specific price). If it is specified, a limit order is placed to exit market position at the specified price (or better). Priority of the parameter 'limit' is higher than priority of the parameter 'profit' ('limit' is used instead of 'profit', if its value is not 'NaN'). The default value is 'NaN'.
loss (float) : (float) An optional parameter. Stop loss (specified in ticks). If it is specified, a stop order is placed to exit market position when the specified amount of loss (in ticks) is reached. The default value is 'NaN'.
stop (float) : (float) An optional parameter. Stop loss (requires a specific price). If it is specified, a stop order is placed to exit market position at the specified price (or worse). Priority of the parameter 'stop' is higher than priority of the parameter 'loss' ('stop' is used instead of 'loss', if its value is not 'NaN'). The default value is 'NaN'.
trail_price (float) : (float) An optional parameter. Trailing stop activation level (requires a specific price). If it is specified, a trailing stop order will be placed when the specified price level is reached. The offset (in ticks) to determine initial price of the trailing stop order is specified in the 'trail_offset' parameter: X ticks lower than activation level to exit long position; X ticks higher than activation level to exit short position. The default value is 'NaN'.
trail_points (float) : (float) An optional parameter. Trailing stop activation level (profit specified in ticks). If it is specified, a trailing stop order will be placed when the calculated price level (specified amount of profit) is reached. The offset (in ticks) to determine initial price of the trailing stop order is specified in the 'trail_offset' parameter: X ticks lower than activation level to exit long position; X ticks higher than activation level to exit short position. The default value is 'NaN'.
trail_offset (float) : (float) An optional parameter. Trailing stop price (specified in ticks). The offset in ticks to determine initial price of the trailing stop order: X ticks lower than 'trail_price' or 'trail_points' to exit long position; X ticks higher than 'trail_price' or 'trail_points' to exit short position. The default value is 'NaN'.
oca_name (string) : (string) An optional parameter. Name of the OCA group (oca_type = strategy.oca.reduce) the profit target, the stop loss / the trailing stop orders belong to. If the name is not specified, it will be generated automatically.
comment (string) : (string) Additional notes on the order. If specified, displays near the order marker on the chart. Optional. The default is na.
comment_profit (string) : (string) Additional notes on the order if the exit was triggered by crossing `profit` or `limit` specifically. If specified, supercedes the `comment` parameter and displays near the order marker on the chart. Optional. The default is na.
comment_loss (string) : (string) Additional notes on the order if the exit was triggered by crossing `stop` or `loss` specifically. If specified, supercedes the `comment` parameter and displays near the order marker on the chart. Optional. The default is na.
comment_trailing (string) : (string) Additional notes on the order if the exit was triggered by crossing `trail_offset` specifically. If specified, supercedes the `comment` parameter and displays near the order marker on the chart. Optional. The default is na.
alert_message (string) : (string) Text that will replace the '{{strategy.order.alert_message}}' placeholder when one is used in the "Message" field of the "Create Alert" dialog. Optional. The default is na.
alert_profit (string) : (string) Text that will replace the '{{strategy.order.alert_message}}' placeholder when one is used in the "Message" field of the "Create Alert" dialog. Only replaces the text if the exit was triggered by crossing `profit` or `limit` specifically. Optional. The default is na.
alert_loss (string) : (string) Text that will replace the '{{strategy.order.alert_message}}' placeholder when one is used in the "Message" field of the "Create Alert" dialog. Only replaces the text if the exit was triggered by crossing `stop` or `loss` specifically. Optional. The default is na.
alert_trailing (string) : (string) Text that will replace the '{{strategy.order.alert_message}}' placeholder when one is used in the "Message" field of the "Create Alert" dialog. Only replaces the text if the exit was triggered by crossing `trail_offset` specifically. Optional. The default is na.
when (bool) : (bool) An optional parmeter. Condition, deprecated.
Returns: (void)
percent_to_ticks(percent, from)
Converts a percentage of the supplied price or the average entry price to ticks.
Parameters:
percent (float) : (float) The percentage of supplied price to convert to ticks. 50 is 50% of the entry price.
from (float) : (float) A price that can be used to calculate from. Optional. The default value is `strategy.position_avg_price`.
Returns: (float) A value in ticks.
percent_to_price(percent, from)
Converts a percentage of the supplied price or the average entry price to a price.
Parameters:
percent (float) : (float) The percentage of the supplied price to convert to price. 50 is 50% of the supplied price.
from (float) : (float) A price that can be used to calculate from. Optional. The default value is `strategy.position_avg_price`.
Returns: (float) A value in the symbol's quote currency (USD for BTCUSD).
bot
Fields:
password (series__string)
start_time (series__integer)
end_time (series__integer)
leverage (series__integer)
initial_capital (series__float)
default_qty_type (series__string)
default_qty_value (series__float)
margin_mode (series__string)
contract_size (series__float)
kis_number (series__integer)
entry_percent (series__float)
close_percent (series__float)
exit_percent (series__float)
log_table (series__table)
fixed_qty (series__float)
fixed_cash (series__float)
real (series__bool)
auto_alert_message (series__bool)
hide_trade_line (series__bool)
ProfitView Strategy TemplateHello traders,
This script took me a full week of coding/testing, sweat, and tears - and I’m too nice as I’m giving it for free to the community.
If you're tired of manual trading and looking for a solid strategy template to pair with your indicators, look no further.
This Pine Script v5 strategy template is engineered for maximum customization and risk management.
Best part?
This Pine Script v5 template facilitates the dynamic construction of ProfitView alerts, sparing users the time and effort of mastering the ProfitView syntax and manually creating alert commands.
This powerful tool gives much power to those who don't know how to code in Pinescript and want to automate their indicators' signals via the ProfitView Chrome extension.
IMPORTANT NOTES
ProfitView is a trading bot software that forwards TradingView alerts to your brokers (examples: Binance, Oanda, Coinbase, Bybit, etc.) for automating trading.
Many traders don't know how to dynamically create ProfitView-compatible alerts using the data from their TradingView scripts.
Traders using trading bots want their alerts to reflect the stop-loss/take-profit/trailing-stop/stop-loss to break options from your script and then create the orders accordingly.
This script showcases how to create ProfitView alerts dynamically.
TRADINGVIEW ALERTS
1) You'll have to create one alert per asset X timeframe = 1 chart.
Example: 1 alert for EUR/USD on the 5 minutes chart, 1 alert for EUR/USD on the 15-minute chart (assuming you want your bot to trade the EUR/USD on the 5 and 15-minute timeframes)
2) Select the Order fills and alert() function calls condition
3) For each alert, the alert message is pre-configured with the text below
{{strategy.order.alert_message}}
Please leave it as it is.
It's a TradingView native variable that will fetch the alert text messages built by the script.
4) ProfitView doesn't use webhook technology, so setting a webhook URL from the alerts notifications tab is unnecessary.
KEY FEATURES
I) Modular Indicator Connection
* plug your existing indicator into the template.
* Only two lines of code are needed for full compatibility.
Step 1: Create your connector
Adapt your indicator with only 2 lines of code and then connect it to this strategy template.
To do so:
1) Find in your indicator where the conditions print the long/buy and short/sell signals.
2) Create an additional plot as below
I'm giving an example with a Two moving averages cross.
Please replicate the same methodology for your indicator, whether a MACD , ZigZag, Pivots , higher-highs, lower-lows or whatever indicator with clear buy and sell conditions.
//@version=5
indicator("Supertrend", overlay = true, timeframe = "", timeframe_gaps = true)
atrPeriod = input.int(10, "ATR Length", minval = 1)
factor = input.float(3.0, "Factor", minval = 0.01, step = 0.01)
= ta.supertrend(factor, atrPeriod)
supertrend := barstate.isfirst ? na : supertrend
bodyMiddle = plot(barstate.isfirst ? na : (open + close) / 2, display = display.none)
upTrend = plot(direction < 0 ? supertrend : na, "Up Trend", color = color.green, style = plot.style_linebr)
downTrend = plot(direction < 0 ? na : supertrend, "Down Trend", color = color.red, style = plot.style_linebr)
fill(bodyMiddle, upTrend, color.new(color.green, 90), fillgaps = false)
fill(bodyMiddle, downTrend, color.new(color.red, 90), fillgaps = false)
buy = ta.crossunder(direction, 0)
sell = ta.crossunder(direction, 0)
//////// CONNECTOR SECTION ////////
Signal = buy ? 1 : sell ? -1 : 0
plot(Signal, title = "Signal", display = display.data_window)
//////// CONNECTOR SECTION ////////
Important Notes
🔥 The Strategy Template expects the value to be exactly 1 for the bullish signal and -1 for the bearish signal
Now, you can connect your indicator to the Strategy Template using the method below or that one.
Step 2: Connect the connector
1) Add your updated indicator to a TradingView chart
2) Add the Strategy Template as well to the SAME chart
3) Open the Strategy Template settings, and in the Data Source field, select your 🔌Connector🔌 (which comes from your indicator)
Note it doesn’t have to be named 🔌Connector🔌 - you can name it as you want - however, I recommend an explicit name you can easily remember.
From then, you should start seeing the signals and plenty of other stuff on your chart.
🔥 Note that whenever you update your indicator values, the strategy statistics and visuals on your chart will update in real-time
II) BOT Risk Management:
- Max Drawdown:
Mode: Select whether the max drawdown is calculated in percentage (%) or USD.
Value: If the max drawdown reaches this specified value, set a value to halt the bot.
- Max Consecutive Days:
Use Max Consecutive Days BOT Halt: Enable/Disable halting the bot if the max consecutive losing days value is reached.
- Max Consecutive Days: Set the maximum number of consecutive losing days allowed before halting the bot.
- Max Losing Streak:
Use Max Losing Streak: Enable/Disable a feature to prevent the bot from taking too many losses in a row.
- Max Losing Streak Length: Set the maximum length of a losing streak allowed.
Margin Call:
- Use Margin Call: Enable/Disable a feature to exit when a specified percentage away from a margin call to prevent it.
Margin Call (%): Set the percentage value to trigger this feature.
- Close BOT Total Loss:
Use Close BOT Total Loss: Enable/Disable a feature to close all trades and halt the bot if the total loss is reached.
- Total Loss ($): Set the total loss value in USD to trigger this feature.
Intraday BOT Risk Management:
- Intraday Losses:
Use Intraday Losses BOT Halt: Enable/Disable halting the bot on reaching specified intraday losses.
Mode: Select whether the intraday loss is calculated in percentage (%) or USD.
- Max Intraday Losses (%): Set the value for maximum intraday losses.
Limit Intraday Trades:
- Use Limit Intraday Trades: Enable/Disable a feature to limit the number of intraday trades.
- Max Intraday Trades: Set the maximum number of intraday trades allowed.
Restart Intraday EA:
- Use Restart Intraday EA: Enable/Disable a feature to restart the bot at the first bar of the next day if it has been stopped with an intraday risk management safeguard.
III) Order Types and Position Sizing
- Choose between market, limit, or stop orders.
- Set your position size directly in the template.
Please use the position size from the “Inputs” and not the “Properties” tab.
I know it's redundant. - the template needs this value from the "Inputs" tab to build the alerts, and the Backtester needs it from the "Properties" tab.
IV) Advanced Take-Profit and Stop-Loss Options
- Choose to set your SL/TP in either pips or percentages.
- Option for multiple take-profit levels and trailing stop losses.
- Move your stop loss to break even +/- offset in pips for “risk-free” trades.
V) Miscellaneous
Retry order openings if they fail.
Order Types:
Select and specify order type and price settings.
Position Size:
Define the type and size of positions.
Leverage:
Leverage settings, including margin type and hedge mode.
Session:
Limit trades to specific sessions.
Dates:
Limit trades to a specific date range.
Trades Direction:
Direction: Specify the market direction for opening positions.
VI) Notifications (Telegram/Discord/Email/IFTTT/Twilio/SMS)
Customize notifications sent to Telegram, Discord, Email, IFTTT, Twilio, and ProfitView Logger.
VII) Logger
The ProfitView commands are logged in the TradingView logger.
You'll find more information about it in this TradingView blog post .
WHY YOU MIGHT NEED THIS TEMPLATE
1) Transform your indicator into a ProfitView trading bot more easily than before
Connect your indicator to the template
Create your alerts
Set your EA settings
2) Save Time
Auto-generated alert messages for ProfitView.
I tested them all and checked with the support team what could/couldn’t be done.
3) Be in Control
Manage your trading risks with advanced features.
4) Customizable
Fits various trading styles and asset classes.
REQUIREMENTS
* Make sure you have your ProfitView account and do the settings correctly in your Chrome extension. If you don't know how to do it, read the documentation + ask for help in the ProfitView Discord support channel.
* If there is any issue with the template, ask me in the comments section - I’ll answer quickly.
BACKTEST RESULTS FROM THIS POST
1) I connected this strategy template to a dummy Supertrend script.
I could have selected any other indicator or concept for this script post.
I wanted to share an example of how you can quickly upgrade your strategy, making it compatible with ProfitView.
2) The backtest results aren't relevant for this educational script publication.
I used realistic backtesting data but didn't look too much into optimizing the results, as this isn't the point of why I'm publishing this script.
This strategy is a template to be connected to any indicator - the sky is the limit. :)
3) This template is made to take 1 trade per direction at any given time.
Pyramiding is set to 1 on TradingView.
The strategy default settings are:
* Initial Capital: 100000 USD
* Position Size: 1%
* Commission Percent: 0.075%
* Slippage: 1 tick
* No margin/leverage used
Best regards,
Dave
TradingView.To Strategy Template (with Dyanmic Alerts)Hello traders,
If you're tired of manual trading and looking for a solid strategy template to pair with your indicators, look no further.
This Pine Script v5 strategy template is engineered for maximum customization and risk management.
Best part?
This Pine Script v5 template facilitates the dynamic construction of TradingView.TO alerts, sparing users the time and effort of mastering the TradingView.TO syntax and manually create alert commands.
This powerful tool gives much power to those who don't know how to code in Pinescript and want to automate their indicators' signals via TradingView.TO bot.
IMPORTANT NOTES
TradingView.TO is a trading bot software that forwards TradingView alerts to your brokers (examples: Binance, Oanda, Coinbase, Bybit, Metatrader 4/5, ...) for automating trading.
Many traders don't know how to create TradingView.TO dynamically-compatible alerts using the data from their TradingView scripts.
Traders using trading bots want their alerts to reflect the stop-loss/take-profit/trailing-stop/stop-loss to break options from your script and then create the orders accordingly.
This script showcases how to create TradingView.TO alerts dynamically.
TRADINGVIEW ALERTS
1) You'll have to create one alert per asset X timeframe = 1 chart.
Example: 1 alert for BTC/USDT on the 5 minutes chart, 1 alert for BTC/USDT on the 15-minute chart (assuming you want your bot to trade the BTC/USDT on the 5 and 15-minute timeframes)
2) Select the Order fills and alert() function calls condition
3) For each alert, the alert message is pre-configured with the text below
{{strategy.order.alert_message}}
Please leave it as it is.
It's a TradingView native variable that will fetch the alert text messages built by the script.
4) TradingView.TO uses webhook technology - setting a webhook URL from the alerts notifications tab is required.
KEY FEATURES
I) Modular Indicator Connection
* plug your existing indicator into the template.
* Only two lines of code are needed for full compatibility.
Step 1: Create your connector
Adapt your indicator with only 2 lines of code and then connect it to this strategy template.
To do so:
1) Find in your indicator where the conditions print the long/buy and short/sell signals.
2) Create an additional plot as below
I'm giving an example with a Two moving averages cross.
Please replicate the same methodology for your indicator, whether a MACD , ZigZag, Pivots , higher-highs, lower-lows or whatever indicator with clear buy and sell conditions.
//@version=5
indicator("Supertrend", overlay = true, timeframe = "", timeframe_gaps = true)
atrPeriod = input.int(10, "ATR Length", minval = 1)
factor = input.float(3.0, "Factor", minval = 0.01, step = 0.01)
= ta.supertrend(factor, atrPeriod)
supertrend := barstate.isfirst ? na : supertrend
bodyMiddle = plot(barstate.isfirst ? na : (open + close) / 2, display = display.none)
upTrend = plot(direction < 0 ? supertrend : na, "Up Trend", color = color.green, style = plot.style_linebr)
downTrend = plot(direction < 0 ? na : supertrend, "Down Trend", color = color.red, style = plot.style_linebr)
fill(bodyMiddle, upTrend, color.new(color.green, 90), fillgaps = false)
fill(bodyMiddle, downTrend, color.new(color.red, 90), fillgaps = false)
buy = ta.crossunder(direction, 0)
sell = ta.crossunder(direction, 0)
//////// CONNECTOR SECTION ////////
Signal = buy ? 1 : sell ? -1 : 0
plot(Signal, title = "Signal", display = display.data_window)
//////// CONNECTOR SECTION ////////
Important Notes
🔥 The Strategy Template expects the value to be exactly 1 for the bullish signal and -1 for the bearish signal
Now, you can connect your indicator to the Strategy Template using the method below or that one.
Step 2: Connect the connector
1) Add your updated indicator to a TradingView chart
2) Add the Strategy Template as well to the SAME chart
3) Open the Strategy Template settings, and in the Data Source field, select your 🔌Connector🔌 (which comes from your indicator)
Note it doesn’t have to be named 🔌Connector🔌 - you can name it as you want - however, I recommend an explicit name you can easily remember.
From then, you should start seeing the signals and plenty of other stuff on your chart.
🔥 Note that whenever you update your indicator values, the strategy statistics and visuals on your chart will update in real-time
II) BOT Risk Management:
- Max Drawdown:
Mode: Select whether the max drawdown is calculated in percentage (%) or USD.
Value: If the max drawdown reaches this specified value, set a value to halt the bot.
- Max Consecutive Days:
Use Max Consecutive Days BOT Halt: Enable/Disable halting the bot if the max consecutive losing days value is reached.
- Max Consecutive Days: Set the maximum number of consecutive losing days allowed before halting the bot.
- Max Losing Streak:
Use Max Losing Streak: Enable/Disable a feature to prevent the bot from taking too many losses in a row.
- Max Losing Streak Length: Set the maximum length of a losing streak allowed.
Margin Call:
- Use Margin Call: Enable/Disable a feature to exit when a specified percentage away from a margin call to prevent it.
Margin Call (%): Set the percentage value to trigger this feature.
- Close BOT Total Loss:
Use Close BOT Total Loss: Enable/Disable a feature to close all trades and halt the bot if the total loss is reached.
- Total Loss ($): Set the total loss value in USD to trigger this feature.
Intraday BOT Risk Management:
- Intraday Losses:
Use Intraday Losses BOT Halt: Enable/Disable halting the bot on reaching specified intraday losses.
Mode: Select whether the intraday loss is calculated in percentage (%) or USD.
- Max Intraday Losses (%): Set the value for maximum intraday losses.
Limit Intraday Trades:
- Use Limit Intraday Trades: Enable/Disable a feature to limit the number of intraday trades.
- Max Intraday Trades: Set the maximum number of intraday trades allowed.
Restart Intraday EA:
III) Order Types and Position Sizing
- Choose between market or limit orders.
- Set your position size directly in the template.
Please use the position size from the “Inputs” and not the “Properties” tab.
I know it's redundant. - the template needs this value from the "Inputs" tab to build the alerts, and the Backtester needs it from the "Properties" tab.
IV) Advanced Take-Profit and Stop-Loss Options
- Choose to set your SL/TP in either USD or percentages.
- Option for multiple take-profit levels and trailing stop losses.
- Move your stop loss to break even +/- offset in USD for “risk-free” trades.
V) Miscellaneous:
Retry order openings if they fail.
Order Types:
Select and specify order type and price settings.
Position Size:
Define the type and size of positions.
Leverage:
Leverage settings, including margin type and hedge mode.
Session:
Limit trades to specific sessions.
Dates:
Limit trades to a specific date range.
Trades Direction:
Direction: Specify the market direction for opening positions.
VI) Logger
The TradingView.TO commands are logged in the TradingView logger.
You'll find more information about it in this TradingView blog post .
WHY YOU MIGHT NEED THIS TEMPLATE
1) Transform your indicator into a TradingView.TO trading bot more easily than before
Connect your indicator to the template
Create your alerts
Set your EA settings
2) Save Time
Auto-generated alert messages for TradingView.TO.
I tested them all and checked with the support team what could/couldn’t be done.
3) Be in Control
Manage your trading risks with advanced features.
4) Customizable
Fits various trading styles and asset classes.
REQUIREMENTS
* Make sure you have your TradingView.TO account
* If there is any issue with the template, ask me in the comments section - I’ll answer quickly.
BACKTEST RESULTS FROM THIS POST
1) I connected this strategy template to a dummy Supertrend script.
I could have selected any other indicator or concept for this script post.
I wanted to share an example of how you can quickly upgrade your strategy, making it compatible with TradingView.TO.
2) The backtest results aren't relevant for this educational script publication.
I used realistic backtesting data but didn't look too much into optimizing the results, as this isn't the point of why I'm publishing this script.
This strategy is a template to be connected to any indicator - the sky is the limit. :)
3) This template is made to take 1 trade per direction at any given time.
Pyramiding is set to 1 on TradingView.
The strategy default settings are:
* Initial Capital: 100000 USD
* Position Size: 1%
* Commission Percent: 0.075%
* Slippage: 1 tick
* No margin/leverage used