Conversation
There was a problem hiding this comment.
Pull request overview
This PR ("Chore/ruleset protection") adds a branch protection ruleset for the marco_Tradeoperador branch, and simultaneously introduces a large batch of new files: ProfitChart NTSL trading indicator scripts, backtest robot strategies, backtest CSV result files, theoretical study documents, and VS Code settings. The PR description ("Ajuste de regra") is minimal and does not describe the full scope of the changes.
Changes:
- Adds a GitHub branch protection ruleset requiring PRs with 1 approving review for the
marco_Tradeoperadorbranch. - Adds ~50 NTSL indicator/strategy scripts (coloring rules and automated trading robots for the ProfitChart platform) and their backtest CSV results.
- Adds educational/theory markdown documents and a
.vscode/settings.jsonwith a machine-specific Python interpreter path.
Reviewed changes
Copilot reviewed 106 out of 207 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
.github/rulesets/marco_Tradeoperador.ruleset.json |
Adds branch protection ruleset (deletion, no force-push, required PR review) |
profit_estudos_cores/marco2026_IFR_top5/*.ntsl.txt |
New IFR-based visual coloring indicators for March 2026, top-5 variants |
profit_estudos_cores/fev_*.txt |
New visual coloring and analysis indicator scripts (VWAP, VSA, OBV, price action, etc.) |
automacao_backtests/IFR_RSI/**/*.txt |
IFR-based automated backtest strategy scripts (approved and rejected) |
automacao_backtests/IFR_RSI/resultadosAprovadosPorTimeframe/*.csv |
Backtest result CSV files — contain real account number and personal name |
automacao_backtests/IFR_RSI/*.txt |
Catalog and additional approved strategy files |
estudo_teorias/*.md |
Theory and educational documents on trading strategies |
.vscode/settings.json |
VS Code workspace settings with a hardcoded machine-specific Python path |
automacao_backtests/NeologicaProfitAPIbacktest.txt |
A personal note/question accidentally committed as a file |
estudo_teorias/0326_diarioDeBordo.md |
Empty placeholder file (only dash lines) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| corShakeout := RGB(0, 255, 0); // Verde (Sinal de Compra VSA) | ||
| corUpthrust := RGB(255, 0, 0); // Vermelho (Sinal de Venda VSA) | ||
| corCyan := RGB(0, 255, 0); // Verde (Compra Extrema/Clímax) | ||
| corFuchsia := RGB(255, 0, 0); // Vermelho (Venda Extrema/Clímax) |
There was a problem hiding this comment.
In fev_VSAassinaturaInstitucional.txt, corCyan and corFuchsia are assigned the same RGB values as corShakeout and corUpthrust respectively (RGB(0, 255, 0) and RGB(255, 0, 0)). The comments say these represent different states ("Compra Extrema/Clímax" vs. "Sinal de Compra VSA"), but since they share the same color, there is no visual differentiation between the standard VSA signal and the extreme/climax signal. This makes the "Priority 1 vs Priority 2" distinction visually meaningless. If differentiation is intended, the colors should be distinct (e.g., Cyan RGB(0, 255, 255) for corCyan and Magenta RGB(255, 0, 255) for corFuchsia).
| // Reset diário | ||
| if bNovoDia then | ||
| begin | ||
| iCruz2050Dia := 0; | ||
| iCruz50200Dia := 0; | ||
| end; | ||
|
|
||
| // Faixa horária de contagem | ||
| if ContarApenasHorarioRegular then | ||
| bDentroHorario := (iHoraHHMM >= HoraInicio) and (iHoraHHMM <= HoraFim) | ||
| else | ||
| bDentroHorario := True; | ||
|
|
||
| // Médias | ||
| fMME20 := MediaExp(PeriodoMME20, Close); | ||
| fMMA50 := Media(PeriodoMMA50, Close); | ||
| fMMA200 := Media(PeriodoMMA200, Close); | ||
|
|
||
| // Cruzamentos apenas dentro do mesmo dia (evita contar transição de pregão) | ||
| bCruz2050Alta := bMesmoDia and bDentroHorario and (fMME20 > fMMA50) and (fMME20[1] <= fMMA50[1]); | ||
| bCruz2050Baixa := bMesmoDia and bDentroHorario and (fMME20 < fMMA50) and (fMME20[1] >= fMMA50[1]); | ||
|
|
||
| bCruz50200Alta := bMesmoDia and bDentroHorario and (fMMA50 > fMMA200) and (fMMA50[1] <= fMMA200[1]); | ||
| bCruz50200Baixa := bMesmoDia and bDentroHorario and (fMMA50 < fMMA200) and (fMMA50[1] >= fMMA200[1]); | ||
|
|
||
| if (bCruz2050Alta or bCruz2050Baixa) then | ||
| iCruz2050Dia := iCruz2050Dia + 1; | ||
|
|
||
| if (bCruz50200Alta or bCruz50200Baixa) then | ||
| iCruz50200Dia := iCruz50200Dia + 1; |
There was a problem hiding this comment.
The fev_ContadorCruzamentosMedias.txt uses local integer variables iCruz2050Dia and iCruz50200Dia that are incremented each candle when a crossover is detected. In NTSL, local variables are re-initialized on every bar execution, so these counters will never accumulate across bars — they will always be 0 or 1. To persist state across bars, these must be declared as persistent/global variables (using var at the script/global scope rather than local scope), or the platform's persistence mechanism must be used. As written, the crossover counter will never exceed 1, making the Plot display of counts always show 0 or 1.
| Conta: 103166893 | ||
| Titular: Wesley Gomes Da Silva |
There was a problem hiding this comment.
The CSV files in resultadosAprovadosPorTimeframe/ contain personally identifiable information: account number (Conta: 103166893) and full name (Titular: Wesley Gomes Da Silva). Committing real brokerage account numbers and personal names to a (potentially public) repository is a serious security/privacy risk. These sensitive details should be anonymized or removed before merging.
| HoraAberturaFim(103000); | ||
| FatorVolumeAbertura(1.30); | ||
| FatorVolumeMeio(1.00); | ||
| MostrarTexto(true); | ||
|
|
||
| var | ||
| fIFR, fMediaVol, fFatorAtual : float; | ||
| iHoraHHMM, iHoraAberturaFimHHMM : Integer; | ||
| bVolumeOK, bCompra, bVenda : boolean; | ||
| cCompra, cVenda, cSemVolume, cNeutro : Integer; | ||
|
|
||
| begin | ||
| cCompra := RGB(0, 191, 255); | ||
| cVenda := RGB(138, 43, 226); | ||
| cSemVolume := RGB(255, 140, 0); | ||
| cNeutro := RGB(120, 120, 120); | ||
|
|
||
| iHoraHHMM := Time; | ||
| if iHoraHHMM > 2400 then | ||
| iHoraHHMM := Round(iHoraHHMM / 100); | ||
|
|
||
| iHoraAberturaFimHHMM := HoraAberturaFim; | ||
| if iHoraAberturaFimHHMM > 2400 then | ||
| iHoraAberturaFimHHMM := Round(iHoraAberturaFimHHMM / 100); |
There was a problem hiding this comment.
The HoraAberturaFim input parameter has a default value of 103000, which looks like it is intended to represent HHMMSS format (10:30:00). However, the conversion logic if iHoraHHMM > 2400 then iHoraHHMM := Round(iHoraHHMM / 100) only divides by 100 once, converting 103000 to 1030 (HHMM). This is correct IF the Time built-in returns HHMM. But if Time returns HHMMSS (a 6-digit value like 103000), then iHoraHHMM would only be converted to 1030 while Time itself (in the first branch where iHoraAtual > 2400) is also divided by 100, arriving at 1030. The comparison then works. However, the inconsistency between the 6-digit default input value and the HHMM comparison is confusing and potentially fragile. If Time returns pure HHMM (4-digit), then 103000 / 100 = 1030 is correct but the input name/default of 103000 is misleading. A clearer default like 1030 would avoid confusion.
| else if (iHora >= 17) and (iMinuto >= 50) then | ||
| begin | ||
| SetChartColor(cCorPerigo); | ||
| end |
There was a problem hiding this comment.
The fev_HorarioTurbulencia.txt indicator has a logic gap in Zone 3 (Fechamento/Leilão). The condition (iHora >= 17) and (iMinuto >= 50) will not correctly match all times at or after 17:50. For example, the time 17:00 will not match (iMinuto = 0, which is not >= 50), and 18:00 would match (iMinuto = 0 is not >= 50 either). The correct condition should be (iHora > 17) or ((iHora = 17) and (iMinuto >= 50)) to properly capture all times from 17:50 onwards.
| // --- 5. VISUALIZAÇÃO E ALARME --- | ||
| if bCompraAutorizada then | ||
| begin | ||
| PlotText('COMPRA AUTORIZADA', RGB(0, 255, 0), 12, 0, High * 1.01); | ||
| if not bCompraAutorizada[1] then PlaySound('Ring.wav'); | ||
| end | ||
| else if bVendaAutorizada then | ||
| begin | ||
| PlotText('VENDA AUTORIZADA', RGB(255, 0, 0), 12, 0, High * 1.01); | ||
| if not bVendaAutorizada[1] then PlaySound('Ring.wav'); | ||
| end | ||
| else | ||
| PlotText('AGUARDANDO CONFLUÊNCIA...', RGB(255, 255, 0), 10, 0, High * 1.01); | ||
| end; |
There was a problem hiding this comment.
The fev_PainelDecisao.txt indicator does not include any PaintBar call, so it will not colorize any candle on the price chart. All visual output is only via PlotText. This appears to be either an incomplete implementation (the indicator is described as a "painel visual") or the PaintBar call was unintentionally omitted. If candle coloring is intended, a PaintBar call should be added.
| "python.defaultInterpreterPath": "C:/Users/zilva/AppData/Local/Programs/Python/Python312/python.exe", | ||
| "chat.tools.terminal.autoApprove": { | ||
| "ForEach-Object": true, | ||
| "1..50": true | ||
| } | ||
| } |
There was a problem hiding this comment.
The .vscode/settings.json file commits a hardcoded, absolute path for the Python interpreter (C:/Users/zilva/AppData/Local/Programs/Python/Python312/python.exe). This is a machine-specific path that will not work for any other developer or CI environment. The python.defaultInterpreterPath setting should either be removed from the repository or replaced with a relative/workspace-relative path. Additionally, committing this exposes the local username (zilva) of the developer.
| "python.defaultInterpreterPath": "C:/Users/zilva/AppData/Local/Programs/Python/Python312/python.exe", | |
| "chat.tools.terminal.autoApprove": { | |
| "ForEach-Object": true, | |
| "1..50": true | |
| } | |
| } | |
| "chat.tools.terminal.autoApprove": { | |
| "ForEach-Object": true, | |
| "1..50": true | |
| } | |
| } |
| bSaida := (fIFR >= 48) and (fIFR <= 52); | ||
|
|
||
| if bCompra then | ||
| begin | ||
| PaintBar(cCompra); | ||
| if MostrarTexto then PlotText("V6 60 COMPRA", cCompra, 0, Low - (Range * 0.30)); | ||
| end | ||
| else if bVenda then | ||
| begin | ||
| PaintBar(cVenda); | ||
| if MostrarTexto then PlotText("V6 60 VENDA", cVenda, 0, High + (Range * 0.30)); | ||
| end | ||
| else if bSaida then | ||
| begin | ||
| PaintBar(cSaida); | ||
| end |
There was a problem hiding this comment.
In mar_IFR_01_v6_60min_saida_hibrida.ntsl.txt, the bSaida exit signal (IFR between 48 and 52) fires the PaintBar(cSaida) paint but there is no corresponding ClosePosition call. The indicator-only file only paints the bar, so this is expected for a coloring indicator. However, comparing with mar_IFR_04_v6_30min_saida_hibrida.ntsl.txt (the equivalent 30-minute version), neither closes a position — they are both visual indicators. That is consistent. Note however that bSaida is declared but only used for painting — not for an actual trade exit. The variable name bSaida ("exit") is potentially confusing in a visual indicator context, since no exit from a position occurs. Consider renaming to bZonaEquilibrio or similar to clarify intent.
| ----------------------------- | ||
| ----------------------------- | ||
| ----------------------------- | ||
| ----------------------------- | ||
| ----------------------------- | ||
| ----------------------------- | ||
| ----------------------------- | ||
| ----------------------------- | ||
| ----------------------------- | ||
| ----------------------------- | ||
| ----------------------------- | ||
| ----------------------------- | ||
| ----------------------------- | ||
| ----------------------------- | ||
| ----------------------------- | ||
| ----------------------------- | ||
| ----------------------------- | ||
| ----------------------------- |
There was a problem hiding this comment.
The estudo_teorias/0326_diarioDeBordo.md file contains only 18 lines of dashes (----) with no actual content. Committing an empty placeholder file with no content or context is not useful to the repository.
| bViésCompra, bViésVenda : boolean; | ||
|
|
||
| begin | ||
| fIFR := IFR(PeriodoIFR); | ||
|
|
||
| if Date <> Date[1] then | ||
| fPrecoRef := Open; | ||
|
|
||
| if Time = HoraReferencia then | ||
| fPrecoRef := Close; | ||
|
|
||
| bViésCompra := (Close > fPrecoRef); | ||
| bViésVenda := (Close < fPrecoRef); |
There was a problem hiding this comment.
The variable names bViésCompra and bViésVenda use a Portuguese accented character (é) in an identifier. While some languages allow unicode identifiers, this is an unusual convention and may cause issues depending on the character encoding of the source file when parsed by the ProfitChart NTSL interpreter. Using bViesCompra and bViesVenda (without accent) would be safer and more consistent with the rest of the codebase, where identifiers like bCompra and bVenda do not use accented characters.
Ajuste de regra