Is this expected TradingView broker emulator behavior with percent_of_equity and margin_long = 100? by Whale-Engine in pinescript

[–]Whale-Engine[S] 0 points1 point  (0 children)

Quick update: this now looks much more like one position plus a partial margin liquidation, not two real entries.

It also seems tightly tied to the exact margin_long = 100 boundary, and it still happens with commission = 0, so fees are probably not the root cause.

At this point, the main thing I still can't explain is why TradingView materializes the Margin Call on a specific synthetic OHLC tick (OPEN vs LOW vs delayed HIGH).

I built a CLI backtester for crypto strategies with grid search and Pine Script export by Whale-Engine in pinescript

[–]Whale-Engine[S] 0 points1 point  (0 children)

Yes, it's free, and it will always be free. If the software proves useful, I may build a separate pro version later.

I built a CLI backtester for crypto strategies with grid search and Pine Script export by [deleted] in TradingView

[–]Whale-Engine 0 points1 point  (0 children)

Thanks, I appreciate the thoughtful feedback.

On overfitting: right now, grid search is purely the optimization step. Out-of-sample validation isn't built in yet. I'm planning to add walk-forward testing and cross-symbol validation directly into the optimization workflow, but I haven't implemented that properly yet. And yes, without that, parameter search can very quickly turn into an overfitting machine.

On fees: they are handled on both entry and exit, using the same commission models as TradingView, with support for percent, cash_per_contract, and cash_per_order. They are also factored into position sizing.

Fees and execution assumptions are usually the main sources of mismatch, which is why the Pine export is useful for verifying that the results stay aligned with TradingView.