Shadow Diver

TWM

Extensions


FREE

SHADOW DIVER

Pullback strategy

Strategies

This algorithmic strategy is designed to capture momentum reversals near a key moving average. It waits for strong confirmation signals before entering a trade and uses clearly defined risk and profit management rules.

The strategy monitors price behavior relative to a moving average line. When conditions indicate that the price is bouncing off this line with strong momentum and temporary dips or spikes, it places a stop-market order slightly above or below the recent high or low to catch the breakout. Once the trade is entered, it automatically sets a take-profit and stop-loss level, canceling any opposing orders once one of them is filled

Description

πŸ” Detailed Logic of Entry and Exit

🟒 Entry Conditions (Going Long or Short)

The strategy evaluates the price action relative to a moving average over the last 3 bars and places an entry only when very specific conditions are met.

βœ… Long Entry Logic (Buy Setup)

The strategy enters a long position if:

  1. The last three closing prices are above the moving average
  2. β†’ Close[0] > MA, Close[1] > MA, Close[2] > MA
  3. β†’ Confirms short-term bullish momentum.
  4. The current candle's open is also above the moving average
  5. β†’ Additional bullish confirmation β€” the market opened strong.
  6. There was a recent dip below the moving average (a wick)
  7. β†’ Low[0] < MA and Low[1] < MA
  8. β†’ Suggests buying pressure defended the average.
  9. Two bars ago, the low stayed above the moving average
  10. β†’ Low[2] > MA
  11. β†’ Confirms price is holding the moving average.
  12. Volume switch (_vSwitch[0]) is above threshold (β‰₯ 0.5)
  13. β†’ Indicates that volume or a custom condition validates the entry.

If all above are true, it places a stop-market buy order at:

πŸ”Ό High[0] + EntryOffset Γ— TickSize

β†’ This ensures we only enter if the market breaks above the current high.

πŸ”΄ Short Entry Logic (Sell Setup)

A short position is entered when:

  1. The last three closes are below the moving average
  2. β†’ Close[0], Close[1], Close[2] all < MA
  3. β†’ Suggests downward trend.
  4. Current candle opened below the moving average
  5. β†’ Market opened weak.
  6. The highs of the last two candles went above the moving average
  7. β†’ High[0] > MA and High[1] > MA
  8. β†’ Indicates failed attempts to go higher (bearish wicks).
  9. Two bars ago, high was below the moving average
  10. β†’ High[2] < MA
  11. β†’ Reinforces bearish sentiment.
  12. Volume condition _vSwitch[0] β‰₯ 0.5
  13. β†’ Validates the signal.

If these are met, a stop-market short order is placed at:

πŸ”» Low[0] - EntryOffset Γ— TickSize

β†’ Enter only if price breaks recent lows.

⏳ Order Timeout Logic

Once an entry order is placed:

  1. It stays active for a maximum of KeepOrderBars bars.
  2. If not filled within this window, the order is automatically canceled to avoid outdated entries.

🧯 Exit Logic

Once in a position, the strategy manages risk and profit using predefined levels:

πŸ“‰ Stop-Loss

  1. For Long Trades:
  2. Stop = EntryPrice - (StopLoss% Γ— EntryPrice)
  3. For Short Trades:
  4. Stop = EntryPrice + (StopLoss% Γ— EntryPrice)

β†’ A stop-market order is placed to exit if price moves against us.

πŸ“ˆ Take-Profit

  1. For Long Trades:
  2. ProfitTarget = EntryPrice + (Profit% Γ— EntryPrice)
  3. For Short Trades:
  4. ProfitTarget = EntryPrice - (Profit% Γ— EntryPrice)

β†’ A limit order is used to close with a profit.

πŸ” Exit Order Coordination

  1. When one exit (stop or profit) is hit, the other is automatically canceled to avoid conflicting orders.
  2. Orders are also canceled if the position is manually closed using a market exit.

❌ Early Exit on Trend Reversal (Optional)

There's also a method (BelowMaExit) that can force an early exit if price crosses the moving average in the opposite direction:

  1. Long Position Exit: Close[0] < MA
  2. Short Position Exit: Close[0] > MA

β†’ This logic is currently not called in OnBarUpdate() but is available for future activation.

Main Features

Smart Trend Filtering

Trades only in conditions where price action confirms trend direction using a 3-bar check above or below a moving average.

Dynamic Entry Logic

Uses recent highs/lows and offsets to enter at likely breakout points instead of blindly jumping into the market.

Built-in Risk Management

Every position includes an automatic stop-loss and take-profit order based on percentages of entry price.

Order Time-to-Live Control

If an entry order is not filled within a predefined number of bars, it's automatically canceled to avoid stale entries.

FAQ

Do you have any more questions about our Extension? Let's see if we already have the answer. Please read the FAQ below.

A trend-following breakout strategy with pullback confirmation.

A single moving average is used for trend direction and as a reference point for price behavior.

It waits for 3 consecutive closes above or below the moving average, plus certain candle shapes like wicks piercing the average.

With stop-market orders placed slightly above highs (for longs) or below lows (for shorts).

It's canceled after a fixed number of bars to avoid late or irrelevant entries.

Yes, both are placed automatically based on configurable percentages of entry price.

No, it enters only when strict conditions are met and stays flat otherwise.

Similar extensions

TWM users have the opportunity to create their own strategies and indicators using the C# coding language.

This website uses cookies to enhance your browsing experience. By continuing to use our website, you agree to our Privacy Policy

Necessary cookies help make a website usable by enabling basic functions such as page navigation and access to protected areas of the site.

  • Necessary cookies

    .AspNet.Consent

    Indicates whether the user has consented to the use of necessary cookies.

    Maximum storage duration: 1 Year | Type:Necessary cookies
    .AspNetCore.Antiforgery

    Used to prevent CSRF attacks and protect user data.

    Maximum storage duration: Session | Type: Necessary cookies
    .AspNetCore.Cookies

    Used to manage authentication information and the user's session.

    Maximum storage duration: 1 Year | Type: Necessary cookies
    .AspNetCore.Culture

    Used to store user's language preferences.

    Maximum storage duration: 1 Year | Type: Necessary cookies
    __Secure-OSID

    Security cookie set by Google to authenticate users and prevent fraudulent use of login credentials.


    Maximum storage duration: 6 Months | Type: Necessary cookies
    __Host-3PLSID

    Ensures you stay connected to your Google accounts across various services.

    Maximum storage duration: 2 Years | Type: Necessary cookies
    AEC

    Used to verify your Google account and ensure that requests in sessions come from you.

    Maximum storage duration: 6 Months | Type: Necessary cookies
    HSID

    Security cookie used by Google to authenticate users and prevent fraudulent use of login credentials, protecting user data.

    Maximum storage duration: 2 Years | Type: Necessary cookies
    SEARCH_SAMESITE

    This cookie prevents the browser from sending the cookie along with cross-site requests, helping to mitigate the risk of cross-origin information leakage.

    Maximum storage duration: 6 Months | Type: Necessary cookies
    SID

    Important for Google's security and to ensure that Google can authenticate the account and block fraudulent access attempts.

    Maximum storage duration: 2 Years | Type: Necessary cookies
    SIDCC

    Security cookie to protect user data from unauthorized access.

    Maximum storage duration: 1 Year | Type: Necessary cookies
    __Host-1PLSID, __Host-3PLSID

    Crucial cookies to ensure that you remain securely logged into your Google accounts while accessing various Google services.

    Maximum storage duration: 2 Years | Type: Necessary cookies

Functional cookies allow the website to provide enhanced functionality and personalization. They may be set by the website owner or by third parties whose services have been added to the pages.

  • Functional Cookies

    LSOLH

    Used by Google to store session information and enhance the user's experience on Google services.


    Maximum storage duration: Session | Type: Functional Cookies
    COMPASS

    Used by Google to improve user navigation by remembering preferences and information, such as preferred language.

    Maximum storage duration: 6 Months | Type: Functional Cookies
    ACCOUNT_CHOOSER

    Remembers which accounts have been used to log into Google services on the device.

    Maximum storage duration: 1 Year | Type: Functional Cookies
    APISID

    Used by Google to store user preferences and information when viewing pages with Google maps.

    Maximum storage duration: 2 Years | Type: Functional Cookies
    LSID

    Used by Google to store user preferences while viewing pages that incorporate Google services.

    Maximum storage duration: 2 Years | Type: Functional Cookies
    NID

    Used by Google to remember user preferences, such as preferred language, to provide a more personalized experience.

    Maximum storage duration: 6 Months | Type: Functional Cookies
    SAPISID

    Used by Google to collect information about visitors for videos hosted on YouTube or maps integrated with Google Maps.

    Maximum storage duration: 2 Years | Type: Functional Cookies
    __Host-GAPS

    Used by Google to store user preferences and information when pages containing maps or Google services are viewed.

    Maximum storage duration: 2 Years | Type: Functional Cookies

Statistical cookies help website owners understand how visitors interact with the site by collecting and transmitting information anonymously.

  • Statistical Cookies

    CLID

    Unique identifier used to track user interactions and maintain unique sessions.


    Maximum storage duration: 1 Year | Type: Statistical Cookies
    MR

    Microsoft cookie that collects data on user interactions to improve services.

    Maximum storage duration: 7 days | Type: Statistical Cookies
    SM

    Used by the Microsoft Clarity analytics suite to maintain the user's session.

    Maximum storage duration: Session | Type: Statistical Cookies

Marketing cookies are used to track visitors on websites. The intent is to display relevant and engaging ads for the individual user.

  • Marketing Cookies

    AID

    Used by Google to link your activity across devices if you have logged in with the same Google account.


    Maximum storage duration: 1 Year | Type: Marketing Cookies
    ANONCHK

    Used by Microsoft Advertising to check the anonymity of data sent by tracking cookies.

    Maximum storage duration: 10 minutes | Type: Marketing Cookies
    MUID

    Microsoft cookie used to track user interactions across Microsoft domains.

    Maximum storage duration: 13 Months | Type: Marketing Cookies
    __Secure-3PSID, __Secure-3PAPISID, __Secure-3PSIDTS, __Secure-3PSIDCC

    Google cookies designed to build a profile of your preferences and show you relevant ads on other sites, protecting the Google account.

    Maximum storage duration: 2 Years | Type: Marketing Cookies
    ADS_VISITOR_ID

    Used by Google to identify and track visitors across various websites to display personalized advertising.

    Maximum storage duration: 2 Years | Type: Marketing Cookies
    OTZ

    Used by Google to personalize ads on Google properties, like Google Search.

    Maximum storage duration: 1 Month | Type: Marketing Cookies
    __Secure-1PAPISID, __Secure-1PSID

    Used by Google to deliver more relevant ads and protect the security of your preferences and Google account information.

    Maximum storage duration: 2 Years | Type: Marketing Cookies

Cookies are small text files that can be used by websites to make the user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies, we need your permission. This means that cookies classified as necessary are processed under Article 6(1)(f) of the GDPR. All other cookies, namely those belonging to the categories of preferences and marketing, are processed under Article 6(1)(a) of the GDPR.

This site uses different types of cookies. Some cookies are placed by third-party services that appear on our pages.

You can change or revoke your consent at any time from the Cookie Statement on our website.

Learn more about who we are, how you can contact us, and how we process personal data in our Privacy Policy.

Specify your consent ID and the date you contacted us regarding your consent.