Chart Script/Code for MA7 and MA99 (TradingView)


0
0

Hi Pete, can you help me make a script/code for TradingView. To make a chart signal when MA7 (purple line) touching the low of a green bar PLUS MA7 is greater than MA99. I cannot find that much information here in regards to TradingView scripts/codes. It’s mostly TOS.

Thanks in advance.

I apologize for the previous sample screenshot. I have attached a better sample for you here since I cannot make an attachment in the comments. So I created a new question.

Attachments:
Marked as spam
Posted by (Questions: 7, Answers: 16)
Asked on December 17, 2020 1:41 am
162 views
0
Private answer

Before I can attempt a solution here you need to provide a much clearly description of the following element from your request:

...touching the low of a green bar...

In the screenshot you provided the moving average is between the low of the candle and the open of the candle. The moving average is not "touching the low". So please be very clear about what you intended to say in that portion of your request. One might be able to describe this as the moving average "crossing through the lower wick of the candle". But that is a far cry from "touching the low of a green bar". Sorry to be so picky. But computers see things in black and white and the person writing the code must boil things down to a set of true or false conditions with exacting precision.

Marked as spam
Posted by (Questions: 39, Answers: 3686)
Answered on December 17, 2020 9:55 am
Yes, that's correct. I meant the moving average touching between the low of the candle and the open of the candle.
( at December 17, 2020 10:14 am)
0
Private answer

Please review the comments section of my previous answer to get the full specification for this solution.

Here is the pinescript you can add to a new chart study on TradingView.com.

If we get a significant number of requests for TradingView solutions I will add a new topic the the Q&A Forum to serve users of that platform.

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © 618fib
//@version=4
study("Q&A Forum", overlay = true)
lengthOne = input(7, minval=1, title="SMA #1")
priceOne = input(close, title="SMA Source #1")
maOne = sma(priceOne, lengthOne)
plot(maOne, title="SMA #1", color = color.purple)
lengthTwo = input(99, minval=1, title="SMA #2")
priceTwo = input(close, title="SMA Source #2")
maTwo = sma(priceTwo, lengthTwo)
plot(maTwo, title="SMA #2", color = color.red)
signal = close > open and maOne > low and maOne < open and maOne > maTwo
plotshape(signal, style = shape.arrowup, location = location.belowbar, size = size.large)

Screenshot below shows the result.

Attachments:
Marked as spam
Posted by (Questions: 39, Answers: 3686)
Answered on December 17, 2020 2:27 pm
Yes, this is exactly what I am looking for. Thanks again for your help :-)
( at December 17, 2020 5:33 pm)