Calculate the MMM number (Market Maker Move Number) x2

TraderDan0639

New member
Plus
I was trying to use chat GPT to calculate this indicator and write the script however I cannot get the math correctly, The bubbles to separate clearly, or the lines drawn from the candle to the right.

I want a think or swim TOS indicator to calculate the MMM number (Market Maker Move Number) x2, add it to the stock price and put a line above the stock price’s Current day candle only extending to the right to the price column of the chart. Use GetMarketMakerMove() to access the MMM Number. Then I want to take the MMM number (Market Maker Move Number) x2 and subtract it from the stock price and place a horizontal line below the stock price.

Also Create a manual entry to draw another line using the manually entered price. The same way.

The manual entry line is to take that entered price add it to the current stock price and place a line above the candle. Also take the manually entered price and subtract it from the current stock price and place a line below the candle. I want the four lines of calculations (The MMM calculations and manual calculations to extend to the right all the way to the price column of the chart. Also add a price above each line.

Also, I want to be able to click on the bubble to pull up the Edit studies box to change the price. Unless I would be able to change the manual price in the bubble. The manual entry would be the option projected move. This would be for evaluating an iron Condor on the chart.

The current problem is the math is not calculating correctly.

One of the photos is what I am trying to create and the other photo is what I keep getting. There is another photo which just hashes to the right at the price which would at least be acceptable but the math is completely wrong by like $10.

Thank you in advance for any assistance you can give me.
 

Attachments

  • Iron Condor Indicator Chart.png
    Iron Condor Indicator Chart.png
    68.7 KB · Views: 38
  • Error capturre.png
    Error capturre.png
    23.1 KB · Views: 39
  • Condor chart small hashes.png
    Condor chart small hashes.png
    70.7 KB · Views: 39
Solution
here is a template that draws 5 lines and 5 bubbles, after the last bar.
it finds the last close and uses that value to add and subtract a couple of numbers.

it does not use MMM numbers. i figured you can search and find a study that calcs that and add it into this.

https://usethinkscript.com/search/2102354/?q=mmm&o=date


Code:
#close_ext

def na = double.nan;
def bn = barnumber();

def lastbn = HighestAll(If(IsNaN(close), 0, bn));
def lastbar = if (bn == lastbn) then 1 else 0;
#def lastbar = !isnan(close[0]) and isnan(close[-1]);
#def last_close = highestall(if lastbar then close else 0);

def c = close;

def lastcls = if bn == 1 then 0
 else if lastbar then c
 else lastcls[1];

#-------------------------
# calc last price...
here is a template that draws 5 lines and 5 bubbles, after the last bar.
it finds the last close and uses that value to add and subtract a couple of numbers.

it does not use MMM numbers. i figured you can search and find a study that calcs that and add it into this.

https://usethinkscript.com/search/2102354/?q=mmm&o=date


Code:
#close_ext

def na = double.nan;
def bn = barnumber();

def lastbn = HighestAll(If(IsNaN(close), 0, bn));
def lastbar = if (bn == lastbn) then 1 else 0;
#def lastbar = !isnan(close[0]) and isnan(close[-1]);
#def last_close = highestall(if lastbar then close else 0);

def c = close;

def lastcls = if bn == 1 then 0
 else if lastbar then c
 else lastcls[1];

#-------------------------
# calc last price offset1

input price_offset1 = 0.7;

#-------------------------

#-------------------------
# calc last price offset2

input price_offset2 = 1.2;

#-------------------------

plot z = if lastcls > 0 then lastcls else na;

plot z1 = if lastcls > 0 then lastcls+price_offset1 else na;
plot z2 = if lastcls > 0 then lastcls-price_offset1 else na;

plot z3 = if lastcls > 0 then lastcls+price_offset2 else na;
plot z4 = if lastcls > 0 then lastcls-price_offset2 else na;


input bub_offset = 12;
def bub = !isnan(close[bub_offset]) and isnan(close[bub_offset-1]);

addchartbubble(bub, lastcls, "cls", color.white,yes);

addchartbubble(bub, z1, "one", color.cyan,yes);
addchartbubble(bub, z2, "one", color.cyan,no);

addchartbubble(bub, z3, "two", color.yellow,yes);
addchartbubble(bub, z4, "two", color.yellow,no);
#
 

Attachments

  • img1.JPG
    img1.JPG
    46.7 KB · Views: 39
Solution

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

I was trying to use chat GPT to calculate this indicator and write the script however I cannot get the math correctly, The bubbles to separate clearly, or the lines drawn from the candle to the right.

I want a think or swim TOS indicator to calculate the MMM number (Market Maker Move Number) x2, add it to the stock price and put a line above the stock price’s Current day candle only extending to the right to the price column of the chart. Use GetMarketMakerMove() to access the MMM Number. Then I want to take the MMM number (Market Maker Move Number) x2 and subtract it from the stock price and place a horizontal line below the stock price.

Also Create a manual entry to draw another line using the manually entered price. The same way.

The manual entry line is to take that entered price add it to the current stock price and place a line above the candle. Also take the manually entered price and subtract it from the current stock price and place a line below the candle. I want the four lines of calculations (The MMM calculations and manual calculations to extend to the right all the way to the price column of the chart. Also add a price above each line.

Also, I want to be able to click on the bubble to pull up the Edit studies box to change the price. Unless I would be able to change the manual price in the bubble. The manual entry would be the option projected move. This would be for evaluating an iron Condor on the chart.

The current problem is the math is not calculating correctly.

One of the photos is what I am trying to create and the other photo is what I keep getting. There is another photo which just hashes to the right at the price which would at least be acceptable but the math is completely wrong by like $10.

Thank you in advance for any assistance you can give me.
Hi there,

Thank you, I do appreciate it. This is definitely on track to what I am trying to accomplish. I need one of those boxes where I enter the price to multiply that number times two and then put the line on the chart. Can you alter the script to accomplish that? Instead of pulling the MMM number I can just enter it manually but I need one of them times two.
 
here is a template that draws 5 lines and 5 bubbles, after the last bar.
it finds the last close and uses that value to add and subtract a couple of numbers.

it does not use MMM numbers. i figured you can search and find a study that calcs that and add it into this.

https://usethinkscript.com/search/2102354/?q=mmm&o=date


Code:
#close_ext

def na = double.nan;
def bn = barnumber();

def lastbn = HighestAll(If(IsNaN(close), 0, bn));
def lastbar = if (bn == lastbn) then 1 else 0;
#def lastbar = !isnan(close[0]) and isnan(close[-1]);
#def last_close = highestall(if lastbar then close else 0);

def c = close;

def lastcls = if bn == 1 then 0
 else if lastbar then c
 else lastcls[1];

#-------------------------
# calc last price offset1

input price_offset1 = 0.7;

#-------------------------

#-------------------------
# calc last price offset2

input price_offset2 = 1.2;

#-------------------------

plot z = if lastcls > 0 then lastcls else na;

plot z1 = if lastcls > 0 then lastcls+price_offset1 else na;
plot z2 = if lastcls > 0 then lastcls-price_offset1 else na;

plot z3 = if lastcls > 0 then lastcls+price_offset2 else na;
plot z4 = if lastcls > 0 then lastcls-price_offset2 else na;


input bub_offset = 12;
def bub = !isnan(close[bub_offset]) and isnan(close[bub_offset-1]);

addchartbubble(bub, lastcls, "cls", color.white,yes);

addchartbubble(bub, z1, "one", color.cyan,yes);
addchartbubble(bub, z2, "one", color.cyan,no);

addchartbubble(bub, z3, "two", color.yellow,yes);
addchartbubble(bub, z4, "two", color.yellow,no);
#
Hi there,

Thank you, I do appreciate it. This is definitely on track to what I am trying to accomplish. I need one of those boxes where I enter the price to multiply that number times two and then put the line on the chart. Can you alter the script to accomplish that? Instead of pulling the MMM number I can just enter it manually but I need one of them times two.

I do not Write code however I did try to alter this to make that change or correction and cannot get it to work. It looks like the script is just written to put the lines on the chart from the numbers entered in offset 1 and offset 2. So there's no calculations. I attempted to alter it but I do not know a lot on how to do that.
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
271 Online
Create Post

Similar threads

Similar threads

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