Pinnacle Momentum Algo
Pinnacle Momentum Algo
if strategy.position_size == 0
tradeClosed := true
//
***********************************************************************************
***********************************************************************************
***********************************************************************************
****************
// MONTHLY TABLE PERFORMANCE - Developed by @QuantNomad
//
***********************************************************************************
***********************************************************************************
***********************************************************************************
****************
// DASHBOARD PERFORMANCE TABLE//
i_tableTextSize = input.string(title = 'Dashboard Size', defval = 'Small', options
= ['Auto', 'Huge', 'Large', 'Normal', 'Small', 'Tiny'], group = 'Dashboards')
table_text_size(s) =>
switch s
'Auto' => size.auto
'Huge' => size.huge
'Large' => size.large
'Normal' => size.normal
'Small' => size.small
=> size.tiny
tableTextSize = table_text_size(i_tableTextSize)
if newWin
lossRow := 0
winRow := winRow + 1
winRow
if winRow > maxWinRow
maxWinRow := winRow
maxWinRow
if newLoss
winRow := 0
lossRow := lossRow + 1
lossRow
if lossRow > maxLossRow
maxLossRow := lossRow
maxLossRow
if barstate.islastconfirmedhistory
// Update table
dollarReturn = strategy.netprofit
f_fillCell(dashTable, 0, 0, 'Start:', str.format('{0,date,long}',
strategy.closedtrades.entry_time(0)), bgcolor, color.white) // + str.format("
{0,time,HH:mm}", strategy.closedtrades.entry_time(0))
f_fillCell(dashTable, 0, 1, 'End:', str.format('{0,date,long}',
strategy.opentrades.entry_time(0)), bgcolor, color.white) // + str.format("
{0,time,HH:mm}", strategy.opentrades.entry_time(0))
_profit = strategy.netprofit / strategy.initial_capital * 100
f_fillCell(dashTable, 0, 2, 'Net Profit:', str.tostring(_profit, '##.##') +
'%', _profit > 0 ? color.teal : color.maroon, color.white)
_numOfDaysInStrategy = (strategy.opentrades.entry_time(0) -
strategy.closedtrades.entry_time(0)) / (1000 * 3600 * 24)
f_fillCell(dashTable, 0, 3, 'Percent Per Day', str.tostring(_profit /
_numOfDaysInStrategy, '#########################.#####') + '%', _profit > 0 ?
color.teal : color.maroon, color.white)
_winRate = strategy.wintrades / strategy.closedtrades * 100
f_fillCell(dashTable, 0, 4, 'Percent Profitable:', str.tostring(_winRate,
'##.##') + '%', _winRate < 50 ? color.maroon : _winRate < 75 ? #999900 :
color.teal, color.white)
f_fillCell(dashTable, 0, 5, 'Profit Factor:',
str.tostring(strategy.grossprofit / strategy.grossloss, '##.###'),
strategy.grossprofit > strategy.grossloss ? color.teal : color.maroon, color.white)
f_fillCell(dashTable, 0, 6, 'Total Trades:',
str.tostring(strategy.closedtrades), bgcolor, color.white)
f_fillCell(dashTable, 0, 8, 'Max Wins In A Row:', str.tostring(maxWinRow,
'######'), bgcolor, color.white)
f_fillCell(dashTable, 0, 9, 'Max Losses In A Row:',
str.tostring(maxLossRow, '######'), bgcolor, color.white)