Library "SAT_BACKTEST"
ex_timezone(tz)
switch case return exact @timezone for timezone input
Parameters:
tz (simple string)
Returns: syminfo.timezone or tz
if_in_date_range(usefromDate, fromDate, usetoDate, toDate, src_timezone, dst_timezone)
if_in_date_range : check if @time_close is range
Parameters:
usefromDate (simple bool)
fromDate (simple int)
usetoDate (simple bool)
toDate (simple int)
src_timezone (simple string)
dst_timezone (simple string)
Returns: true if @time_close is range
if_in_session(useSessionStart, sessionStartHour, sessionStartMinute, useSessionEnd, sessionEndHour, sessionEndMinute, useSessionDay, mon, tue, wed, thu, fri, sat, sun, src_timezone, dst_timezone)
if_in_session : check if @time_close is range
Parameters:
useSessionStart (simple bool)
sessionStartHour (simple int)
sessionStartMinute (simple int)
useSessionEnd (simple bool)
sessionEndHour (simple int)
sessionEndMinute (simple int)
useSessionDay (simple bool)
mon (simple bool)
tue (simple bool)
wed (simple bool)
thu (simple bool)
fri (simple bool)
sat (simple bool)
sun (simple bool)
src_timezone (simple string)
dst_timezone (simple string)
Returns: true if @time_close is range
ex_timezone(tz)
switch case return exact @timezone for timezone input
Parameters:
tz (simple string)
Returns: syminfo.timezone or tz
if_in_date_range(usefromDate, fromDate, usetoDate, toDate, src_timezone, dst_timezone)
if_in_date_range : check if @time_close is range
Parameters:
usefromDate (simple bool)
fromDate (simple int)
usetoDate (simple bool)
toDate (simple int)
src_timezone (simple string)
dst_timezone (simple string)
Returns: true if @time_close is range
if_in_session(useSessionStart, sessionStartHour, sessionStartMinute, useSessionEnd, sessionEndHour, sessionEndMinute, useSessionDay, mon, tue, wed, thu, fri, sat, sun, src_timezone, dst_timezone)
if_in_session : check if @time_close is range
Parameters:
useSessionStart (simple bool)
sessionStartHour (simple int)
sessionStartMinute (simple int)
useSessionEnd (simple bool)
sessionEndHour (simple int)
sessionEndMinute (simple int)
useSessionDay (simple bool)
mon (simple bool)
tue (simple bool)
wed (simple bool)
thu (simple bool)
fri (simple bool)
sat (simple bool)
sun (simple bool)
src_timezone (simple string)
dst_timezone (simple string)
Returns: true if @time_close is range
เอกสารเผยแพร่:
v2
Added:
CheckLevels(lvl, entry, isTake, inLong, inShort, inTrade)
if_in_session : Check if the SL/TP is reached
Parameters:
lvl (float)
entry (float)
isTake (bool)
inLong (bool)
inShort (bool)
inTrade (bool)
Returns: float level
Added:
CheckLevels(lvl, entry, isTake, inLong, inShort, inTrade)
if_in_session : Check if the SL/TP is reached
Parameters:
lvl (float)
entry (float)
isTake (bool)
inLong (bool)
inShort (bool)
inTrade (bool)
Returns: float level
เอกสารเผยแพร่:
v3
Added:
CheckLevels2(lvl, isTake, inLong, inShort, inTrade)
if_in_session : Check if the SL/TP is reached
Parameters:
lvl (float)
isTake (bool)
inLong (bool)
inShort (bool)
inTrade (bool)
Returns: bool achievement_status
Added:
CheckLevels2(lvl, isTake, inLong, inShort, inTrade)
if_in_session : Check if the SL/TP is reached
Parameters:
lvl (float)
isTake (bool)
inLong (bool)
inShort (bool)
inTrade (bool)
Returns: bool achievement_status
เอกสารเผยแพร่:
v4
Added:
strategy_table(showTable, showHodl)
if strategy return table strategy table
Parameters:
showTable (bool)
showHodl (bool)
Returns: table strategy table
Added:
strategy_table(showTable, showHodl)
if strategy return table strategy table
Parameters:
showTable (bool)
showHodl (bool)
Returns: table strategy table
เอกสารเผยแพร่:
v5
Updated:
strategy_table(showTable, darkTheme)
if strategy return table strategy table
Parameters:
showTable (bool)
darkTheme (bool)
Returns: table strategy table
Updated:
strategy_table(showTable, darkTheme)
if strategy return table strategy table
Parameters:
showTable (bool)
darkTheme (bool)
Returns: table strategy table
เอกสารเผยแพร่:
v6
เอกสารเผยแพร่:
v7
Added:
quick_tp_check(goLong, goShort, entry, tp1x, tp2x, tp3x, tp4x, tp5x, tp6x, slx)
Track TakeProfits and StopLoss achievement for one or many of your buy/sell conditions. CHECK the commented section: "Function @manageTrade" (lines: 14 - 64) for Description
Parameters:
goLong (bool)
goShort (bool)
entry (float)
tp1x (float)
tp2x (float)
tp3x (float)
tp4x (float)
tp5x (float)
tp6x (float)
slx (float)
Returns: TP_achievment status for 6 tps:
Added:
quick_tp_check(goLong, goShort, entry, tp1x, tp2x, tp3x, tp4x, tp5x, tp6x, slx)
Track TakeProfits and StopLoss achievement for one or many of your buy/sell conditions. CHECK the commented section: "Function @manageTrade" (lines: 14 - 64) for Description
Parameters:
goLong (bool)
goShort (bool)
entry (float)
tp1x (float)
tp2x (float)
tp3x (float)
tp4x (float)
tp5x (float)
tp6x (float)
slx (float)
Returns: TP_achievment status for 6 tps:
เอกสารเผยแพร่:
v8
Added:
plot_tpz(darkTheme, useSignal, inLong, inShort, TP1_touched, TP2_touched, TP3_touched, TP4_touched, TP5_touched, TP6_touched, SL_touched)
Track TakeProfits and StopLoss achievement for one or many of your buy/sell conditions. CHECK the commented section: "Function @manageTrade" (lines: 14 - 64) for Description
Parameters:
darkTheme (bool)
useSignal (bool)
inLong (bool)
inShort (bool)
TP1_touched (bool)
TP2_touched (bool)
TP3_touched (bool)
TP4_touched (bool)
TP5_touched (bool)
TP6_touched (bool)
SL_touched (bool)
Returns: check commented section: "Function @manageTrade" (lines: 14 - 64).
Added:
plot_tpz(darkTheme, useSignal, inLong, inShort, TP1_touched, TP2_touched, TP3_touched, TP4_touched, TP5_touched, TP6_touched, SL_touched)
Track TakeProfits and StopLoss achievement for one or many of your buy/sell conditions. CHECK the commented section: "Function @manageTrade" (lines: 14 - 64) for Description
Parameters:
darkTheme (bool)
useSignal (bool)
inLong (bool)
inShort (bool)
TP1_touched (bool)
TP2_touched (bool)
TP3_touched (bool)
TP4_touched (bool)
TP5_touched (bool)
TP6_touched (bool)
SL_touched (bool)
Returns: check commented section: "Function @manageTrade" (lines: 14 - 64).
เอกสารเผยแพร่:
v9
Added:
TP_SL_math(tpType, useTp2, useTp3, useTp4, useTp5, useTp6, rr_pt, reward, tp1x, tp2x, tp3x, tp4x, tp5x, tp6x, slr)
TP_SL_MATH
Parameters:
tpType (string)
useTp2 (bool)
useTp3 (bool)
useTp4 (bool)
useTp5 (bool)
useTp6 (bool)
rr_pt (float)
reward (float)
tp1x (float)
tp2x (float)
tp3x (float)
tp4x (float)
tp5x (float)
tp6x (float)
slr (float)
Returns: PLOTS
Updated:
plot_tpz(darkTheme, useSignal, inLong, inShort, TP1_touched, TP2_touched, TP3_touched, TP4_touched, TP5_touched, TP6_touched, SL_touched)
Plots TakeProfits and StopLoss achievement
Parameters:
darkTheme (bool)
useSignal (bool)
inLong (bool)
inShort (bool)
TP1_touched (bool)
TP2_touched (bool)
TP3_touched (bool)
TP4_touched (bool)
TP5_touched (bool)
TP6_touched (bool)
SL_touched (bool)
Returns: PLOTS
Added:
TP_SL_math(tpType, useTp2, useTp3, useTp4, useTp5, useTp6, rr_pt, reward, tp1x, tp2x, tp3x, tp4x, tp5x, tp6x, slr)
TP_SL_MATH
Parameters:
tpType (string)
useTp2 (bool)
useTp3 (bool)
useTp4 (bool)
useTp5 (bool)
useTp6 (bool)
rr_pt (float)
reward (float)
tp1x (float)
tp2x (float)
tp3x (float)
tp4x (float)
tp5x (float)
tp6x (float)
slr (float)
Returns: PLOTS
Updated:
plot_tpz(darkTheme, useSignal, inLong, inShort, TP1_touched, TP2_touched, TP3_touched, TP4_touched, TP5_touched, TP6_touched, SL_touched)
Plots TakeProfits and StopLoss achievement
Parameters:
darkTheme (bool)
useSignal (bool)
inLong (bool)
inShort (bool)
TP1_touched (bool)
TP2_touched (bool)
TP3_touched (bool)
TP4_touched (bool)
TP5_touched (bool)
TP6_touched (bool)
SL_touched (bool)
Returns: PLOTS
เอกสารเผยแพร่:
v10
เอกสารเผยแพร่:
v11
เอกสารเผยแพร่:
v12
เอกสารเผยแพร่:
v13
Added:
exit_strategy(exit_strategy, inTrade, ID, entry1, tp1, tp2, tp3, tp4, tp5, sl, tp1y, tp2y, tp3y, tp4y, tp5y, tp6y, tp1_hit, tp2_hit, tp3_hit, tp4_hit, tp5_hit, tp6_hit, tp1_touched, tp2_touched, tp3_touched, tp4_touched, tp5_touched, tp6_touched, inShort, inLong)
TP_SL_MATH
Parameters:
exit_strategy (string)
inTrade (bool)
ID (string)
entry1 (float)
tp1 (float)
tp2 (float)
tp3 (float)
tp4 (float)
tp5 (float)
sl (float)
tp1y (float)
tp2y (float)
tp3y (float)
tp4y (float)
tp5y (float)
tp6y (float)
tp1_hit (bool)
tp2_hit (bool)
tp3_hit (bool)
tp4_hit (bool)
tp5_hit (bool)
tp6_hit (bool)
tp1_touched (bool)
tp2_touched (bool)
tp3_touched (bool)
tp4_touched (bool)
tp5_touched (bool)
tp6_touched (bool)
inShort (bool)
inLong (bool)
Returns: PLOTS STRATEGY ACTIONS
Added:
exit_strategy(exit_strategy, inTrade, ID, entry1, tp1, tp2, tp3, tp4, tp5, sl, tp1y, tp2y, tp3y, tp4y, tp5y, tp6y, tp1_hit, tp2_hit, tp3_hit, tp4_hit, tp5_hit, tp6_hit, tp1_touched, tp2_touched, tp3_touched, tp4_touched, tp5_touched, tp6_touched, inShort, inLong)
TP_SL_MATH
Parameters:
exit_strategy (string)
inTrade (bool)
ID (string)
entry1 (float)
tp1 (float)
tp2 (float)
tp3 (float)
tp4 (float)
tp5 (float)
sl (float)
tp1y (float)
tp2y (float)
tp3y (float)
tp4y (float)
tp5y (float)
tp6y (float)
tp1_hit (bool)
tp2_hit (bool)
tp3_hit (bool)
tp4_hit (bool)
tp5_hit (bool)
tp6_hit (bool)
tp1_touched (bool)
tp2_touched (bool)
tp3_touched (bool)
tp4_touched (bool)
tp5_touched (bool)
tp6_touched (bool)
inShort (bool)
inLong (bool)
Returns: PLOTS STRATEGY ACTIONS
เอกสารเผยแพร่:
v14
Updated:
plot_tpz(ID, darkTheme, useSignal, inLong, inShort, TP1_touched, TP2_touched, TP3_touched, TP4_touched, TP5_touched, TP6_touched, SL_touched)
Plots TakeProfits and StopLoss achievement
Parameters:
ID (string)
darkTheme (bool)
useSignal (bool)
inLong (bool)
inShort (bool)
TP1_touched (bool)
TP2_touched (bool)
TP3_touched (bool)
TP4_touched (bool)
TP5_touched (bool)
TP6_touched (bool)
SL_touched (bool)
Returns: PLOTS
Updated:
plot_tpz(ID, darkTheme, useSignal, inLong, inShort, TP1_touched, TP2_touched, TP3_touched, TP4_touched, TP5_touched, TP6_touched, SL_touched)
Plots TakeProfits and StopLoss achievement
Parameters:
ID (string)
darkTheme (bool)
useSignal (bool)
inLong (bool)
inShort (bool)
TP1_touched (bool)
TP2_touched (bool)
TP3_touched (bool)
TP4_touched (bool)
TP5_touched (bool)
TP6_touched (bool)
SL_touched (bool)
Returns: PLOTS
เอกสารเผยแพร่:
v15
เอกสารเผยแพร่:
v16
Updated:
plot_tpz(darkTheme, useSignal, inLong, inShort, TP1_touched, TP2_touched, TP3_touched, TP4_touched, TP5_touched, TP6_touched, SL_touched)
Plots TakeProfits and StopLoss achievement
Parameters:
darkTheme (bool)
useSignal (bool)
inLong (bool)
inShort (bool)
TP1_touched (bool)
TP2_touched (bool)
TP3_touched (bool)
TP4_touched (bool)
TP5_touched (bool)
TP6_touched (bool)
SL_touched (bool)
Returns: PLOTS
Updated:
plot_tpz(darkTheme, useSignal, inLong, inShort, TP1_touched, TP2_touched, TP3_touched, TP4_touched, TP5_touched, TP6_touched, SL_touched)
Plots TakeProfits and StopLoss achievement
Parameters:
darkTheme (bool)
useSignal (bool)
inLong (bool)
inShort (bool)
TP1_touched (bool)
TP2_touched (bool)
TP3_touched (bool)
TP4_touched (bool)
TP5_touched (bool)
TP6_touched (bool)
SL_touched (bool)
Returns: PLOTS
เอกสารเผยแพร่:
v17
Added:
Draw_Session_Switch_candle(colorSess, route_cond, newDaySession, newsessionPerc, separateDays, Day_Bg, route_color2, retxt_color, low_route, high_route, dailyLow, dailyHigh)
Draw_Session_Switch_candle is designed to draw session switch indicators on a chart.
Parameters:
colorSess (bool)
route_cond (bool)
newDaySession (bool)
newsessionPerc (float)
separateDays (bool)
Day_Bg (color)
route_color2 (color)
retxt_color (string)
low_route (float)
high_route (float)
dailyLow (float)
dailyHigh (float)
Added:
Draw_Session_Switch_candle(colorSess, route_cond, newDaySession, newsessionPerc, separateDays, Day_Bg, route_color2, retxt_color, low_route, high_route, dailyLow, dailyHigh)
Draw_Session_Switch_candle is designed to draw session switch indicators on a chart.
Parameters:
colorSess (bool)
route_cond (bool)
newDaySession (bool)
newsessionPerc (float)
separateDays (bool)
Day_Bg (color)
route_color2 (color)
retxt_color (string)
low_route (float)
high_route (float)
dailyLow (float)
dailyHigh (float)
เอกสารเผยแพร่:
v18
Updated:
quick_tp_check(goLong, goShort, entry, tp1, tp2, tp3, tp4, tp5, tp6, sl)
Track TakeProfits and StopLoss achievement for one or many of your buy/sell conditions. CHECK the commented section: "Function @manageTrade" (lines: 14 - 64) for Description
Parameters:
goLong (bool)
goShort (bool)
entry (float)
tp1 (float)
tp2 (float)
tp3 (float)
tp4 (float)
tp5 (float)
tp6 (float)
sl (float)
Returns: TP_achievment status for 6 tps:
Updated:
quick_tp_check(goLong, goShort, entry, tp1, tp2, tp3, tp4, tp5, tp6, sl)
Track TakeProfits and StopLoss achievement for one or many of your buy/sell conditions. CHECK the commented section: "Function @manageTrade" (lines: 14 - 64) for Description
Parameters:
goLong (bool)
goShort (bool)
entry (float)
tp1 (float)
tp2 (float)
tp3 (float)
tp4 (float)
tp5 (float)
tp6 (float)
sl (float)
Returns: TP_achievment status for 6 tps:
เอกสารเผยแพร่:
v19
เอกสารเผยแพร่:
v20
เอกสารเผยแพร่:
v21
Removed:
quick_tp_check(goLong, goShort, entry, tp1, tp2, tp3, tp4, tp5, tp6, sl)
Track TakeProfits and StopLoss achievement for one or many of your buy/sell conditions. CHECK the commented section: "Function @manageTrade" (lines: 14 - 64) for Description
Removed:
quick_tp_check(goLong, goShort, entry, tp1, tp2, tp3, tp4, tp5, tp6, sl)
Track TakeProfits and StopLoss achievement for one or many of your buy/sell conditions. CHECK the commented section: "Function @manageTrade" (lines: 14 - 64) for Description
เอกสารเผยแพร่:
v22
เอกสารเผยแพร่:
v23
เอกสารเผยแพร่:
v24
Added:
quick_tp_check(goLong, goShort, entry, tp1, tp2, tp3, tp4, tp5, tp6, sl)
Track TakeProfits and StopLoss achievement for one or many of your buy/sell conditions. CHECK the commented section: "Function @manageTrade" (lines: 14 - 64) for Description
Parameters:
goLong (bool)
goShort (bool)
entry (float)
tp1 (float)
tp2 (float)
tp3 (float)
tp4 (float)
tp5 (float)
tp6 (float)
sl (float)
Returns: TP_achievment status for 6 tps:
Added:
quick_tp_check(goLong, goShort, entry, tp1, tp2, tp3, tp4, tp5, tp6, sl)
Track TakeProfits and StopLoss achievement for one or many of your buy/sell conditions. CHECK the commented section: "Function @manageTrade" (lines: 14 - 64) for Description
Parameters:
goLong (bool)
goShort (bool)
entry (float)
tp1 (float)
tp2 (float)
tp3 (float)
tp4 (float)
tp5 (float)
tp6 (float)
sl (float)
Returns: TP_achievment status for 6 tps:
เอกสารเผยแพร่:
v25
Updated:
Draw_Session_Switch_candle(colorSess, route_cond, newDaySession, newsessionPerc, separateDays, Day_Bg, route_color2, retxt_color, low_route, high_route, dailyLow, dailyHigh, linewidth_nwday, linewidth_nwsessCande)
Draw_Session_Switch_candle is designed to draw session switch indicators on a chart.
Parameters:
colorSess (bool)
route_cond (bool)
newDaySession (bool)
newsessionPerc (float)
separateDays (bool)
Day_Bg (color)
route_color2 (color)
retxt_color (string)
low_route (float)
high_route (float)
dailyLow (float)
dailyHigh (float)
linewidth_nwday (int)
linewidth_nwsessCande (int)
Updated:
Draw_Session_Switch_candle(colorSess, route_cond, newDaySession, newsessionPerc, separateDays, Day_Bg, route_color2, retxt_color, low_route, high_route, dailyLow, dailyHigh, linewidth_nwday, linewidth_nwsessCande)
Draw_Session_Switch_candle is designed to draw session switch indicators on a chart.
Parameters:
colorSess (bool)
route_cond (bool)
newDaySession (bool)
newsessionPerc (float)
separateDays (bool)
Day_Bg (color)
route_color2 (color)
retxt_color (string)
low_route (float)
high_route (float)
dailyLow (float)
dailyHigh (float)
linewidth_nwday (int)
linewidth_nwsessCande (int)
เอกสารเผยแพร่:
v26
Added:
calculateExpectedGrowth(riskRewardRatio, winRate, riskPerTrade, tradesPerDay, tradingDaysPerMonth)
Expected Growth Calculation
Parameters:
riskRewardRatio (int)
winRate (float)
riskPerTrade (float)
tradesPerDay (int)
tradingDaysPerMonth (int)
Returns: float expectedGrowthPerMonth
Updated:
strategy_table(showTable, darkTheme, riskRewardRatio, winRate, riskPerTrade, tradesPerDay, tradingDaysPerMonth)
if strategy return table strategy table
Parameters:
showTable (bool)
darkTheme (bool)
riskRewardRatio (int)
winRate (float)
riskPerTrade (float)
tradesPerDay (int)
tradingDaysPerMonth (int)
Returns: table strategy table
Added:
calculateExpectedGrowth(riskRewardRatio, winRate, riskPerTrade, tradesPerDay, tradingDaysPerMonth)
Expected Growth Calculation
Parameters:
riskRewardRatio (int)
winRate (float)
riskPerTrade (float)
tradesPerDay (int)
tradingDaysPerMonth (int)
Returns: float expectedGrowthPerMonth
Updated:
strategy_table(showTable, darkTheme, riskRewardRatio, winRate, riskPerTrade, tradesPerDay, tradingDaysPerMonth)
if strategy return table strategy table
Parameters:
showTable (bool)
darkTheme (bool)
riskRewardRatio (int)
winRate (float)
riskPerTrade (float)
tradesPerDay (int)
tradingDaysPerMonth (int)
Returns: table strategy table
เอกสารเผยแพร่:
v27
เอกสารเผยแพร่:
v28
เอกสารเผยแพร่:
v29
Updated:
added one more TP mode
TP_SL_math(tpType, useTp2, useTp3, useTp4, useTp5, useTp6, rr_pt, reward, tp1x, tp2x, tp3x, tp4x, tp5x, tp6x, slr, perc_from_sl)
TP_SL_MATH
Parameters:
tpType (string)
useTp2 (bool)
useTp3 (bool)
useTp4 (bool)
useTp5 (bool)
useTp6 (bool)
rr_pt (float)
reward (float)
tp1x (float)
tp2x (float)
tp3x (float)
tp4x (float)
tp5x (float)
tp6x (float)
slr (float)
perc_from_sl (float)
Returns: PLOTS
Updated:
added one more TP mode
TP_SL_math(tpType, useTp2, useTp3, useTp4, useTp5, useTp6, rr_pt, reward, tp1x, tp2x, tp3x, tp4x, tp5x, tp6x, slr, perc_from_sl)
TP_SL_MATH
Parameters:
tpType (string)
useTp2 (bool)
useTp3 (bool)
useTp4 (bool)
useTp5 (bool)
useTp6 (bool)
rr_pt (float)
reward (float)
tp1x (float)
tp2x (float)
tp3x (float)
tp4x (float)
tp5x (float)
tp6x (float)
slr (float)
perc_from_sl (float)
Returns: PLOTS
Scripts that I post publicly are experimental. They are not financial advices. Always backtest your ideas using your own methodologies.
automate your alert: signalautotrade.com
contact me directly on telegram: @Sosso_bott
automate your alert: signalautotrade.com
contact me directly on telegram: @Sosso_bott