• Get $40 off VIP by signing up for a free account! Sign Up

Locking in Profits sooner so i keep most profits before they erode

westgl

New member
I have been working on a system of trading for years. The best I have come up with is using Multiple Hull MAs together, I use them for when the Cross each other.

I wish I were any good at writing script.

Here is how I Lock in profits for when a setup appears.

First all Hull MAs are colored different so I can tell them apart.

I use a Hull 15 Cross above the Hull 34 Hull as a Long Entry setup on a 5 Minute chart.
I use the "Market Forecast" in a "Over sold" condition for the Entry Long.
that was the entry.

Problem is the EXIT,
when the Price starts to move down the profit can Move out of it VERY QUICKLY!!!!! so Locking in that profit as early as Possible is VITAL!!!!
Heres how I do it.

For the Exit,
1. I look at the Hull 15 for a change,
2. I look for a Gold SAR break this Gold SAR Break is timed at .02 .20
That is the Exit,
and /OR you can use the 34 Hull to Cross Below the Hull 15, with a GOLD SAR Break, this is a great exit

I take some Substantial profits this way.

I use two watch Lists that tell me when the setups are Ready, one is based on Daily and Hourly Columns, the Other is Intra day 5 min and Hourly Columns
 
Last edited:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

today I took 24K profit on /GC and 35K profit on /SI using this setup. I take profits like this almost every day, mostly 5k to 10k a day. I trade Most all the Futures contracts due to them being leveraged.
 
I also Look at the Hull 89 as a Trend Change tool. If the Price Locks in above the Hull 89 then you have a trend change, I watch the Market Forecast for Oversold conditions to take trades. I like to KNOW what the Trend Momentum is on both the Longer trend Daily charts and the Intraday, that way I have a MUCH Higher Percentage of Probability taking a successful trade, that has Momentum going in the right direction a Very High percentage of the time.
 
I put your strategy into a candle painting "impulse" system and also a strategy for backtesting purposes. I did not know what you consider as overbought/oversold in market forecast though however so I omitted that portion but it can be added. Also I am not sure if this is meant to be a long only strategy or not, so for backtesting purposes you can simply change Order3 to Sell to Close for accurate "Long only"results.

Study:

Code:
#ImpulseHullGC based on westgl strategy
#Created by Tradebyday


input length1 = 15;
input length2 = 34;
input accelerationFactor = 0.02;
input accelerationLimit = 0.2;
input paintBars = yes;

def HMA15 = MovingAverage(AverageType.HULL, close, length1);
def HMA34 = MovingAverage(AverageType.HULL, close, length2);

#
# TD Ameritrade IP Company, Inc. (c) 2008-2020
#

assert(accelerationFactor > 0, "'acceleration factor' must be positive: " + accelerationFactor);
assert(accelerationLimit >= accelerationFactor, "'acceleration limit' (" + accelerationLimit + ") must be greater than or equal to 'acceleration factor' (" + accelerationFactor + ")");

def state = {default init, long, short};
def extreme;
def SAR;
def acc;

switch (state[1]) {
case init:
    state = state.long;
    acc = accelerationFactor;
    extreme = high;
    SAR = low;
case short:
    if (SAR[1] < high)
    then {
        state = state.long;
        acc = accelerationFactor;
        extreme = high;
        SAR = extreme[1];
    } else {
        state = state.short;
        if (low < extreme[1])
        then {
            acc = min(acc[1] + accelerationFactor, accelerationLimit);
            extreme = low;
        } else {
            acc = acc[1];
            extreme = extreme[1];
        }
        SAR = max(max(high, high[1]), SAR[1] + acc * (extreme - SAR[1]));
    }
case long:
    if (SAR[1] > low)
    then {
        state = state.short;
        acc = accelerationFactor;
        extreme = low;
        SAR = extreme[1];
    } else {
        state = state.long;
        if (high > extreme[1])
        then {
            acc = min(acc[1] + accelerationFactor, accelerationLimit);
            extreme = high;
        } else {
            acc = acc[1];
            extreme = extreme[1];
        }
        SAR = min(min(low, low[1]), SAR[1] + acc * (extreme - SAR[1]));
    }
}

plot parSAR = SAR;
parSAR.SetPaintingStrategy(PaintingStrategy.POINTS);
parSAR.SetDefaultColor(GetColor(5));

def GreenPrice = HMA15 > HMA34 and close > parSAR;
def RedPrice = HMA15 < HMA34 and close < parSAR;

plot Bullish = GreenPrice;
plot Neutral = !GreenPrice and !RedPrice;
plot Bearish = RedPrice;

Bullish.SetDefaultColor(Color.UPTICK);
Bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bullish.SetLineWeight(3);
Bullish.Hide();
Neutral.SetDefaultColor(Color.BLUE);
Neutral.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Neutral.SetLineWeight(3);
Neutral.Hide();
Bearish.SetDefaultColor(Color.DOWNTICK);
Bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bearish.SetLineWeight(3);
Bearish.Hide();

DefineGlobalColor("Bullish", Color.UPTICK);
DefineGlobalColor("Neutral", Color.GRAY);
DefineGlobalColor("Bearish", Color.DOWNTICK);
AssignPriceColor(if !paintBars then Color.CURRENT else if GreenPrice then GlobalColor("Bullish") else if RedPrice then GlobalColor("Bearish") else GlobalColor("Neutral"));

Strategy:

Code:
#ImpulseHullGC based on westgl strategy
#Created by Tradebyday


input length1 = 15;
input length2 = 34;
input accelerationFactor = 0.02;
input accelerationLimit = 0.2;
input paintBars = yes;

def HMA15 = MovingAverage(AverageType.HULL, close, length1);
def HMA34 = MovingAverage(AverageType.HULL, close, length2);

#
# TD Ameritrade IP Company, Inc. (c) 2008-2020
#

assert(accelerationFactor > 0, "'acceleration factor' must be positive: " + accelerationFactor);
assert(accelerationLimit >= accelerationFactor, "'acceleration limit' (" + accelerationLimit + ") must be greater than or equal to 'acceleration factor' (" + accelerationFactor + ")");

def state = {default init, long, short};
def extreme;
def SAR;
def acc;

switch (state[1]) {
case init:
    state = state.long;
    acc = accelerationFactor;
    extreme = high;
    SAR = low;
case short:
    if (SAR[1] < high)
    then {
        state = state.long;
        acc = accelerationFactor;
        extreme = high;
        SAR = extreme[1];
    } else {
        state = state.short;
        if (low < extreme[1])
        then {
            acc = min(acc[1] + accelerationFactor, accelerationLimit);
            extreme = low;
        } else {
            acc = acc[1];
            extreme = extreme[1];
        }
        SAR = max(max(high, high[1]), SAR[1] + acc * (extreme - SAR[1]));
    }
case long:
    if (SAR[1] > low)
    then {
        state = state.short;
        acc = accelerationFactor;
        extreme = low;
        SAR = extreme[1];
    } else {
        state = state.long;
        if (high > extreme[1])
        then {
            acc = min(acc[1] + accelerationFactor, accelerationLimit);
            extreme = high;
        } else {
            acc = acc[1];
            extreme = extreme[1];
        }
        SAR = min(min(low, low[1]), SAR[1] + acc * (extreme - SAR[1]));
    }
}

plot parSAR = SAR;
parSAR.SetPaintingStrategy(PaintingStrategy.POINTS);
parSAR.SetDefaultColor(GetColor(5));

def GreenPrice = HMA15 > HMA34 and close > parSAR;
def RedPrice = HMA15 < HMA34 and close < parSAR;

plot Bullish = GreenPrice;
plot Neutral = !GreenPrice and !RedPrice;
plot Bearish = RedPrice;

Bullish.SetDefaultColor(Color.UPTICK);
Bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bullish.SetLineWeight(3);
Bullish.Hide();
Neutral.SetDefaultColor(Color.BLUE);
Neutral.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Neutral.SetLineWeight(3);
Neutral.Hide();
Bearish.SetDefaultColor(Color.DOWNTICK);
Bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bearish.SetLineWeight(3);
Bearish.Hide();

DefineGlobalColor("Bullish", Color.UPTICK);
DefineGlobalColor("Neutral", Color.GRAY);
DefineGlobalColor("Bearish", Color.DOWNTICK);
AssignPriceColor(if !paintBars then Color.CURRENT else if GreenPrice then GlobalColor("Bullish") else if RedPrice then GlobalColor("Bearish") else GlobalColor("Neutral"));

addOrder(OrderType.BUY_AUTO, Bullish);
addOrder(OrderType.SELL_TO_CLOSE, Neutral);
addOrder(OrderType.SELL_AUTO, Bearish);
addOrder(OrderType.BUY_TO_CLOSE, Neutral);
 

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
231 Online
Create Post

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top