PineConnectorLibrary "PineConnector"
This library is a comprehensive alert webhook text generator for PineConnector. It contains every possible alert syntax variation from the documentation, along with some debugging functions.
To use it, just import the library (eg. "import ZenAndTheArtOfTrading/PineConnector/1 as pc") and use pc.buy(licenseID) to send an alert off to PineConnector - assuming all your webhooks etc are set up correctly.
View the PineConnector documentation for more information on how to send the commands you're looking to send (all of this library's function names match the documentation).
all()
Usage: pc.buy(pc_id, freq=pc.all())
Returns: "all"
once_per_bar()
Usage: pc.buy(pc_id, freq=pc.once_per_bar())
Returns: "once_per_bar"
once_per_bar_close()
Usage: pc.buy(pc_id, freq=pc.once_per_bar_close())
Returns: "once_per_bar_close"
na0(value)
Checks if given value is either 'na' or 0. Useful for streamlining scripts with float user setting inputs which default values to 0 since na is unavailable as a user input default.
Parameters:
value (float) : The value to check
Returns: True if the given value is 0 or na
getDecimals()
Calculates how many decimals are on the quote price of the current market.
Returns: The current decimal places on the market quote price
truncate(number, decimals)
Truncates the given number. Required params: mumber.
Parameters:
number (float) : Number to truncate
decimals (int) : Decimal places to cut down to
Returns: The input number, but as a string truncated to X decimals
getPipSize(multiplier)
Calculates the pip size of the current market.
Parameters:
multiplier (int) : The mintick point multiplier (1 by default, 10 for FX/Crypto/CFD but can be used to override when certain markets require)
Returns: The pip size for the current market
toWhole(number)
Converts pips into whole numbers. Required params: number.
Parameters:
number (float) : The pip number to convert into a whole number
Returns: The converted number
toPips(number)
Converts whole numbers back into pips. Required params: number.
Parameters:
number (float) : The whole number to convert into pips
Returns: The converted number
debug(txt, tooltip, displayLabel)
Prints to console and generates a debug label with the given text. Required params: txt.
Parameters:
txt (string) : Text to display
tooltip (string) : Tooltip to display (optional)
displayLabel (bool) : Turns on/off chart label (default: off)
Returns: Nothing
order(licenseID, command, symbol, parameters, accfilter, comment, secret, freq, debug)
Generates an alert string. Required params: licenseID, command.
Parameters:
licenseID (string) : Your PC license ID
command (string) : Command to send
symbol (string) : The symbol to trigger this order on
parameters (string) : Other optional parameters to include
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: An alert string with valid PC syntax based on supplied parameters
market_order(licenseID, buy, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Generates a market entry alert with relevant syntax commands. Required params: licenseID, buy, risk.
Parameters:
licenseID (string) : Your PC license ID
buy (bool) : true=buy/long, false=sell/short
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A market order alert string with valid PC syntax based on supplied parameters
buy(licenseID, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Generates a market buy alert with relevant syntax commands. Required params: licenseID, risk.
Parameters:
licenseID (string) : Your PC license ID
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A market order alert string with valid PC syntax based on supplied parameters
sell(licenseID, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Generates a market sell alert with relevant syntax commands. Required params: licenseID, risk.
Parameters:
licenseID (string) : Your PC license ID
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A market order alert string with valid PC syntax based on supplied parameters
closeall(licenseID, comment, secret, freq, debug)
Closes all open trades at market regardless of symbol. Required params: licenseID.
Parameters:
licenseID (string) : Your PC license ID
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
closealleaoff(licenseID, comment, secret, freq, debug)
Closes all open trades at market regardless of symbol, and turns the EA off. Required params: licenseID.
Parameters:
licenseID (string) : Your PC license ID
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
closelong(licenseID, symbol, comment, secret, freq, debug)
Closes all long trades at market for the given symbol. Required params: licenseID.
Parameters:
licenseID (string) : Your PC license ID
symbol (string) : Symbol to act on (defaults to current symbol)
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
closeshort(licenseID, symbol, comment, secret, freq, debug)
Closes all open short trades at market for the given symbol. Required params: licenseID.
Parameters:
licenseID (string) : Your PC license ID
symbol (string) : Symbol to act on (defaults to current symbol)
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
closelongshort(licenseID, symbol, comment, secret, freq, debug)
Closes all open trades at market for the given symbol. Required params: licenseID.
Parameters:
licenseID (string) : Your PC license ID
symbol (string) : Symbol to act on (defaults to current symbol)
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
closelongbuy(licenseID, risk, symbol, comment, secret, freq, debug)
Close all long positions and open a new long at market for the given symbol with given risk/contracts. Required params: licenseID.
Parameters:
licenseID (string) : Your PC license ID
risk (float) : Risk or contracts (according to EA settings)
symbol (string) : Symbol to act on (defaults to current symbol)
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
closeshortsell(licenseID, risk, symbol, comment, secret, freq, debug)
Close all short positions and open a new short at market for the given symbol with given risk/contracts. Required params: licenseID, risk.
Parameters:
licenseID (string) : Your PC license ID
risk (float) : Risk or contracts (according to EA settings)
symbol (string) : Symbol to act on (defaults to current symbol)
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
newsltplong(licenseID, sl, tp, symbol, accfilter, comment, secret, freq, debug)
Updates the stop loss and/or take profit of any open long trades on the given symbol with the given values. Required params: licenseID, sl and/or tp.
Parameters:
licenseID (string) : Your PC license ID
sl (float) : Stop loss pips or price (according to EA settings)
tp (float) : Take profit pips or price (according to EA settings)
symbol (string) : Symbol to act on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
newsltpshort(licenseID, sl, tp, symbol, accfilter, comment, secret, freq, debug)
Updates the stop loss and/or take profit of any open short trades on the given symbol with the given values. Required params: licenseID, sl and/or tp.
Parameters:
licenseID (string) : Your PC license ID
sl (float) : Stop loss pips or price (according to EA settings)
tp (float) : Take profit pips or price (according to EA settings)
symbol (string) : Symbol to act on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
closelongpct(licenseID, symbol, comment, secret, freq, debug)
Close a percentage of open long positions (according to EA settings). Required params: licenseID.
Parameters:
licenseID (string) : Your PC license ID
symbol (string) : Symbol to act on (defaults to current symbol)
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
closeshortpct(licenseID, symbol, comment, secret, freq, debug)
Close a percentage of open short positions (according to EA settings). Required params: licenseID.
Parameters:
licenseID (string) : Your PC license ID
symbol (string) : Symbol to act on (defaults to current symbol)
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
closelongvol(licenseID, risk, symbol, comment, secret, freq, debug)
Close all open long contracts on the current symbol until the given risk value is remaining. Required params: licenseID, risk.
Parameters:
licenseID (string) : Your PC license ID
risk (float) : The quantity to leave remaining
symbol (string) : Symbol to act on (defaults to current symbol)
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
closeshortvol(licenseID, risk, symbol, comment, secret, freq, debug)
Close all open short contracts on the current symbol until the given risk value is remaining. Required params: licenseID, risk.
Parameters:
licenseID (string) : Your PC license ID
risk (float) : The quantity to leave remaining
symbol (string) : Symbol to act on (defaults to current symbol)
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
limit_order(licenseID, buy, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Generates a limit order alert with relevant syntax commands. Required params: licenseID, buy, price, risk.
Parameters:
licenseID (string) : Your PC license ID
buy (bool) : true=buy/long, false=sell/short
price (float) : Price or pips to set limit order (according to EA settings)
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A limit order alert string with valid PC syntax based on supplied parameters
buylimit(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Generates a buylimit order alert with relevant syntax commands. Required params: licenseID, price, risk.
Parameters:
licenseID (string) : Your PC license ID
price (float) : Price or pips to set limit order (according to EA settings)
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A limit order alert string with valid PC syntax based on supplied parameters
selllimit(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Generates a selllimit order alert with relevant syntax commands. Required params: licenseID, price, risk.
Parameters:
licenseID (string) : Your PC license ID
price (float) : Price or pips to set limit order (according to EA settings)
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A limit order alert string with valid PC syntax based on supplied parameters
stop_order(licenseID, buy, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Generates a stop order alert with relevant syntax commands. Required params: licenseID, buy, price, risk.
Parameters:
licenseID (string) : Your PC license ID
buy (bool) : true=buy/long, false=sell/short
price (float) : Price or pips to set limit order (according to EA settings)
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A stop order alert string with valid PC syntax based on supplied parameters
buystop(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Generates a buystop order alert with relevant syntax commands. Required params: licenseID, price, risk.
Parameters:
licenseID (string) : Your PC license ID
price (float) : Price or pips to set limit order (according to EA settings)
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A stop order alert string with valid PC syntax based on supplied parameters
sellstop(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Generates a sellstop order alert with relevant syntax commands. Required params: licenseID, price, risk.
Parameters:
licenseID (string) : Your PC license ID
price (float) : Price or pips to set limit order (according to EA settings)
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A stop order alert string with valid PC syntax based on supplied parameters
cancel_neworder(licenseID, order, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Cancel + place new order template function.
Parameters:
licenseID (string) : Your PC license ID
order (string) : Cancel order type
price (float) : Price or pips to set limit order (according to EA settings)
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A stop order alert string with valid PC syntax based on supplied parameters
cancellongbuystop(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Cancels all long orders with the specified symbol and places a new buystop order. Required params: licenseID, price, risk.
Parameters:
licenseID (string) : Your PC license ID
price (float) : Price or pips to set limit order (according to EA settings)
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A stop order alert string with valid PC syntax based on supplied parameters
cancellongbuylimit(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Cancels all long orders with the specified symbol and places a new buylimit order. Required params: licenseID, price, risk.
Parameters:
licenseID (string) : Your PC license ID
price (float) : Price or pips to set limit order (according to EA settings)
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A stop order alert string with valid PC syntax based on supplied parameters
cancelshortsellstop(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Cancels all short orders with the specified symbol and places a sellstop order. Required params: licenseID, price, risk.
Parameters:
licenseID (string) : Your PC license ID
price (float) : Price or pips to set limit order (according to EA settings)
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A stop order alert string with valid PC syntax based on supplied parameters
cancelshortselllimit(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug)
Cancels all short orders with the specified symbol and places a selllimit order. Required params: licenseID, price, risk.
Parameters:
licenseID (string) : Your PC license ID
price (float) : Price or pips to set limit order (according to EA settings)
risk (float) : Risk quantity (according to EA settings)
sl (float) : Stop loss distance in pips or price
tp (float) : Take profit distance in pips or price
betrigger (float) : Breakeven will be activated after the position gains this number of pips
beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
traildist (float) : Distance of the trailing stop-loss from current price
trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
atrperiod (int) : ATR averaging period
atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
symbol (string) : The symbol to trigger this order on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment (maximum 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A stop order alert string with valid PC syntax based on supplied parameters
cancellong(licenseID, symbol, accfilter, comment, secret, freq, debug)
Cancels all pending long orders with the specified symbol. Required params: licenseID.
Parameters:
licenseID (string) : Your PC license ID
symbol (string) : Symbol to act on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A cancel long alert command
cancelshort(licenseID, symbol, accfilter, comment, secret, freq, debug)
Cancels all pending short orders with the specified symbol. Required params: licenseID.
Parameters:
licenseID (string) : Your PC license ID
symbol (string) : Symbol to act on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: A cancel short alert command
newsltpbuystop(licenseID, sl, tp, symbol, accfilter, comment, secret, freq, debug)
Updates the stop loss and/or take profit of any pending buy stop orders on the given symbol. Required params: licenseID, sl and/or tp.
Parameters:
licenseID (string) : Your PC license ID
sl (float) : Stop loss pips or price (according to EA settings)
tp (float) : Take profit pips or price (according to EA settings)
symbol (string) : Symbol to act on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
newsltpbuylimit(licenseID, sl, tp, symbol, accfilter, comment, secret, freq, debug)
Updates the stop loss and/or take profit of any pending buy limit orders on the given symbol. Required params: licenseID, sl and/or tp.
Parameters:
licenseID (string) : Your PC license ID
sl (float) : Stop loss pips or price (according to EA settings)
tp (float) : Take profit pips or price (according to EA settings)
symbol (string) : Symbol to act on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
newsltpsellstop(licenseID, sl, tp, symbol, accfilter, comment, secret, freq, debug)
Updates the stop loss and/or take profit of any pending sell stop orders on the given symbol. Required params: licenseID, sl and/or tp.
Parameters:
licenseID (string) : Your PC license ID
sl (float) : Stop loss pips or price (according to EA settings)
tp (float) : Take profit pips or price (according to EA settings)
symbol (string) : Symbol to act on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
newsltpselllimit(licenseID, sl, tp, symbol, accfilter, comment, secret, freq, debug)
Updates the stop loss and/or take profit of any pending sell limit orders on the given symbol. Required params: licenseID, sl and/or tp.
Parameters:
licenseID (string) : Your PC license ID
sl (float) : Stop loss pips or price (according to EA settings)
tp (float) : Take profit pips or price (according to EA settings)
symbol (string) : Symbol to act on (defaults to current symbol)
accfilter (float) : Optional minimum account balance filter
comment (string) : Optional comment to include (max 20 characters)
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
eaoff(licenseID, secret, freq, debug)
Turns the EA off. Required params: licenseID.
Parameters:
licenseID (string) : Your PC license ID
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
eaon(licenseID, secret, freq, debug)
Turns the EA on. Required params: licenseID.
Parameters:
licenseID (string) : Your PC license ID
secret (string) : Optional secret key (must be enabled in dashboard)
freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
debug (bool) : Turns on/off debug label
Returns: The required alert syntax as a string
Tradingbot
Gauss KenJi Robot
Gauss KenJi Trading Robot: Precision and Automation for Traders
The Gauss KenJi robot is a cutting-edge trading solution designed for experienced traders seeking to enhance their decision-making through advanced statistical models and automation. Unlike traditional trading tools that rely on generic indicators prone to false signals, the Gauss KenJi robot offers an innovative approach by utilizing two unique indicators: the Kenji Indicator v.2.0 and the Gauss Indicator .
Kenji Indicator v.2.0
Traditional moving averages and related indicators often fail in flat market conditions, where frequent crossovers lead to confusing signals and false trends. The Kenji Indicator addresses this issue by using a combination of correlation analysis and moving averages to more accurately identify the market’s state. This real-time insight allows for better navigation of local trends, reducing noise and increasing the precision of trade signals.
Gauss Indicator
The Gauss Indicator brings the power of statistical analysis into trading by applying the 3 sigmas rule. It calculates and predicts the likely price ranges for specific time frames (hourly, daily, weekly) with probabilities of 68%, 95%, and 99%. This offers traders an actionable framework for setting stop-loss, take-profit, and identifying key support and resistance levels. By providing a clearer view of potential price movements, the Gauss Indicator improves decision-making, ensuring that traders enter and exit the market at optimal points.
Gauss KenJi Robot: How it Works
The Gauss KenJi robot operates on a statistical algorithm based on the Gaussian function, which uses market volatility as a core indicator of price movements. The robot opens positions in the direction of the trend when the price reaches the predetermined Gauss border. Position sizes are calculated according to the “Initial_lot” parameter, with stop-loss and take-profit levels defined by the “Pips” parameter. Trades are automatically closed either when profit targets or stop-loss limits are reached, or if local trend reversals are detected by the Kenji Indicator.
This highly adaptable algorithm can be applied to any asset class (stocks, forex, crypto, commodities) and any time frame, providing traders with a versatile tool to navigate various markets.
Why Gauss KenJi is Essential for Traders
1. Time Efficiency: The robot operates autonomously, allowing traders to step away from constant chart monitoring while still capitalizing on market movements.
2. Profit Maximization: By leveraging machine learning and advanced statistical models, the robot identifies opportunities faster than human traders, ensuring more profitable trades.
3. Risk Management: The robot strictly adheres to predefined rules, helping traders minimize losses and protect their capital in volatile market conditions.
4. Cross-market Versatility: Whether you’re trading forex, stocks, crypto, or commodities, Gauss KenJi adapts to different markets and time frames, making it a versatile tool for professional traders.
The Gauss KenJi robot is a comprehensive, scientifically driven trading solution designed to eliminate common pitfalls associated with traditional indicators. Its combination of the Kenji Indicator’s trend identification and the Gauss Indicator’s price prediction capabilities makes it an indispensable tool for traders looking to enhance both the precision of their trades and the automation of their strategies. Whether you are aiming for consistent daily profits or optimizing long-term trading strategies, Gauss KenJi offers the efficiency and accuracy required to stay ahead in today’s competitive markets.
Session Breakout Scalper Trading BotHi Traders !
Introduction:
I have recently been exploring the world of automated algorithmic trading (as I prefer more objective trading strategies over subjective technical analysis (TA)) and would like to share one of my automation compatible (PineConnecter compatible) scripts “Session Breakout Scalper”.
The strategy is really simple and is based on time conditional breakouts although has more ”relatively” advanced optional features such as the regime indicators (Regime Filters) that attempt to filter out noise by adding more confluence states and the ATR multiple SL that takes into account volatility to mitigate the down side risk of the trade.
What is Algorthmic Trading:
Firstly what is algorithmic trading? Algorithmic trading also known as algo-trading, is a method of using computer programs (in this case pine script) to execute trades based on predetermined rules and instructions (this trading strategy). It's like having a robot trader who follows a strict set of commands to buy and sell assets automatically, without any human intervention.
Important Note:
For Algorithmic trading the strategy will require you having an essential TV subscription at the minimum (so that you can set alerts) plus a PineConnecter subscription (scroll down to the .”How does the strategy send signals” headings to read more)
The Strategy Explained:
Is the Time input true ? (this can be changed by toggling times under the “TRADE MEDIAN TIMES” group for user inputs).
Given the above is true the strategy waits x bars after the session and then calculates the highest high (HH) to lowest low (LL) range. For this box to form, the user defined amount of bars must print after the session. The box is symmetrical meaning the HH and LL are calculated over a lookback that is equal to the sum of user defined bars before and after the session (+ 1).
The Strategy then simultaneously defines the HH as the buy level (green line) and the LL as the sell level (red line). note the strategy will set stop orders at these levels respectively.
Enter a buy if price action crosses above the HH, and then cancel the sell order type (The opposite is true for a stop order).
If the momentum based regime filters are true the strategy will check for the regime / regimes to be true, if the regime if false the strategy will exit the current trade, as the regime filter has predicted a slowing / reversal of momentum.
The image below shows the strategy executing these trading rules ( Regime filters, "Trades on chart", "Signal & Label" and "Quantity" have been omitted. "Strategy label plots" has been switched to true)
Other Strategy Rules:
If a new session (time session which is user defined) is true (blue vertical line) and the strategy is currently still in a trade it will exit that trade immediately.
It is possible to also set a range of percentage gain per day that the strategy will try to acquire, if at any point the strategy’s profit is within the percentage range then the position / trade will be exited immediately (This can be changed in the “PERCENT DAY GAIN” group for user inputs)
Stops and Targets:
The strategy has either static (fixed) or variable SL options. TP however is only static. The “STRAT TP & TP” group of user inputs is responsible for the SL and TP values (quoted in pips). Note once the ATR stop is set to true the SL values in the above group no longer have any affect on the SL as expected.
What are the Regime Filters:
The Larry Williams Large Trade Index (LWLTI): The Larry Williams Large Trade Index (LWTI) is a momentum-based technical indicator developed by iconic trader Larry Williams. It identifies potential entries and exits for trades by gauging market sentiment, particularly the buying and selling pressure from large market players. Here's a breakdown of the LWTI:
LWLTI components and their interpretation:
Oscillator: It oscillates between 0 and 100, with 50 acting as the neutral line.
Sentiment Meter: Values above 75 suggest a bearish market dominated by large selling, while readings below 25 indicate a bullish market with strong buying from large players.
Trend Confirmation: Crossing above 75 during an uptrend and below 25 during a downtrend confirms the trend's continuation.
The Andean Oscillator (AO) : The Andean Oscillator is a trend and momentum based indicator designed to measure the degree of variations within individual uptrends and downtrends in the prices.
Regime Filter States:
In trading, a regime filter is a tool used to identify the current state or "regime" of the market.
These Regime filters are integrated within the trading strategy to attempt to lower risk (equity volatility and/or draw down). The regime filters have different states for each market order type (buy and sell). When the regime filters are set to true, if these regime states fail to be true the trade is exited immediately.
For Buy Trades:
LWLTI positive momentum state: Quotient of the lagged trailing difference and the ATR > 50
AO positive momentum state: Bull line > Bear line (signal line is omitted)
For Sell Trades:
LWLTI negative momentum stat: Quotient of the lagged trailing difference and the ATR < 50
AO negative momentum state: Bull line < Bear line (signal line is omitted)
How does the Strategy Send Signals:
The strategy triggers a TV alert (you will neet to set a alert first), TV then sends a HTTP request to the automation software (PineConnecter) which receives the request and then communicates to an MT4/5 EA to automate the trading strategy.
For the strategy to send signals you must have the following
At least a TV essential subscription
This Script added to your chart
A PineConnecter account, which is paid and not free. This will provide you with the expert advisor that executes trades based on these strategies signals.
For more detailed information on the automation process I would recommend you read the PineConnecter documentation and FAQ page.
Dashboard:
This Dashboard (top right by defualt) lists some simple trading statistics and also shows when a trade is live.
Important Notice:
- USE THIS STRATEGY AT YOUR OWN RISK AND ALWAYS DO YOUR OWN RESEARCH & MANUAL BACKTESTING !
- THE STRATEGY WILL NOT EXHIBIT THE BACKTEST PERFORMANCE SEEN BELOW IN ALL MARKETS !
DCA-Integrated Trend Continuation StrategyIntroducing the DCA-Integrated Trend Continuation Strategy 💼💰
The DCA-Integrated Trend Continuation Strategy represents a robust trading methodology that harnesses the potential of trend continuation opportunities while seamlessly incorporating the principles of Dollar Cost Averaging (DCA) as a risk management and backup mechanism. This strategy harmoniously blends these two concepts to potentially amplify profitability and optimize risk control across diverse market conditions.
This strategy is well-suited for both trending and ranging markets. During trending markets, it aims to capture and ride the momentum of the trend while optimizing entry points. In ranging markets or pullbacks, the DCA feature comes into play, allowing users to accumulate more assets at potentially lower prices and potentially increase profits when the market resumes its upward trend. This cohesive approach not only enhances the overall effectiveness of the strategy but also fosters a more resilient and adaptable trading approach in ever-changing market dynamics.
💎 How it Works:
▶️ The strategy incorporates a customizable entry signal based on candlestick patterns, enabling the identification of potential trend continuation opportunities. By focusing on consecutive bullish candles, it detects the presence of bullish momentum, indicating an optimal time to enter a long position.
To refine the precision of the signals, traders can set a specific percentage threshold for the closing price of the candle, ensuring it is above a certain percentage of its body. This condition verifies strong bullish momentum and confirms significant upward movement within the candle, thereby increasing the reliability of the signal.
In addition, the strategy offers further confirmation by examining the relationship between the closing price of the signal candle and its previous candles. If the closing price of the signal candle is higher than its preceding candles, it provides an additional layer of assurance before entering a position. This approach is particularly effective in detecting sharp movements and capturing significant price shifts, as it focuses on identifying instances where the closing price shows clear strength and outperforms the previous candle's price action. By prioritizing such occurrences, the strategy aims to capture robust trends and capitalize on notable market movements.
▶️ During market downturns, the strategy incorporates intelligent management of price drops, offering flexibility through fixed or customizable price drop percentages. This unique feature allows for additional entries at specified drop percentages, enabling traders to accumulate positions at more favorable prices.
By strategically adjusting the custom price drop percentages, you can optimize your entry points to potentially maximize profitability. Utilizing lower percentages for initial entries takes advantage of price fluctuations, potentially yielding higher returns. On the other hand, employing higher percentages for final entries adopts a more cautious approach during significant market downturns, emphasizing enhanced risk management. This adaptive approach ensures that the strategy effectively navigates challenging market conditions while seeking to optimize overall performance.
▶️ To enhance performance and mitigate risks, the strategy integrates average purchase price management. This feature dynamically adjusts the average buy price percentage decrease after each price drop, expediting the achievement of the target point even in challenging market conditions. By reducing recovery times and ensuring investment safety, this strategy optimizes outcomes for traders.
▶️ Risk management is at the core of this strategy, prioritizing the protection of capital. It incorporates an account balance validation mechanism that conducts automatic checks prior to each entry, ensuring alignment with available funds. This essential feature provides real-time insights into the affordability of price drops and the number of entries, enabling traders to make informed decisions and maintain optimal risk control.
▶️ Furthermore, the strategy offers take profit options, allowing traders to secure gains by setting fixed percentage profits from the average buy price or using a trailing target. Stop loss protection is also available, enabling traders to set a fixed percentage from the average purchase price to limit potential losses and preserve capital.
▶️ This strategy is fully compatible with third-party trading bots, allowing for easy connectivity to popular trading platforms. By leveraging the TradingView webhook functionality, you can effortlessly link the strategy to your preferred bot and receive accurate signals for position entry and exit. The strategy provides all the necessary alert message fields, ensuring a smooth and user-friendly trading experience. With this integration, you can automate the execution of trades, saving time and effort while enjoying the benefits of this powerful strategy.
🚀 How to Use:
To effectively utilize the DCA-Integrated Trend Continuation Strategy, follow these steps:
1. Choose your preferred DCA Mode - whether by quantity or by value - to determine how you want to size your positions.
2. Customize the entry conditions of the strategy to align with your trading preferences. Specify the number of consecutive bullish candles, set a desired percentage threshold for the close of the signal candle relative to its body, and determine the number of previous candles to compare with.
3. Adjust the pyramiding parameter to suit your risk tolerance and desired returns. Whether you prefer a more conservative approach with fewer pyramids or a more aggressive stance with multiple pyramids, this strategy offers flexibility.
4. Personalize the price drop percentages based on your risk appetite and trading strategy. Choose between fixed or custom percentages to optimize your entries in different market scenarios.
5. Configure the average purchase price management settings to control the percentage decrease in the average buy price after each price drop, ensuring it aligns with your risk tolerance and strategy.
6. Utilize the account balance validation feature to ensure the strategy's actions align with your available funds, enhancing risk management and preventing overexposure.
7. Set take profit options to secure your gains and implement stop loss protection to limit potential losses, providing an additional layer of risk management.
8. Use the date and time filtering feature to define the duration during which the strategy operates, allowing for specific backtesting periods or integration with a trading bot.
9. For automated trading, take advantage of the compatibility with third-party trading bots to seamlessly integrate the strategy with popular trading platforms.
By following these steps, traders can harness the power of the DCA-Integrated Trend Continuation Strategy to potentially maximize profitability and optimize their trading outcomes in both trending and ranging markets.
⚙️ User Settings:
To ensure the backtest result is representative of real-world trading conditions, particularly in the highly volatile Crypto market, the default strategy parameters have been carefully selected to produce realistic results with a conservative approach. However, you have the flexibility to customize these settings based on your risk tolerance and strategy preferences, whether you're focusing on short-term or long-term trading, allowing you to potentially achieve higher profits. The backtesting was conducted using the BTCUSDT pair in 15-minute timeframe on the Binance exchange. Users can configure the following options:
General Settings:
- Initial Capital (Default: $10,000)
- Currency (Default: USDT)
- Commission (Default: 0.1%)
- Slippage (Default: 5 ticks)
Order Size Management:
- DCA Mode (Default: Quantity)
- Order Size in Quantity (Default: 0.01)
- Order Size in Value (Default: $300)
Strategy's Entry Conditions:
- Number of Consecutive Bullish Candles (Default: 3)
- Close Over Candle Body % (Default: 50% - Disabled)
- Close Over Previous Candles Lookback (Default: 14 - Disabled)
- Pyramiding Number (Default: 30)
Price Drop Management:
- Enable Price Drop Calculations (Default: Enabled)
- Enable Current Balance Check (Default: Enabled)
- Price Drop Percentage Type (Default: Custom)
- Average Price Move Down Percentage % (Default: 50%)
- Fixed Price Drop Percentage % (Default: 0.5%)
- Custom Price Drop Percentage % (Defaults: 0.5, 0.5, 0.5, 1, 3, 5, 5, 10, 10, 10)
TP/SL:
- Take Profit % (Default: 3%)
- Stop Loss % (Default: 100%)
- Enable Trailing Target (Default: Enabled)
- Trailing Offset % (Default: 0.1%)
Backtest Table (Default: Enabled)
Date & Time:
- Date Range Filtering (Default: Disabled)
- Start Time
- End Time
Alert Message:
- Alert Message for Enter Long
- Alert Message for Exit Long
By providing these customizable settings, the strategy allows you to tailor it to your specific needs, enhancing the adaptability and effectiveness of your trading approach.
🔐 Source Code Protection:
The source code of the DCA-Integrated Trend Continuation Strategy is designed to be robust, reliable, and highly efficient. Its original and innovative implementation merits protecting the source code and limiting access, ensuring the exclusivity of this strategy. By safeguarding the code, the integrity and uniqueness of the strategy are preserved, giving users a competitive edge in their trading activities.
Wunder Breakout botWunder Breakout bot
1. Wunder Breakout bot is based on the breakout of the trend line. Breakout is a technical trading strategy that is used to determine the moment of a trend line breakout on the price chart. It is based on the assumption that when price crosses a trend line, it signals a change in trend direction and the possible start of a new price movement.
2. The entry points for the trendline breakout strategy are based on the principle of breaking through a set trendline. This means that we look for the moment when the price of the asset crosses the trend line that we have established in order to enter a sell or buy position.
3. We use fixed take-profit and stop-loss, but you can use other risk management systems, based on the suggested settings.
4. Wunder Breakout bot script has added a function to calculate the risk per portfolio (your deposit). When this option is enabled, you get the calculation of the entry amount in dollars relative to your Stop Loss. You can chooseselect the percentage of risk per your portfolio in the settings. the percentage of risk per your portfolio in the settings. The loss will be calculated from the amount that will be displayed on the chart.
For example, if your deposit is $1000 and you set your risk at 1%, with a Stop Loss of 5%, your entry volume would be $200. The SL loss would be $10. $10 is your 1% risk or 1% of your deposit.
*Important! ** The risk per trade must be less than the Stop Loss value. If the risk is more than SL, you should use leverage.
The amount of funds included in the deal is calculated in dollars. This option was created if you want to send a dollar amount from Tradingview to the exchange. However, by specifying the volume in dollars, you will get the net profit and drawdown displayed incorrectly in the backtest results because TradingView calculates the backtest volume in contracts.
To display the correct net profit and drawdown values in Tradingview backtest results, use the "Volume in Contracts" option.
Wunder OI botWunder OI bot
1. Wunder OI bot is based on the search for divergences on the Open Interest indicator. The strategy determines the divergence between the price and the Open Interest for a given period.
2. 50 EMA is used as an additional filter. If a divergence is found for a specified number of bars ago and the price is above or below, a trade will be opened.
3. A function for calculating risk on the portfolio (your deposit) has been added to the Wunder OI bot script. When this option is enabled, you get a calculation of the entry amount in dollars relative to your Stop Loss. In the settings, you can select the risk percentage on your portfolio. The loss will be calculated from the amount that will be displayed on the chart.
For example, if your deposit is $1000 and you set the risk to 1%, with a Stop Loss of 5%, the entry volume will be $200. The loss at SL will be $10. 10$, which is your 1% risk or 1% of the deposit.
*Important!** The risk per trade must be less than the Stop Loss value. If the risk is greater than SL, then you should use leverage.
The amount of funds entering the trade is calculated in dollars. This option was created if you want to send the dollar amount from Tradingview to the exchange. However, putting your volume in dollars you get the incorrect net profit and drawdown indication in the backtest results, as TradingView calculates the backtest volume in contracts.
To display the correct net profit and drawdown values in Tradingview Backtest results, use the ”Volume in contract” option.
Wunder Volume botWunder Volume Bot
1. Wunder Volume bot is a non-indicator strategy that is based on the Volume analysis.
2. For the entry we will use the volume multiplier to detect the abnormal volume activity. For example, the volume should be 2 times the average. You can set your own preferences for each asset. It is recommended to use a higher multiplier and multiple assets to run multiple different bots in order to diversify your approach.
3. A function for calculating risk on the portfolio (your deposit) has been added to the Wunder Volume bot script. When this option is enabled, you get a calculation of the entry amount in dollars relative to your Stop Loss. In the settings, you can select the risk percentage on your portfolio. The loss will be calculated from the amount that will be displayed on the chart.
For example, if your deposit is $1000 and you set the risk to 1%, with a Stop Loss of 5%, the entry volume will be $200. The loss at SL will be $10.10, which is your 1% risk or 1% of the deposit.
Important! The risk per trade must be less than the Stop Loss value. If the risk is greater than SL, then you should use leverage.
The amount of funds entering the trade is calculated in dollars. This option was created if you want to send the dollar amount from Tradingview to the exchange. However, putting your volume in dollars you get the incorrect net profit and drawdown indication in the backtest results, as TradingView calculates the backtest volume in contracts.
To display the correct net profit and drawdown values in Tradingview Backtest results, use the ”Volume in contract” option.
LuBotINTRODUCTION
This indicator was born from a personal need to have everything needed in one place and to allow any trader to see the market as I see it, so that everyone, even the novice trader, immediately feels at ease as I do me when I look at the graphs.
Over time I have also developed other indicators which I associate with the LuBot, however it is designed to be used as a standalone indicator which can suit any trading style.
Of course, no indicator or strategy can predict the future. Only a good mindset and good money management can lead you to be a consistently profitable trader in the long run. Which is why together with the indicator I will provide further examples of use with personal insights and thoughts about my way of seeing the market.
Below you will find everything you need to understand what you will get with this indicator and how to use it, but there are so many configurations that you can do that could make you find a better setup than mine as each of us has different needs and different timing.
Some of us don't mind keeping positions open overnight and others want to close everything by the end of the day. There are those who look at charts with very low timeframes and those like me who prefer to look at higher timeframes like the Daily for reasons of practicality and more "relaxed" timing.
Because of this I don't want to limit the use of the indicator to what is my way of using it. Each of us has different needs, and this indicator is used to show you the way forward and satisfy your needs.
WHAT IS LuBot?
LuBot is a multi-piece indicator that provides any trader with everything they need to trade in one place.
The idea is to make it easier to see the market and give everyone the opportunity to start trading with a simple method that is within everyone's reach.
The LuBot indicator works on any TradingView chart and timeframe and includes several basic components including:
- Long and Short signals: distinguishable in SwingSignals and MultiSignals.
SwingSignals have an alternating Long-Short sequence. The logic of these signals is to indicate the trend to follow which, if supported by the other components, allows inputs in favor of swings. MultiSignals signals add intermediate signals to favor entry even on a single signal and could be used both to add further confirmation to the trend-following trade and for scalping, thus exiting the trade as soon as possible.
- Reversal Bands : placed at the ends of the chart, they indicate an area of probable price reversal (overbought and oversold areas). They are divided into colored bands each of which increases its repelling force as the intensity of the color increases. If the price crosses an extreme we expect an even stronger reversal.
- Customizable Moving Averages : 3 in total which can be modified in length, source and type of moving average (ema, sma, wma, etc.). By default I have entered the settings that I use personally.
- Trend Cloud : colored band according to the trend. By default the colors are green for bullish trend, red for bearish trend and gray for sideways/neutral phase. Coupled with moving averages they are a perfect tool to better follow the trend.
- Swings : shows swings on the chart so you can better understand their structure and refine trend tracking. Excellent as reference points for new trades.
- Reversal Signals : small signals shown as arrows above and below the chart. Those above appear when the price is overbought, conversely those below appear when the price is oversold. They are not entry inputs but they help for both entry and exit of the trade.
- Trend Candles : the candles are colored according to the trend defined in the code. Additional support to avoid entering against the trend or to exit the market when the trend reverses.
- Supports and Resistances : supply and demand levels will appear automatically and will update over time. They take the pivot points as references and it is possible to modify their period. A higher value will show wider levels, a lower value will show levels based on the latest price movements.
- Trend Channel : Show an automatic trend channel based on the period entered in the settings. A value of 100 will show a channel based on the price average of the last 100 candles.
- Alerts : finally we find the alerts both for Long and Short signals and for the appearance of a new swing. Before activating alerts, make sure you have chosen the signal settings you prefer so that you only receive that type of alert. The alert will adapt to the parameters you have chosen and will notify you whenever a new signal or swing appears. The "Any function alert" will alert you whenever a Long or Short SwingSignals appear.
SIGNAL SETTINGS
These are the signal setting modes.
First we open the indicator settings by clicking on the gear in the upper left next to the indicator name, or by double clicking on one of the indicator components in the chart.
At this point a menu will open in which the various components appear in an orderly manner.
The first group concerns the signal settings.
The first item indicates the Signal Type in which we can choose whether to display the SwingSignals or MultiSignals signals.
The second item indicates the Signal Style in which we can choose a value from 0 to 3.
Value 0 will show all signals not filtered by the trend. The value 1 will add a first trend filter and increase the restriction on the trend by increasing the value.
Next we find 3 selectable boxes called Limit Signals.
Each of these boxes will add further filters to the signals in order to limit the signals in periods of laterality and to avoid an excess of signals shown on the chart.
By acting on these settings we could find the right setup that best suits our needs.
Finally, the last modifiable parameter concerns the display of the last signals which by default is set to 3000. This means that all the signals in the last 3000 candles will be displayed on the chart.
HOW I USE IT
As I wrote above my favorite timeframe is the Daily. This timeframe allows me to study the market very calmly and gives me all the time necessary to decide how to behave on the market. Furthermore, the Daily timeframe fits perfectly with my vision of trading, which is the one that allows you to have time for yourself instead of working all day and not being able to devote yourself to family or other businesses.
In this way I observe the market only in the morning or in the evening and thanks to this indicator I can make decisions very quickly unlike when I had to analyze chart by chart with other manual tools. Moreover, thanks to this configuration I can easily do everything from my smartphone. You don't know what satisfaction it feels like to sit comfortably on your sofa in the evening and observe the markets from your mobile phone and open and close trades thanks to this indicator.
Now let's move on to the practical part and see the main actions I take when I look at a graph from scratch. The examples will cover the Long position but the reverse applies for the Short position.
HOW TO ENTER THE MARKET
1- First I set the signals with the Limit Signals type 3 option and use the SwingSignals signals. In this way I avoid too much confusion in the graph and consider the last signal
that points me in the main direction to follow.
2- In the image above we see a Long signal as the last. So from then on I will only look for Long entries.
3- I wait for the TrendCloud to turn green and thus favor the direction bullish.
4- I wait for the price to rise above the ema21 (orange moving average set by default) and the TrendCloud.
5- If the TrendCloud is above the ema100 (blue moving average) and the ema200 (yellow moving average) this increases the idea of bullish strength.
6- I expect a retracement and then a return of prices towards the zone ema21 or TrendCloud.
7- At this point, as we can see from the image below, I start looking at the Swing.
Swings determine the structure and trend of the market.
Increasing highs and lows = Uptrend
Lower highs and lower lows = Bearish trend
If in this case the swing low is positive then HL (HigherLow) we are more likely to enter in favor of a positive trend and be able to bring home a profit.
8- The break of the high of the swing candle (the one where we find the label HL) is already an entry trigger in itself, but to improve the probability of success and avoid
entering false movements we add MultiSignals signals to have input patterns specific.
In this case we have a Long entry pattern so the entry on the break of the maximum is confirmed.
9- A further confirmation is given by the TrendCandles that we can activate from the settings. If the last candles are green and the candle of ours probable trade is also
green, we have a further confirmation of possible rise.
TRADE MANAGEMENT AND EXIT
1- The moment we decide to open the position we need to know in advance where you mainly enter the stop loss and then the take profit.
2- To enter the stop loss we can use the last swing low as reference, or the TrendCloud. Based on the risk you want to get on that trade.
If the conditions are particularly positive you can place the stop loss a few pips below the swing low. The take profit instead it depends on how long you want to hold the
trade. Personally I prefer to exit trades as soon as possible to avoid staying too long exposed to reversal risks. This is about a trading approach short term.
So it could be placed on the level of the previous high as in the following example.
In this case the trade lasts only 4 candles and the overnight costs and the risk of closing the trade with a loss are limited.
3- To view the exit levels for TP and SL you can also use the automatic Support and Resistance tool.
In this example we see that the closest support level coincided with the low of the swing so inserting the stop loss below the low of the swing would have had greater validity. The Take Profit, on the other hand, could be placed on the closest Resistance level.
4- A more conservative approach would lead us to place the stop loss below the TrendCloud or below the previous swing low (more recommended approach). In this way we
will avoid the risk of being stopped and subsequently seeing the market continue in our direction as often happens.
In this example we see a Long trade on a subsequent MultiSignals signal which is stopped when the price makes a retracement on the TrendCloud. In this case we see that if we had placed the stop below the previous swing low or below the TrendCloud we would still have remained in the market and would be positive.
5- In the example above, it must also be considered that the market had already made several positive swings without making a more important retracement on the
TrendCloud, so after making 1 or 2 trades I would avoid forcing too much by chasing all the signals because it is the most correct approach.
After 3-4 consecutive swings without retracements, I recommend waiting.
When the market has made a major retracement then the swing count can start over and we could enter on the next swing high mark or break.
CONCLUSIONS
As you will have understood, the main approach is Trend is Your Friend, the trend is our main friend in trading and insisting on counter-trend operations is not profitable and sustainable in the long run. Even with LuBot you can do countertrend trades but they are not the ones I recommend so I won't talk about them here.
Last but not least it must be said that the indicator does not repaint, this means that the signals will not disappear over time and the alerts are reliable.
Each of these components has been inserted on the basis of a personal need and on the basis of studies done directly by me in the field. This is the first official release after 3 years of developments.
This indicator is not a strategy, does not show backtest results and does not show Take Profit or Stop Loss levels. The purpose of this indicator is to give everyone an idea of price behavior and to implement a discretionary strategy. Signals are not always a reason to enter and TP and SL levels vary depending on the type of trade, which is why an automated backtest could show different results than you might have.
This indicator is intended to help the trader (beginner or not) to find the trades to make more easily and to allow anyone to follow a strategy. Since this is an indicator for discretionary trading, I don't invite you to follow all the signals, but to reason with all the tools available within it. When there are more elements that match, the chances of success are higher. You have to be patient and avoid getting caught up in haste and emotions. Considering that the market is unpredictable and there can be no certainties about its future movement, I take no responsibility for your use of this indicator.
SuperTrend Multi Time Frame Long and Short Trading Strategy
Hello All
This is non-repainting Supertrend Multi Time Frame script, I got so many request on Supertrend with Multi Time Frame. This is for all of them ..I am making it open for all so you can change its coding according to your need.
How the Basic Indicator works
SuperTrend is one of the most common ATR based trailing stop indicators.
In this version you can change the ATR calculation method from the settings. Default method is RMA.
The indicator is easy to use and gives an accurate reading about an ongoing trend. It is constructed with two parameters, namely period and multiplier. The default values used while constructing a Supertrend indicator are 10 for average true range or trading period and three for its multiplier.
The average true range (ATR) plays an important role in 'Supertrend' as the indicator uses ATR to calculate its value. The ATR indicator signals the degree of price volatility .
The buy and sell signals are generated when the indicator starts plotting either on top of the closing price or below the closing price. A buy signal is generated when the ‘Supertrend’ closes above the price and a sell signal is generated when it closes below the closing price.
It also suggests that the trend is shifting from descending mode to ascending mode. Contrary to this, when a ‘Supertrend’ closes above the price, it generates a sell signal as the colour of the indicator changes into red.
A ‘Supertrend’ indicator can be used on spot, futures, options or forex, or even crypto markets and also on daily, weekly and hourly charts as well, but generally, it fails in a sideways-moving market.
How the Strategy works
This is developed based on SuperTrend.
Use two time frame for confirm all entry signals.
Two time frame SuperTrend works as Trailing stop for both long and short positions.
More securely execute orders, because it is wait until confine two time frames(example : daily and 30min)
Each time frame developed as customisable for user to any timeframe.
User can choose trading position side from Long, Short, and Both.
Custom Stop Loss level, user can enter Stop Loss percentage based on timeframe using.
Multiple Take Profit levels with customisable TP price percentage and position size.
Back-testing with custom time frame.
This strategy is develop for specially for automation purpose.
The strategy includes:
Entry for Long and Short.
Take Profit.
Stop Loss.
Trailing Stop Loss.
Position Size.
Exit Signal.
Risk Management Feature.
Backtesting.
Trading Alerts.
Use the strategy with alerts
This strategy is alert-ready. All you have to do is:
Go on a pair you would like to trade
Create an alert
Select the strategy as a Trigger
Wait for new orders to be sent to you
This is develop for specially for automating trading on any exchange, if you need to get that automating service for this strategy or any Tradingview strategy or indicator please contact me I am have 8 year experience on that field.
I hope you enjoy it!
Thanks,
Ranga
Wunder DCA BotThe bot is based on the DCA system.
1. DCA is the investment method in which you buy a certain portion of the asset after the determined price deviation.
2. For entry, we evaluate the maximum and minimum levels for a given period that you can adjust in the script. The bot enters when price rebound from the specified levels.
3. For the exit, the bot will use the take profit percentage that you will specify in settings.
It is also possible to choose how the take profit is calculated either from the average entry price or from the entry order (first order).
4. DCA uses the following settings:
- Base order Volume: Volume of your first order on entry signal
- Subsequent orders volume: The volume of all subsequent orders except the first
- DCA orders count: This parameter will determine how many entries your overall strategy will have. For example: If you will put 3, that will mean that including your initial position you will have 2 additional orders.
- DCA order price deviation:
This is the value in % which determines the deviation of the additional entries from the entry price. Example: If you go long and the price of the asset is 100$ and you put an order price deviation of 1% that will mean that the first additional entry will occur when the price will drop by 1%, and the second entry will be triggered when the overall price will drop by 2% (as the interval between the first and the second additional entry will be 1%).
- DCA Order Volume Multiplier:
This parameter will determine the amount that you put into each additional position. If this parameter is equal to 1 that means that each additional entry will be equal to the initial amount. The extra volume will be added to your position from the second DCA entry. Example: Your initial position was 10$ and your Volume Multiplier is set to 2. When you reach your 1st DCA target your additional order will have the same volume of 10$. When you reach your 2nd DCA target your additional order will be 20$ (previous position volume * multiplier). Your 3rd DCA target will place the order of 40$.
- DCA order price Deviation Multiplier:
This value will increase the price deviation between each additional entry. It is calculated as the price deviation multiplied by the deviation multiplier. For example: if you enter long at the price 100$ and have a price deviation of 1% with the price deviation multiplier of 2 that will mean that the first additional entry will occur when the price will drop to 99$ however the second will occur when the price will go to 97$. The third additional position will be entered at 94$
5. For full automation of the bot, you should set your comments to the input in the bot settings in the "LONG" and "SHORT" fields. You also need to create an alert signal and set a Webhook to send signals.
IMPORTANT!!!
1. Position calculation should take into account several factors: your deposit, leverage, the number of DCA orders, the distance to the last DCA order;
2. When choosing leverage, it is important to correctly calculate the possible drawdown. If you set a high leverage value, then liquidation awaits and the bot will not be able to take profits and will exit the position ahead of time;
3. The size of the position must be determined in accordance with all risks and take into account the size of your deposit;
4. This DCA Bot is able to earn consistently with the correct calculated money management.
Dollar cost averaging trading system (DCA)As investors, we often face the dilemma of willing high stock prices when we sell, but not when we buy. There are times when this dilemma causes investors to wait for a dip in prices, thereby potentially missing out on a continual rise. This is how investors get lured away from the markets and become tangled in the slippery slope of market timing, which is not advisable to a long-term investment strategy.
Skyrex developed a complex trading system based on dollar-cost averaging in Quick Fingers Luc's interpretation. It is a combinations of strategies which allows to systematically accumulate assets by investing scaled amounts of money at defined market cycle global support levels. Dollar-cost averaging can reduce the overall impact of price volatility and lower the average cost per asset thus even during market slumps only a small bounce is required to reach take profit.
The strategy script monitors a chart price action and identifies bases as they form. When bases are reached the script provides entry actions. During price action development an asset value can go lower and in this way the script will perform safety entries at each subsequent accumulation levels. When weighted average entry price reaches target profit the script will perform a take profit action.
Bases are identified as pivot lows in a fractal pattern and validated by an adjustable decrease/rise percentage to ensure significancy of identified bases. To qualify a pivot low, the indicator will perform the following validation:
Validate the price rate of change on drops and bounces is above a given threshold amount.
Validate the volume at the low pivot point is above the volume moving average (using a given length).
Validate the volume amount is a given factor of magnitude above is above the volume moving average.
Validate the potential new base is not too close to the previous range by using a given price percent difference threshold amount.
A fractal pattern is a recurring pattern on a price chart that can predict reversals among larger, more chaotic price movements.
These basic fractals are composed of five or more bars. The rules for identifying fractals are as follows:
A bearish turning point occurs when there is a pattern with the highest high in the middle and two lower highs on each side.
A bullish turning point occurs when there is a pattern with the lowest low in the middle and two higher lows on each side.
Basic dollar-cost averaging approach is enhances by implementation of adjustable accumulation levels in order to provide opportunity of setting them at defined global support levels and Martingale volume coefficient to increase averaging effect. According to Quick Fingers Luc's principles trading principles we added volume validation of a base because it allows to confirm that the market is resistant to further price decrease.
The strategy supports traditional and cryptocurrency spot, futures, options and marginal trading exchanges. It works accurately with BTC, USD, USDT, ETH and BNB quote currencies. Best to use with 1H timeframe charts and limit orders. The strategy can be and should be configured for each particular asset according to its global support and resistance levels and price action cycles. You can modify levels and risk management settings to receive better performance
Advantages of this script:
Strategy has high net profit of 255% at backtests
Backtests show high accuracy around 75%
Low Drawdowns of around 14% at backtests
Strategy is sustainable to market slumps and can be used for long-term trading
The strategy provides a large number of entries which is good for diversification
Can be applied to any market and quote currency
Easy to configure user interface settings
How to use?
1. Apply strategy to a trading pair your are interested in using 1H timeframe chart
2. Configure the strategy: change layer values, order size multiple and take profit/stop loss values according to current market cycle stage
3. Set up a TradingView alert to trigger when strategy conditions are met
4. Strategy will send alerts when to enter and when to exit positions which can be applied to your portfolio using external trading platforms
5. Update settings once market conditions are changed using backtests on a monthly period
NLX Trading Bot Framework (+Trend Score & QQE)- Demo of my NLX Modular Trading Framework -
It includes all the common indicators and creates a positive or negative score, which can be used with my Modular Trading Framework and linked to an entry/exit indicator to filter out buy/sell signals if the trend is not favorable.
Combination of:
SuperTrend
VWAP Bands
Relative Strength Index ( RSI )
Commodity Channel Index ( CCI )
William Percent Range (WPR)
Directional Movement Index (DMI)
Elder Force Index ( EFI )
Momentum
Demarker
Parabolic SAR
- Getting Started -
1. Add this Trend Index to your Chart
2. Add one of my Indicator Modules to your Chart, such as the QQE++ Indicator
3. In the QQE Indicator Settings combine it with the Trend Index (and choose L1 Type)
4. Optional: Add the Noise Filter, and in the Noise Filter Settings you select the QQE Indicator as combination (and choose L2 for Type)
5. Add the Backtest Module to your Chart
6. Select the Noise Filter in the Backtest Settings
- Access -
Only as part of the NLX Framework - see my signature below for more info.
Gucci Sniper Trading Bot [Open]A simple Buy/Sell signal algo designed for a trading bot.
Uses ATR and EMA cross to get signals.
Oasis Trading Group Market Making Bot - Mean Reversion BandsThe OTG Market Making Bot was designed with mean reversion trading in mind. It uses advanced ATR and other volatility formulas to create a set of bands that price should stay within. If price is testing the upper or lower bands then it is "extended" and a mean reversion back to the midline is likely.
The indicator comes with two sets of reversion bands, by default they are set to two and three standard deviations away from the midline, these can be changed to your preference. The indicator will give you Buy and Sell arrows if the conditions are being met. The conditions can be as simple as price hitting the bands or with certain filters, the filters are as follows:
Volatility Filter: Based on your settings it will look at the Current ATR vs Historic ATR Average if the Current ATR is higher than the average it will not show the mean reversion Buy/Sell signals because the volatility is too high. This filter can be turned on and off in the settings.
Trend Filter: Based on your settings it will lookback a certain amount of candles to see if the current price action is ranging or trending. If the current price action is determined to be trending it will not show the mean reversion Buy/Sell signals because it wants to trade within a range. This filter cannot be turned off in the settings, but if you wish to see all the Mean Reversion Buy/Sell signals without any filters you can turn them on in the style settings.
Midline: The midline is color coded based on your Trend Lookback settings. If it determines that the market is ranging it will be colored Green, if it determines that the market is trending it will be colored Red. Green means you are safe to take Mean Reversion trades.
The indicator comes with multiple alerts for all the different Buy/Sell signals. These signals can come from the first set of bands, second set, or unfiltered.
This indicator is designed to be paired with the ATR Improved Indicator I have created which is open source, it can be found here.
Also, paired with the OTG Automated Trading Bot. The OTG Trading Bot is a trend following bot, it excels in trend trading but fails in range trading. This Mean Reversion bot was designed to compliment the OTG Bot perfectly.
The Oasis Trading Group Market Making Bot will be available as a free add-on to all OTG Trading Bot users.
If you have any questions feel free to let me know in the comments or DM me.
v1 Automatic Trading BotHello Friends.
We have been working on this script for a long time. Briefly, our scenario works as follows.
This test data includes results as of January 1, 2022 using a balance of $1000 and 10%.
WORKİNG LOGİC :
Relative Strength Index
Directional Movement Index
Relative Momentum Index
Indicators are Blended.
1 conditions are met in the overbought and oversold zone.
If the Directional Movement Index Signal is in the same direction, If all signals are in the same decision, it will be position.
We can set the take profit and stop loss levels on the algorithm as % over the entry price.
HOW TO ADJUST :
Formula a and formula b values are adjusted by increments or decrements of 1 each. these adjustments should be changed according to the time frame and chart layout.
You do not need to intervene in overbought and oversold zones. The Best Values were thus deemed appropriate.
If you still want to intervene, you need to know; When you change the overbought and oversold values, the entry time and risk will increase.
Together with the backtest script we are able to adjust the algorithm to all timeframes.
For example, while these settings are ideal for 5 minutes, it is necessary to change the strenght and formul values for a 15-minute period. This provides a user-specific adjustable strategy.
There are 6 different triggers in total on the alarm version.
Enter a long position.
Long position take profit
Long position stop loss
Enter a Short position.
Short position take profit
Short position stop loss
Currently, one platform is also connected to the binance exchange via an API .
The maximum leverage is set to 5 and a maximum of 5 trades are ordered to enter.
Good Luck Everyone !
v1 Automatic Trading Bot | BacktestHello Friends.
We have been working on this script for a long time. Briefly, our scenario works as follows.
This test data includes results as of January 1, 2022 using a balance of $1000 and 10%.
WORKİNG LOGİC :
Relative Strength Index
Directional Movement Index
Relative Momentum Index
Indicators are Blended.
1 conditions are met in the overbought and oversold zone.
If the Directional Movement Index Signal is in the same direction, If all signals are in the same decision, it will be position.
We can set the take profit and stop loss levels on the algorithm as % over the entry price.
HOW TO ADJUST :
Formula a and formula b values are adjusted by increments or decrements of 1 each. these adjustments should be changed according to the time frame and chart layout.
You do not need to intervene in overbought and oversold zones. The Best Values were thus deemed appropriate.
If you still want to intervene, you need to know; When you change the overbought and oversold values, the entry time and risk will increase.
Together with the backtest script we are able to adjust the algorithm to all timeframes.
For example, while these settings are ideal for 5 minutes, it is necessary to change the strenght and formul values for a 15-minute period. This provides a user-specific adjustable strategy.
There are 6 different triggers in total on the alarm version.
Enter a long position.
Long position take profit
Long position stop loss
Enter a Short position.
Short position take profit
Short position stop loss
Currently, one platform is also connected to the binance exchange via an API .
The maximum leverage is set to 5 and a maximum of 5 trades are ordered to enter.
I will post the alarm version soon.
Good Luck Everyone !
hamster-bot ZZCompilation of various modifications of the trend breakout reversal strategies based on the ZigZag .
Includes past versions of scripts:
version 1 ZZ2 Breakout reversal strategy
version 2 ZZ2 with experimental options hamster-bot ZZ Breakout reversal strategy
version 3 ZZ6 Noro's ZZ-6 by hamster-bot The original script is available here
The original script is available here
Description ZZ6 :
New version of ZZ-strategy.
Repaint?
Normal lines are not redrawn. Dotted lines repaint, but do not affect trading (do not affect backtests). You can turn off repaint in the script settings. Repaint (dotted lines) are needed only for clarity. To make it clear from which bar the level is created.
Levels
Lime lines above - level from a local high bar. To open a long position. Using a market stop order.
Red line at the bottom - the level from a local low bar. To open a short position. Using a market stop order.
Trading
You can trade without short positions. Then the red line is the level for a stop-loss order.
Reverse trading can be used. Without stop-loss orders.
Risk size
Order size depends on the risk size parameter and possible loss. If risk size = 2%, it means that the loss will be no more than 2%.
For crypto
Symbols: XBT/USD, BTC /USD, BTC /USDT, ETH/USD, etc - need USD(T)
Timeframes: 1h, 4h, 1d
This new ZZ strategy includes all the best practices for this strategy. the script has great flexibility of settings.
Instructions for script parameters:
Parameter ZZ Type - is responsible for the basic type of strategy used (usually it is responsible for building levels)
then you will need to configure the settings block corresponding to the selected ZZ type .
At the moment the script contains types: ZZ2 + ZZ6
The rest of the parameters are common for any type of ZZ.
Further development will be done in this script. The above scripts will not be updated.
At the moment the options are already available:
- Take Profit
- Stop Loss
- One entry Long/Short
- Single entry
- Levels offset
- Levels multiplier
- Levels angle
Keltner Channel - Trend Based StrategyThis strategy is based on 3 main indicators.
1st indicator is a trend indicator, which consists of SMA and EMA
2nd is Keltner Channel
3rd is DM indicator.
The conditions for the entry of this strategy are following:
First of all the assets need to be in an upward trend, this will occur when the EMA will cross SMA. The next condition for the entry is the opening and the closure of the candle. The open price of the candle should be in the upper part of the Keltner Channel and the close price should be above the Keltner channel. The third condition for the DM indicator is to be above a certain benchmakr. This benchmark can be set in the settings of the strategy.
The strategy has two potential Take Profit levels and single stop-loss levels. For the more efficient way you may try an use the trailing stop or extend the number of take-profit levels.
Ichimoku Cloud Strategy Long Only [Bitduke]Slightly modificated and optimized for Pine Script 4.0, Ichimoku Cloud Strategy which, suddenly, good suitable for the several crypto assets.
Details:
Enter position when conversion line crosses base line up, and close it when the opposite happens.
Additional condition for open / close the trade is lagging span, it should be higher than cloud to open position and below - to close it.
Backtesting:
Backtested on SOLUSDT ( FTX, Binance )
+150% for 2021 year, 8% dd
+191% for all time, 32% dd
Disadvantages:
- Small number of trades
- Need to vary parameters for different coins (not very robust)
Should be tested carefully for other coins / stock market. Different parameters could be needed or even algo modifications.
Strategy doesn't repaint.
Oasis Trading Group Automated Trading BotThe Oasis Trading Group Automated Trading Bot is designed to follow trend and alert the user to potential Buy and Sell Entry Points. It is also equip with Take Profits, Automatic Support and Resistance, and Alerts for when price is breaking or bouncing off these Support and Resistance Levels. It also has a built in Stop Loss that will conservatively keep the user in the trade as long as possible.
The Bot is mainly focused on following trend strength and volatility, when the criteria is met for an entry it will trigger a Buy/Sell and then give Take Profit points that will act as suggestions for the user to take partial profit while letting the rest of the trade ride.
The Bot works best on Heikin Ashi Candles but they are not required. Because it is a trend bot, the higher time frames will be stronger.
Finally, the Oasis Trading Group Bot is equip with many different alerts for the user to fully automate their trading experience through TradingView Alerts.
For Access or Questions: Private message us. Thank you.
[NLX-L3] Backtest- Introduction -
This backtest module is part of my new modular trading framework - however it can be used with any indicator that has a signal plot output (1 = long / -1 = short)
I chose to release this one first, I've got all the modules for the framework ready and they going to be released in the coming days. Got to start somewhere... ;)
This trading framework is the result of many years experience building indicators and trading strategies.
I couldn’t find a trading framework in Pine Script that would suit my needs and so I started to design my own from scratch. I’m trading with this framework myself so I’ve made sure that it’s flexible and absolutely reliable in a live-trading environment.
- Architecture -
What makes this framework so flexible is the modular architecture, different layers that all serve a very specific purpose.
You will notice that the module names include either L1 - L2 or L3:
- Layer 1 (L1) is the base layer and the foundation. L1 indicators are used to determine the trend, volume profile and filter noise. You would use L1 to see if it’s a good time to trade, what is the direction - or if it's better to trade at all in unfavourable conditions
- Layer 2 (L2) receives the result of L1 and if the market conditions are good the L2 indicator looks for an optimal entry point to go long or short. It is possible to combine several L2 indicators and trigger a long/short signal only if all L2 indicators agree.
- Layer 3 (L3) receives the final signal from L2 and it’s where we can now backtest the result of our trading strategy and trigger trade alerts with help of the alert module.
- Features -
External Input Source (any indicator with signal plot can be used)
Safe Entries Option: Enter a trade only if the position is profitable ad the momentum allows
Pyramid Entries
Partial Take-Profit: %-Step Interval and Quantity per Step
Stop Methods: Trailing Stop, TP/SL with ATR Option, several type of stop bands...
Profit/Loss Label with Fee, Slippage and Leverage Calculation
- Upcoming Modules -
I'll release a couple of great indicators and filter in the coming days...
Trend Score (includes 10 different Trend and Filter algorithms)
Breakouts & Pullbacks
QQE++
True Range Filter
Support / Resistance
Consolidation Range Breakouts
- Alerts & Trading Automation -
Will be released shortly. Check my signature below.
Donchian Channel Strategy [for free bot]
I present to you a script for testing the Donchian channel breakout strategy for the Binance_exchange.
This strategy is trending, and is especially effective for trading cryptocurrency futures.
This strategy is very flexible, and you can configure virtually all possible parameters, moreover, separately for longs and separately for shorts.
In the script, you can configure the parameters of the channel for entry and exit, the exit method, enable or disable purchases / sales, specify take profit and stop loss, and more.
On the example of optimization, only 20% of the deposit is used. This is done for diversification, since there are 37 contracts on binance_futures (at the time of writing the script description). That is, by optimizing the parameters for different currencies, you can very well reduce risks.
Представляю Вам скрипт для тестирования стратегии пробоя канала Дончиана для биржи Бинанс.
Данная стратегия относится к трендовым, и особенно эффективная на торговли криптовалютных фьючерсов.
Данная стратегия очень гибкая, и можно настроить фактически все возможные параметры, при чем, отдельно для покупок и отдельно для продаж.
В скрипте можно настроить параметры канала на вход и на выход, метод выхода, разрешить или запретить покупки/проаджи, указать тейк-профит и стоп-лосс и другое.
На примере оптимизации используется всего 20% от депозита. Это сделано для диверсификации, так как на фьючерсах бинансе присутсвует 37 контрактов (на момент написания описания скрипта). Т.е., оптимизировав параметры под разные валюты, можно очень хорошо снизить риски.
Gap Trading Strategy: CME BitcoinI created a strategy which finds gaps on CME Futures market for Bitcoin, BTC1! and opens a long or short position on the crypto exchange depending on what kind of gap was found (up or down) on CME.
Up gap: today open price > previous day high price
Down gap: today open price < previous day low price
Two lines below the main chart show when gaps appear. The green line represents the size of up gaps, when it crosses zero it gives a long signal. The red line - represents the size of down gaps, when it crosses zero - short signal.
Instead of having to look between multiple charts, this simply overlays the past weeks open and close should a gap appear.
Usage:
Strategy flips long / short depending of indicator signals. It could cut the position by stop loss or take profit.
Features:
ability to set stop loss and take profit in %
ability to set delta for gaps (if you want to filter small ones)
ability to choose strategy type. Standart: Long Up/Short Down || Inverse: Short Up/Long Down.
Backtesting:
Backtested on BTCPERP ( FTX ) and XBTUSD (Bitmex).
It shows a low drawdown, a small number of trades and 50% of profit for the 2020.
For example, I set high delta for down gaps to filter small ones
Strategy doesn't repaint.