Third eye • Strategy by RezzoRedPriest

By RezzoRedPriest

Performance Metrics

Description

Nov 28Third eye • Strategy – User Guide 1. Idea & ConceptThird eye • Strategy combines three things into one system:Ichimoku Cloud – to define market regime and support/resistance.Moving Average (trend filter) – to trade only in the dominant direction.CCI (Commodity Channel Index) – to generate precise entry signals on momentum breakouts.The script is a strategy, not an indicator: it can backtest entries, exits, SL, TP and BreakEven logic automatically.2. Indicators Used2.1 IchimokuStandard Ichimoku settings (by default 9/26/52/26) are used:Conversion Line (Tenkan-sen)Base Line (Kijun-sen)Leading Span A & B (Kumo Cloud)Lagging Span is calculated but hidden from the chart (for visual simplicity).From the cloud we derive:kumoTop – top of the cloud under current price.kumoBottom – bottom of the cloud under current price.Flags:is_above_kumo – price above the cloud.is_below_kumo – price below the cloud.is_in_kumo – price inside the cloud.These conditions are used as trend / regime filters and for stop-loss & trailing stops.2.2 Moving AverageYou can optionally display and use a trend MA:Types: SMA, EMA, DEMA, WMALength: configurable (default 200)Source: default closeFilter idea:If MA Direction Filter is ON:When Close > MA → strategy allows only Long signals.When Close upper_thresholdShort signal:CCI crosses down through the lower thresholdcci_val[1] > lower_threshold and cci_val cloud top.Short Cloud Filter – when enabled:Short trades only if close MA → only Longs.Close < MA → only Shorts.4. Anti-Re-Entry Logic (Cloud Touch Reset)The strategy uses internal flags to avoid continuous re-entries in the same direction without a reset.Two flags:allowLongallowShortAfter a Long entry, allowLong is set to false, allowShort to true.After a Short entry, allowShort is set to false, allowLong to true.Flags are reset when price touches the Kumo:If Low goes into the cloud → allowLong = trueIf High goes into the cloud → allowShort = trueIf Close is inside the cloud → both allowLong and allowShort are set to trueThere is a key option:Wait Position Close Before Flag ResetIf ON: cloud touch will reset flags only when there is no open position.If OFF: flags can be reset even while a trade is open.This gives a kind of regime-based re-entry control: after a trend leg, you wait for a “cloud interaction” to allow new signals.5. Risk ManagementAll risk management is handled inside the strategy.5.1 Position SizingOrder Size % of Equity – default 10%The strategy calculates:position_value = equity * (Order Size % / 100)position_qty = position_value / closeSo position size automatically adapts to your current equity.5.2 Take Profit ModesYou can choose one of two TP modes:PercentFibonacci5.2.1 Percent ModeSingle Take Profit at X% from entry (default 2%).For Long:TP = entry_price * (1 + tp_pct / 100)For Short:TP = entry_price * (1 - tp_pct / 100)One strategy.exit per side is used: "Long TP/SL" and "Short TP/SL".5.2.2 Fibonacci Mode (2 partial TPs)In this mode, TP levels are based on a virtual Fib-style extension between entry and stop-loss.Inputs:Fib TP1 Level (default 1.618)Fib TP2 Level (default 2.5)TP1 Share % (Fib) (default 50%)TP2 share is automatically 100% - TP1 share.Process for Long:Compute a reference Stop (see SL section below) → sl_for_fib.Compute distance: dist = entry_price - sl_for_fib.TP levels:TP1 = entry_price + dist * (Fib TP1 Level - 1)TP2 = entry_price + dist * (Fib TP2 Level - 1)For Short, the logic is mirrored.Two exits are used:TP1 – closes TP1 share % of position.TP2 – closes remaining TP2 share %.Same stop is used for both partial exits.5.3 Stop-Loss ModesYou can choose one of three Stop Loss modes:Stable – fixed % from entry.Ichimoku – fixed level derived from the Kumo.Ichimoku Trailing – dynamic SL following the cloud.5.3.1 Stable SLFor Long:SL = entry_price * (1 - Stable SL % / 100)For Short:SL = entry_price * (1 + Stable SL % / 100)Used both for Percent TP mode and as reference for Fib TP if Kumo is not available.5.3.2 Ichimoku SL (fixed, non-trailing)At the time of a new trade:For Long:Base SL = cloud bottom minus small offset (%)For Short:Base SL = cloud top plus small offset (%)The offset is configurable: Ichimoku SL Offset %.Once computed, that SL level is fixed for this trade.5.3.3 Ichimoku Trailing SLSimilar to Ichimoku SL, but recomputed each bar:For Long:SL = cloud bottom – offsetFor Short:SL = cloud top + offsetA red trailing SL line is drawn on the chart to visualize current stop level.This trailing SL is also used as reference for BreakEven and for Fib TP distance.6. BreakEven Logic (with BE Lines)BreakEven is optional and supports two modes:PercentFibonacciInputs:Percent mode:BE Trigger % (from entry) – move SL to BE when price goes this % in profit.BE Offset % from entry – SL will be set to entry ± this offset.Fibonacci mode:BE Fib Level – Fib level at which BE will be activated (default 1.618, same style as TP).BE Offset % from entry – how far from entry to place BE stop.The logic:Before BE is triggered, SL follows its normal mode (Stable/Ichimoku/Ichimoku Trailing).When BE triggers:For Long:New SL = max(current SL, BE SL).For Short:New SL = min(current SL, BE SL).This means BE will never loosen the stop – only tighten it.When BE is activated, the strategy draws a violet horizontal line at the BreakEven level (once per trade).BE state is cleared when the position is closed or when a new position is opened.7. Entry & Exit Logic (Summary)7.1 Long EntryConditions for a Long:CCI signal:CCI crosses up through the upper threshold.Ichimoku Cloud Filter (optional):If enabled → price must be above the Kumo.Ichimoku Lines Filter (optional):If enabled → Conversion Line and Base Line must be above the Kumo.MA Direction Filter (optional):If enabled → Close must be above the chosen MA.Anti-re-entry flag:allowLong must be true (cloud-based reset).Position check:Long entries are allowed when current position size ≤ 0 (so it can also reverse from short to long).If all these conditions are true, the strategy sends:strategy.entry("Long", strategy.long, qty = calculated_qty)After entry:allowLong = falseallowShort = true7.2 Short EntrySame structure, mirrored:CCI signal:CCI crosses down through the lower threshold.Cloud filter: price must be below cloud (if enabled).Lines filter: conversion & base must be below cloud (if enabled).MA filter: Close must be below MA (if enabled).allowShort must be true.Position check: position size ≥ 0 (allows reversal from long to short).Then:strategy.entry("Short", strategy.short, qty = calculated_qty)Flags update:allowShort = falseallowLong = true7.3 ExitsWhile in a position:The strategy continuously recalculates SL (depending on chosen mode) and, in Percent mode, TP.In Fib mode, fixed TP levels are computed at entry.BreakEven may raise/tighten the SL if its conditions are met.Exits are executed via strategy.exit:Percent mode: one TP+SL exit per side.Fib mode: two partial exits (TP1 and TP2) sharing the same SL.At position open, the script also draws visual lines:White line — entry price.Green line(s) — TP level(s).Red line — SL (if not using Ichimoku Trailing; with trailing, the red line is updated dynamically).Maximum of 30 lines are kept to avoid clutter.8. How to Use the StrategyChoose market & timeframeWorks well on trending instruments. Try crypto, FX or indices on H1–H4, or intraday if you prefer more trades.Adjust Ichimoku settingsKeep defaults (9/26/52/26) or adapt to your timeframe.Configure Moving AverageTypical: EMA 200 as a trend filter.Turn MA Direction Filter ON if you want to trade only with the main trend.Set CCI thresholdsDefault ±100 is classic.Lower thresholds → more signals, higher noise.Higher thresholds → fewer but stronger signals.Enable/disable filtersTurn on Ichimoku Cloud and Ichimoku Lines if you want only “clean” trend trades.Use Wait Position Close Before Flag Reset to control how often re-entries are allowed.Choose TP & SL modePercent mode is simpler and easier to understand.Fibonacci mode is more advanced: it aligns TP levels with the distance to stop, giving asymmetric RR setups (two partial TPs).Choose Stable SL for fixed-risk trades, or Ichimoku / Ichimoku Trailing to tie stops to the cloud structure.Set BreakEvenEnable BE if you want to lock in risk-free trades after a certain move.Percent mode is straightforward; Fib mode keeps BreakEven in harmony with your Fib TP setup.Run Backtest & OptimizePress “Add to chart” → go to Strategy Tester.Adjust parameters to your market and timeframe.Look at equity curve, PF, drawdown, average trade, etc.Live / Paper TradingAfter you’re satisfied with backtest results, use the strategy to generate signals.You can mirror entries/exits manually or connect them to alerts (if you build an alert-based execution layer).Release NotesV3.Updated version with some filter added. You can watch, how to use in my Telegram or YouTube

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView