Milvetti_Pineconnector_LibraryLibrary "Milvetti_Pineconnector_Library"
This library has methods that provide practical signal transmission for Pineconnector.Developed By Milvetti
buy(licenseId, symbol, risk, sl, tp, beTrigger, beOffset, trailTrig, trailDist, trailStep, atrTimeframe, atrTrigger, atrPeriod, atrMultiplier, atrShift, spread, accFilter, secret, comment)
Create a buy order message
Parameters:
licenseId (string) : License Id. This is a unique identifier found in the Pineconnector Licensing Dashboard.
symbol (string) : Symbol. Default is syminfo.ticker
risk (float) : Risk. Function depends on the “Volume Type” selected in the EA
sl (float) : StopLoss. Place stop-loss. Computation is based on the Target Type selected in the EA. Default is 0(inactive)
tp (float) : TakeProfit. Place take-profit. Computation is based on the Target Type selected in the EA. Default is 0(inactive)
beTrigger (float) : Breakeven will be activated after the position gains this number of pips. Ensure > 0
beOffset (float) : Offset from entry price. 0 means the SL will be placed exactly at entry price. 1 means 1 pip above the entry price for buy trades and 1 pip below for sell trades.
trailTrig (int) : Trailing stop-loss will be activated after a trade gains this number of pips. Default is 0(inactive)
trailDist (int) : SL will be opened at traildist after trailtrig is met, even if you do not have a SL placed.. Default is 0(inactive)
trailStep (int) : Moves trailing stop-loss once price moves to favourable by a specified number of pips. Default is 0(inactive)
atrTimeframe (string) : ATR Trailing Stop will be based on the specified timeframe in minutes and will only update once per bar close. Default is Timeframe.Period
atrTrigger (float) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default is 0(inactive)
atrPeriod (int) : ATR averaging period. Default is 0
atrMultiplier (float) : Multiple of ATR to utilise in the new SL computation. Default is 1
atrShift (float) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default is 0
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips. Default is 0(inactive)
accFilter (float) : Enter the position only if the account requirement is met. Default is 0(inactive)
secret (string)
comment (string) : Comment. Add a string into the order’s comment section. Default is "Symbol+Timeframe"
sell(licenseId, symbol, risk, sl, tp, beTrigger, beOffset, trailTrig, trailDist, trailStep, atrTimeframe, atrTrigger, atrPeriod, atrMultiplier, atrShift, spread, accFilter, secret, comment)
Create a buy order message
Parameters:
licenseId (string) : License Id. This is a unique identifier found in the Pineconnector Licensing Dashboard.
symbol (string) : Symbol. Default is syminfo.ticker
risk (float) : Risk. Function depends on the “Volume Type” selected in the EA
sl (float) : StopLoss. Place stop-loss. Computation is based on the Target Type selected in the EA. Default is 0(inactive)
tp (float) : TakeProfit. Place take-profit. Computation is based on the Target Type selected in the EA. Default is 0(inactive)
beTrigger (float) : Breakeven will be activated after the position gains this number of pips. Ensure > 0
beOffset (float) : Offset from entry price. 0 means the SL will be placed exactly at entry price. 1 means 1 pip above the entry price for buy trades and 1 pip below for sell trades.
trailTrig (int) : Trailing stop-loss will be activated after a trade gains this number of pips. Default is 0(inactive)
trailDist (int) : SL will be opened at traildist after trailtrig is met, even if you do not have a SL placed.. Default is 0(inactive)
trailStep (int) : Moves trailing stop-loss once price moves to favourable by a specified number of pips. Default is 0(inactive)
atrTimeframe (string) : ATR Trailing Stop will be based on the specified timeframe in minutes and will only update once per bar close. Default is Timeframe.Period
atrTrigger (float) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default is 0(inactive)
atrPeriod (int) : ATR averaging period. Default is 0
atrMultiplier (float) : Multiple of ATR to utilise in the new SL computation. Default is 1
atrShift (float) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default is 0
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips. Default is 0(inactive)
accFilter (float) : Enter the position only if the account requirement is met. Default is 0(inactive)
secret (string)
comment (string) : Comment. Add a string into the order’s comment section. Default is "Symbol+Timeframe"
buyLimit(licenseId, symbol, pending, risk, sl, tp, beTrigger, beOffset, trailTrig, trailDist, trailStep, atrTimeframe, atrTrigger, atrPeriod, atrMultiplier, atrShift, spread, accFilter, secret, comment)
Create a buy limit order message
Parameters:
licenseId (string) : License Id. This is a unique identifier found in the Pineconnector Licensing Dashboard.
symbol (string) : Symbol. Default is syminfo.ticker
pending (float) : Computing pending order entry price. EA Options: Pips, Specified Price, Percentage
risk (float) : Risk. Function depends on the “Volume Type” selected in the EA
sl (float) : StopLoss. Place stop-loss. Computation is based on the Target Type selected in the EA. Default is 0(inactive)
tp (float) : TakeProfit. Place take-profit. Computation is based on the Target Type selected in the EA. Default is 0(inactive)
beTrigger (float) : Breakeven will be activated after the position gains this number of pips. Ensure > 0
beOffset (float) : Offset from entry price. 0 means the SL will be placed exactly at entry price. 1 means 1 pip above the entry price for buy trades and 1 pip below for sell trades.
trailTrig (int) : Trailing stop-loss will be activated after a trade gains this number of pips. Default is 0(inactive)
trailDist (int) : SL will be opened at traildist after trailtrig is met, even if you do not have a SL placed.. Default is 0(inactive)
trailStep (int) : Moves trailing stop-loss once price moves to favourable by a specified number of pips. Default is 0(inactive)
atrTimeframe (string) : ATR Trailing Stop will be based on the specified timeframe in minutes and will only update once per bar close. Default is Timeframe.Period
atrTrigger (float) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default is 0(inactive)
atrPeriod (int) : ATR averaging period. Default is 0
atrMultiplier (float) : Multiple of ATR to utilise in the new SL computation. Default is 1
atrShift (float) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default is 0
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips. Default is 0(inactive)
accFilter (float) : Enter the position only if the account requirement is met. Default is 0(inactive)
secret (string)
comment (string) : Comment. Add a string into the order’s comment section. Default is "Symbol+Timeframe"
buyStop(licenseId, symbol, pending, risk, sl, tp, beTrigger, beOffset, trailTrig, trailDist, trailStep, atrTimeframe, atrTrigger, atrPeriod, atrMultiplier, atrShift, spread, accFilter, secret, comment)
Create a buy stop order message
Parameters:
licenseId (string) : License Id. This is a unique identifier found in the Pineconnector Licensing Dashboard.
symbol (string) : Symbol. Default is syminfo.ticker
pending (float) : Computing pending order entry price. EA Options: Pips, Specified Price, Percentage
risk (float) : Risk. Function depends on the “Volume Type” selected in the EA
sl (float) : StopLoss. Place stop-loss. Computation is based on the Target Type selected in the EA. Default is 0(inactive)
tp (float) : TakeProfit. Place take-profit. Computation is based on the Target Type selected in the EA. Default is 0(inactive)
beTrigger (float) : Breakeven will be activated after the position gains this number of pips. Ensure > 0
beOffset (float) : Offset from entry price. 0 means the SL will be placed exactly at entry price. 1 means 1 pip above the entry price for buy trades and 1 pip below for sell trades.
trailTrig (int) : Trailing stop-loss will be activated after a trade gains this number of pips. Default is 0(inactive)
trailDist (int) : SL will be opened at traildist after trailtrig is met, even if you do not have a SL placed.. Default is 0(inactive)
trailStep (int) : Moves trailing stop-loss once price moves to favourable by a specified number of pips. Default is 0(inactive)
atrTimeframe (string) : ATR Trailing Stop will be based on the specified timeframe in minutes and will only update once per bar close. Default is Timeframe.Period
atrTrigger (float) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default is 0(inactive)
atrPeriod (int) : ATR averaging period. Default is 0
atrMultiplier (float) : Multiple of ATR to utilise in the new SL computation. Default is 1
atrShift (float) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default is 0
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips. Default is 0(inactive)
accFilter (float) : Enter the position only if the account requirement is met. Default is 0(inactive)
secret (string)
comment (string) : Comment. Add a string into the order’s comment section. Default is "Symbol+Timeframe"
sellLimit(licenseId, symbol, pending, risk, sl, tp, beTrigger, beOffset, trailTrig, trailDist, trailStep, atrTimeframe, atrTrigger, atrPeriod, atrMultiplier, atrShift, spread, accFilter, secret, comment)
Create a sell limit order message
Parameters:
licenseId (string) : License Id. This is a unique identifier found in the Pineconnector Licensing Dashboard.
symbol (string) : Symbol. Default is syminfo.ticker
pending (float) : Computing pending order entry price. EA Options: Pips, Specified Price, Percentage
risk (float) : Risk. Function depends on the “Volume Type” selected in the EA
sl (float) : StopLoss. Place stop-loss. Computation is based on the Target Type selected in the EA. Default is 0(inactive)
tp (float) : TakeProfit. Place take-profit. Computation is based on the Target Type selected in the EA. Default is 0(inactive)
beTrigger (float) : Breakeven will be activated after the position gains this number of pips. Ensure > 0
beOffset (float) : Offset from entry price. 0 means the SL will be placed exactly at entry price. 1 means 1 pip above the entry price for buy trades and 1 pip below for sell trades.
trailTrig (int) : Trailing stop-loss will be activated after a trade gains this number of pips. Default is 0(inactive)
trailDist (int) : SL will be opened at traildist after trailtrig is met, even if you do not have a SL placed.. Default is 0(inactive)
trailStep (int) : Moves trailing stop-loss once price moves to favourable by a specified number of pips. Default is 0(inactive)
atrTimeframe (string) : ATR Trailing Stop will be based on the specified timeframe in minutes and will only update once per bar close. Default is Timeframe.Period
atrTrigger (float) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default is 0(inactive)
atrPeriod (int) : ATR averaging period. Default is 0
atrMultiplier (float) : Multiple of ATR to utilise in the new SL computation. Default is 1
atrShift (float) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default is 0
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips. Default is 0(inactive)
accFilter (float) : Enter the position only if the account requirement is met. Default is 0(inactive)
secret (string)
comment (string) : Comment. Add a string into the order’s comment section. Default is "Symbol+Timeframe"
sellStop(licenseId, symbol, pending, risk, sl, tp, beTrigger, beOffset, trailTrig, trailDist, trailStep, atrTimeframe, atrTrigger, atrPeriod, atrMultiplier, atrShift, spread, accFilter, secret, comment)
Create a sell stop order message
Parameters:
licenseId (string) : License Id. This is a unique identifier found in the Pineconnector Licensing Dashboard.
symbol (string) : Symbol. Default is syminfo.ticker
pending (float) : Computing pending order entry price. EA Options: Pips, Specified Price, Percentage
risk (float) : Risk. Function depends on the “Volume Type” selected in the EA
sl (float) : StopLoss. Place stop-loss. Computation is based on the Target Type selected in the EA. Default is 0(inactive)
tp (float) : TakeProfit. Place take-profit. Computation is based on the Target Type selected in the EA. Default is 0(inactive)
beTrigger (float) : Breakeven will be activated after the position gains this number of pips. Ensure > 0
beOffset (float) : Offset from entry price. 0 means the SL will be placed exactly at entry price. 1 means 1 pip above the entry price for buy trades and 1 pip below for sell trades.
trailTrig (int) : Trailing stop-loss will be activated after a trade gains this number of pips. Default is 0(inactive)
trailDist (int) : SL will be opened at traildist after trailtrig is met, even if you do not have a SL placed.. Default is 0(inactive)
trailStep (int) : Moves trailing stop-loss once price moves to favourable by a specified number of pips. Default is 0(inactive)
atrTimeframe (string) : ATR Trailing Stop will be based on the specified timeframe in minutes and will only update once per bar close. Default is Timeframe.Period
atrTrigger (float) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default is 0(inactive)
atrPeriod (int) : ATR averaging period. Default is 0
atrMultiplier (float) : Multiple of ATR to utilise in the new SL computation. Default is 1
atrShift (float) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default is 0
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips. Default is 0(inactive)
accFilter (float) : Enter the position only if the account requirement is met. Default is 0(inactive)
secret (string)
comment (string) : Comment. Add a string into the order’s comment section. Default is "Symbol+Timeframe"
Milvetti
Milvetti_TraderPost_LibraryLibrary "Milvetti_TraderPost_Library"
This library has methods that provide practical signal transmission for traderpost.Developed By Milvetti
cancelOrders(symbol)
This method generates a signal in JSON format that cancels all orders for the specified pair. (If you want to cancel stop loss and takeprofit orders together, use the “exitOrder” method.
Parameters:
symbol (string)
exitOrders(symbol)
This method generates a signal in JSON format that close all orders for the specified pair.
Parameters:
symbol (string)
createOrder(ticker, positionType, orderType, entryPrice, signalPrice, qtyType, qty, stopLoss, stopType, stopValue, takeProfit, profitType, profitValue, timeInForce)
This function is designed to send buy or sell orders to traderpost. It can create customized orders by flexibly specifying parameters such as order type, position type, entry price, quantity calculation method, stop-loss, and take-profit. The purpose of the function is to consolidate all necessary details for opening a position into a single structure and present it as a structured JSON output. This format can be sent to trading platforms via webhooks.
Parameters:
ticker (string) : The ticker symbol of the instrument. Default value is the current chart's ticker (syminfo.ticker).
positionType (string) : Determines the type of order (e.g., "long" or "buy" for buying and "short" or "sell" for selling).
orderType (string) : Defines the order type for execution. Options: "market", "limit", "stop". Default is "market"
entryPrice (float) : The price level for entry orders. Only applicable for limit or stop orders. Default is 0 (market orders ignore this).
signalPrice (float) : Optional. Only necessary when using relative take profit or stop losses, and the broker does not support fetching quotes to perform the calculation. Default is 0
qtyType (string) : Determines how the order quantity is calculated. Options: "fixed_quantity", "dollar_amount", "percent_of_equity", "percent_of_position".
qty (float) : Quantity value. Can represent units of shares/contracts or a dollar amount, depending on qtyType.
stopLoss (bool) : Enable or disable stop-loss functionality. Set to `true` to activate.
stopType (string) : Specifies the stop-loss calculation type. Options: percent, "amount", "stopPrice", "trailPercent", "trailAmount". Default is "stopPrice"
stopValue (float) : Stop-loss value based on stopType. Can be a percentage, dollar amount, or a specific stop price. Default is "stopPrice"
takeProfit (bool) : Enable or disable take-profit functionality. Set to `true` to activate.
profitType (string) : Specifies the take-profit calculation type. Options: "percent", "amount", "limitPrice". Default is "limitPrice"
profitValue (float) : Take-profit value based on profitType. Can be a percentage, dollar amount, or a specific limit price. Default is 0
timeInForce (string) : The time in force for your order. Options: day, gtc, opg, cls, ioc and fok
Returns: Return result in Json format.
addTsl(symbol, stopType, stopValue, price)
This method adds trailing stop loss to the current position. “Price” is the trailing stop loss starting level. You can leave price blank if you want it to start immediately
Parameters:
symbol (string)
stopType (string) : Specifies the trailing stoploss calculation type. Options: "trailPercent", "trailAmount".
stopValue (float) : Stop-loss value based on stopType. Can be a percentage, dollar amount.
price (float) : The trailing stop loss starting level. You can leave price blank if you want it to start immediately. Default is current price.
RSI Accumulation/Distribution [M]Hello everyone,
After my long tests, I observed that the rate of change of direction of the price was high after the periods when the RSI spent a long time outside the band. As a result of my observations, I prepared this indicator.
This indicator shows you the accumulation and distribution areas that occur outside the rsi band.
There are 3 different levels available.
Level 1 = 5 Bars
Level 2 = 7 Bars
Level 3 = 9 Bars
For example, if the RSI spends more than 9 bars below the 30 level or above the 70 level, it will paint that area red. Levels can be changed from the indicator settings. The rsi is smoothed with simple moving average to reduce fake signals.
Using the RSI A/D indicator with different indicators or patterns will increase your success rate.
Examples: