StockFetcher Forums · General Discussion · DMA(28,-14) INTO PINESCRIPT??<< >>Post Follow-up
BlackBars
54 posts
msg #143239
Ignore BlackBars
4/17/2018 9:12:33 AM

Hello all,

So can someone tell me if it is possible to convert the DMA(28,-14) SF format into pinescript?
Obviously I am aware it is "displaced" 14 periods, but.....

"The DMA(N,-P) is computed by taking the MA(N) and effectively "moving it back in time" by P days. Since we don't carry data from the future, it is not possible to compute a N-day average for the remaining P-1 days. For each of these dates, X[i], we compute shorter N-(P-i) day averages; where i=0 ... P-1 (i.e. X[0] is the most recent date and X[P-1] is the point P-1 days ago on the chart.) "

IS SUCH A THING POSSIBLE FOR PINESCRIPT ^

Tracks
4 posts
msg #143390
Ignore Tracks
4/29/2018 11:32:33 AM

If I'm reading this right, DMA is just the value the moving average was at (P) days ago, right?

So for Pinescript that would just be:

x = ma(close[14], 28)

If you specifically need the Daily MA, regardless of what timeframe your chart is in, then it would be:

x = ma(close[14], 28)
dx = security(tickerid, "D", x)


BlackBars
54 posts
msg #143397
Ignore BlackBars
4/29/2018 8:38:54 PM

Aha aright, thanks sport

StockFetcher Forums · General Discussion · DMA(28,-14) INTO PINESCRIPT??<< >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.