# New here, simple request

##### New member
Hello, just discovered this forum today, and I find it very interesting!
I would like help with creating the following in ThinkScript:

TRIX have a length of 10
ChaikinMoneyFlow length is 14
StochRSI and StochasticFull K period is 14 and D period is 3
DMI length is 14 for DI+ and DI- calculations

Display an arrow up GREEN BUY signal on the chart when:

(close>open and DI+>DI+[1] and (StochasticFull(K)<100 or ChaikinMoneyFlow>0 or (DI+ crosses above DI-)) and MACDdiff>0 and StochasticFull(K) > StochasticFull(D) and StochasticFull(K)>40 and StochRSI(K)>StochRSI(D) and ((ChaikinMoneyFlow > 0 and ChaikingMoneyFlow[1]<ChaikinMoneyFlow) or (ChaikinMoneyFlow crosses above 0) and TRIX<0)

Display an arrow down RED SELL signal when the opposite happens

Thank you so much!

Last edited:
Solution
Hello, just discovered this forum today, and I find it very interesting!
I would like help with creating the following in ThinkScript:

TRIX have a length of 10
ChaikinMoneyFlow length is 14
StochRSI and StochasticFull K period is 14 and D period is 3
DMI length is 14 for DI+ and DI- calculations

Display an arrow up GREEN BUY signal on the chart when:

(close>open and DI+>DI+[1] and (StochasticFull(K)<100 or ChaikinMoneyFlow>0 or (DI+ crosses above DI-)) and MACDdiff>0 and StochasticFull(K) > StochasticFull(D) and StochasticFull(K)>40 and StochRSI(K)>StochRSI(D) and ((ChaikinMoneyFlow > 0 and ChaikingMoneyFlow[1]<ChaikinMoneyFlow) or (ChaikinMoneyFlow crosses above 0) and TRIX<0)

Display an arrow down RED SELL signal when the...
Hello, just discovered this forum today, and I find it very interesting!
I would like help with creating the following in ThinkScript:

TRIX have a length of 10
ChaikinMoneyFlow length is 14
StochRSI and StochasticFull K period is 14 and D period is 3
DMI length is 14 for DI+ and DI- calculations

Display an arrow up GREEN BUY signal on the chart when:

(close>open and DI+>DI+[1] and (StochasticFull(K)<100 or ChaikinMoneyFlow>0 or (DI+ crosses above DI-)) and MACDdiff>0 and StochasticFull(K) > StochasticFull(D) and StochasticFull(K)>40 and StochRSI(K)>StochRSI(D) and ((ChaikinMoneyFlow > 0 and ChaikingMoneyFlow[1]<ChaikinMoneyFlow) or (ChaikinMoneyFlow crosses above 0) and TRIX<0)

Display an arrow down RED SELL signal when the opposite happens

Thank you so much!

here is a study with a buy formula.
double check the ( ). i added a ) to the end of buy formula.
check the formulas to see if the correct plots are used. not sure about trix.

Ruby:
``````# combine6

#TRIX have a length of 10
#ChaikinMoneyFlow length is 14
#StochRSI and StochasticFull K period is 14 and D period is 3
#DMI length is 14 for DI+ and DI- calculations

#Display an arrow up GREEN BUY signal on the chart when:

#(close>open and DI+>DI+[1] and (StochasticFull(K)<100 or ChaikinMoneyFlow>0 or (DI+ crosses above DI-)) and MACDdiff>0 and StochasticFull(K) > StochasticFull(D) and StochasticFull(K)>40 and StochRSI(K)>StochRSI(D) and ((ChaikinMoneyFlow > 0 and ChaikingMoneyFlow[1]<ChaikinMoneyFlow) or (ChaikinMoneyFlow crosses above 0) and TRIX<0)

#Display an arrow down RED SELL signal when the opposite happens

def na = double.nan;

def trix_len = 10;
def trix_t = TRIX(trix_len).trix;
def trix_sig = TRIX(trix_len).signal;

def chaik_len = 14;
def chaik_cmf = ChaikinMoneyFlow(chaik_len).cmf;

input RSI_length = 14;
input over_bought = 80;
input over_sold = 20;
input RSI_average_type = AverageType.WILDERS;
input RSI_price = close;
def stoc_k = 14;
def stoc_d = 3;
def stocrsi_k = StochRSI( RSI_length, over_bought, over_sold, RSI_average_type, RSI_price, stoc_k, stoc_d ).fullk;
def stocrsi_d = StochRSI( RSI_length, over_bought, over_sold, RSI_average_type, RSI_price, stoc_k, stoc_d ).fulld;

#input over_bought = 80;
#input over_sold = 20;
#def stoc_k = 14;
#def stoc_d = 3;
def stocfull_k = StochasticFull( over_bought, over_sold, stoc_k, stoc_d ).fullk;
def stocfull_d = StochasticFull( over_bought, over_sold, stoc_k, stoc_d ).fulld;

def dmi_len = 14;
def dmi_diplus = DMI( dmi_len )."di+";
def dmi_diminus = DMI( dmi_len )."di-";

def macd_diff = macd().diff;

def buy1 = (close > open and dmi_diplus > dmi_diplus[1] and ( stocfull_k < 100
or
chaik_cmf > 0 or ( dmi_diplus crosses above dmi_diminus ))
and
MACD_diff > 0 and stocfull_k > stocfull_d
and
stocfull_k > 40
and
stocrsi_k > stocrsi_d
and
( ( chaik_cmf > 0 and chaik_cmf[1] < chaik_cmf ) or ( chaik_cmf  crosses above 0) and trix_t < 0)
);

plot z1 = if buy1 then low else na;
z1.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
z1.SetDefaultColor(Color.green);
z1.setlineweight(3);
z1.hidebubble();
#
#``````

here is a study with a buy formula.
double check the ( ). i added a ) to the end of buy formula.
check the formulas to see if the correct plots are used. not sure about trix.

Ruby:
``````# combine6

#TRIX have a length of 10
#ChaikinMoneyFlow length is 14
#StochRSI and StochasticFull K period is 14 and D period is 3
#DMI length is 14 for DI+ and DI- calculations

#Display an arrow up GREEN BUY signal on the chart when:

#(close>open and DI+>DI+[1] and (StochasticFull(K)<100 or ChaikinMoneyFlow>0 or (DI+ crosses above DI-)) and MACDdiff>0 and StochasticFull(K) > StochasticFull(D) and StochasticFull(K)>40 and StochRSI(K)>StochRSI(D) and ((ChaikinMoneyFlow > 0 and ChaikingMoneyFlow[1]<ChaikinMoneyFlow) or (ChaikinMoneyFlow crosses above 0) and TRIX<0)

#Display an arrow down RED SELL signal when the opposite happens

def na = double.nan;

def trix_len = 10;
def trix_t = TRIX(trix_len).trix;
def trix_sig = TRIX(trix_len).signal;

def chaik_len = 14;
def chaik_cmf = ChaikinMoneyFlow(chaik_len).cmf;

input RSI_length = 14;
input over_bought = 80;
input over_sold = 20;
input RSI_average_type = AverageType.WILDERS;
input RSI_price = close;
def stoc_k = 14;
def stoc_d = 3;
def stocrsi_k = StochRSI( RSI_length, over_bought, over_sold, RSI_average_type, RSI_price, stoc_k, stoc_d ).fullk;
def stocrsi_d = StochRSI( RSI_length, over_bought, over_sold, RSI_average_type, RSI_price, stoc_k, stoc_d ).fulld;

#input over_bought = 80;
#input over_sold = 20;
#def stoc_k = 14;
#def stoc_d = 3;
def stocfull_k = StochasticFull( over_bought, over_sold, stoc_k, stoc_d ).fullk;
def stocfull_d = StochasticFull( over_bought, over_sold, stoc_k, stoc_d ).fulld;

def dmi_len = 14;
def dmi_diplus = DMI( dmi_len )."di+";
def dmi_diminus = DMI( dmi_len )."di-";

def macd_diff = macd().diff;

def buy1 = (close > open and dmi_diplus > dmi_diplus[1] and ( stocfull_k < 100
or
chaik_cmf > 0 or ( dmi_diplus crosses above dmi_diminus ))
and
MACD_diff > 0 and stocfull_k > stocfull_d
and
stocfull_k > 40
and
stocrsi_k > stocrsi_d
and
( ( chaik_cmf > 0 and chaik_cmf[1] < chaik_cmf ) or ( chaik_cmf  crosses above 0) and trix_t < 0)
);

plot z1 = if buy1 then low else na;
z1.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
z1.SetDefaultColor(Color.green);
z1.setlineweight(3);
z1.hidebubble();
#
#``````
Thank you very much!! I appreciate it.
Going to test it shortly.

I only get Buy ARROW on the chart and in the Inputs and Options Plots ???

I only get Buy ARROW on the chart and in the Inputs and Options Plots ???

i only did the code for buy.
for sell, copy the buy formulas and change the conditions as needed.

### Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
311 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• 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?