Strategy · Pine Script v5 · Own pane

MC Bias Strategy Example

by regalouisei

MC Bias Strategy Example is a Pine Script strategy designed to demonstrate automated trade execution driven by an external Markov Chain bias indicator.

View on GitHub

GitHub stars2on the repository
Pine versionv5runs as is
Lines of code4
Settings1inputs
LicenceNone stated
Last update8 months ago25 Feb 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

The script accepts a user-selected data source to determine directional bias and executes trades based on these probabilistic signals. It operates in a separate pane off the main price chart. Settings allow traders to configure the input source series. Because this is an example implementation, built-in risk controls such as stop loss and take profit targets are not explicitly defined.

Details

Published by

regalouisei on GitHub

Type

Strategy, Pine Script v5

Draws

Separate pane below the chart

Category

AI / machine learning, Trend

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • The strategy enters trades without a stop loss

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
MC Bias SourcesourceclosemcBias
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

This strategy implements a single-layer perceptron machine learning model built from scratch to generate trading signals directly on the price chart. It calculates predictions based on sample size, threshold settings, and optional volatility or volume filters.

Strategy v5 AI / machine learningTrend
Updated 1 year ago · None stated GitHub repository of Machine Learning: Perceptron-Based Strategy [5] (v.3)

Lastguru KNN A002

by ruckard
13 stars

This strategy applies k-nearest neighbors machine learning to fast and slow moving average crossovers to filter entry signals. It overlays directly on the price chart and incorporates built-in Zignaly alert triggers for automated execution. Traders can configu

Strategy v5 AI / machine learningMoving averages
Updated 1 year ago · None stated GitHub repository of Lastguru KNN A002

This strategy plots an ATR Chandelier trailing stop on the price chart and tracks a directional trend state. It marks confirmed flips, weak body-rejected flips, and wick traps, and colors bars as price nears warning or danger zones around the flip trigger. Ada

Strategy v6 TrendVolatility & bands
Updated yesterday · MIT GitHub repository of Chandelier Flip Radar [WavesUnchained]

This strategy fits a binary logistic regression classification model bar by bar on the price chart to generate long trading signals. It computes model weights via iterative gradient descent based on user-defined learning rates, lookback windows, and normalizat

Strategy v5 AI / machine learningTrend Repaints
Updated 2 weeks ago · MIT GitHub repository of Xsodus Logistic Long Regression Strategy
4 stars

This overlay strategy combines a Supertrend with a k-nearest-neighbors filter. It smooths price and the Supertrend with weighted moving averages, then uses neighbor count and lookback length to form an AI trend signal. Traders can allow long, short, or both di

Strategy v5 TrendVolatility & bands
Updated 2 years ago · None stated GitHub repository of AI Volume Supertrend Strategy

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers