Announcement

Collapse
No announcement yet.

Daily moving average on intraday code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Daily moving average on intraday code

    For most this is ultra basic. I recently signed up with eSignal and an interval-independent SMA/EMA that would stay the same on monthly, weekly, daily, and intraday time periods was the first thing I looked for and didn't find it.

    So if you've signed up and need this right away, here it is. I have 8 in the array, but it's easy to copy/paste to add more or take some out. Just edit the periods and colors and all to suite your style.



    /************************************************** ***************
    Provided By:
    Interactive Data Corporation (Copyright © eSignal) 2010.
    All rights reserved. This sample eSignal Formula Script (EFS)
    is for educational purposes only. Interactive Data Corporation
    reserves the right to modify and overwrite this EFS file with
    each new release.

    Description:
    Daily SMA Set

    Notes:
    Alex Sonne
    [email protected]

    This is simply a single study that you can use to plot all of
    your favorite SMA's at once. The SMA's are scale-independent,
    meaning that whether you switch to weekly, daily, 30min, 1min
    or tick, they are calculated from daily periods.

    To name them, change the text between the quotes following
    the setCursorLabelName function. The last SMA plots a dotted
    line instead of solid—change this in setDefaultBarStyle for
    any of the SMAs, 0-7 (or add more). Choose your own periods by
    changing the number after sma( and the interval by changing the
    character behind inv(. Daily(D), Weekly(W), and Monthly (M)
    require quotes; minute periods such as 5, 15, 30 do not.
    ************************************************** ****************/

    function preMain() {

    setPriceStudy(true);
    setStudyTitle("DailyMAs");
    setCursorLabelName("10 Day",0);
    setCursorLabelName("20 Day",1);
    setCursorLabelName("50 Day",2);
    setCursorLabelName("100 Day",3);
    setCursorLabelName("126 Day",4);
    setCursorLabelName("200 Day",5);
    setCursorLabelName("375 Day",6);
    setCursorLabelName("500 Day",7);
    setDefaultBarFgColor(Color.white, 0);
    setDefaultBarFgColor(Color.red, 1);
    setDefaultBarFgColor(Color.lime, 2);
    setDefaultBarFgColor(Color.aqua, 3);
    setDefaultBarFgColor(Color.yellow, 4);
    setDefaultBarFgColor(Color.magenta, 5);
    setDefaultBarFgColor(Color.lightgrey, 6);
    setDefaultBarFgColor(Color.white, 7);
    setDefaultBarStyle(PS_DOT, 7);
    setPlotType(PLOTTYPE_LINE,0);
    setDefaultBarThickness(1,0);
    }

    function main() {

    return new Array (sma(10, inv("D")), sma(20, inv("D")), sma(50, inv("D")), sma(100, inv("D")), sma(126, inv("D")), sma(200, inv("D")), sma(375, inv("D")), sma(500, inv("D")));
    }
    Last edited by NeverEnuf81; 12-21-2011, 03:55 PM.

  • #2
    Re: Daily moving average on intraday code

    NeverEnuf81
    FWIW all the studies included in the Built-in Studies Formulas-> Custom Formulas folder are set up for use with external symbols and/or intervals ie symbols and/or intervals that are different than the one plotted on the chart
    Also if you search the forum you will find many other studies that are set up with the same functionality
    Alex


    Originally posted by NeverEnuf81
    For most this is ultra basic. I recently signed up with eSignal and an interval-independent SMA/EMA that would stay the same on monthly, weekly, daily, and intraday time periods was the first thing I looked for and didn't find it.

    So if you've signed up and need this right away, here it is. I have 8 in the array, but it's easy to copy/paste to add more or take some out. Just edit the periods and colors and all to suite your style.

    Comment


    • #3
      Re: Re: Daily moving average on intraday code

      Beautiful. Thnx Alexis. I'm still getting acclimated.
      *Perfect timing to switch software, lol, right before a massive ridiculous gap to crush my shorts. With me fumbling around in Windows (I detest that OS, big cartoony frames around everything and constant updates).*
      I'm searching around here to see what all it does though. Great features. There's only a handful of things I want to do and can't figure out yet. It really makes ToS—which I considered pretty nice—seem completely amateur. It'd be nice to be able to just drag entire arranged pages onto the different monitors.



      Originally posted by Alexis C. Montenegro
      NeverEnuf81
      FWIW all the studies included in the Built-in Studies Formulas-> Custom Formulas folder are set up for use with external symbols and/or intervals ie symbols and/or intervals that are different than the one plotted on the chart
      Also if you search the forum you will find many other studies that are set up with the same functionality
      Alex

      Comment

      Working...
      X