Announcement

Collapse
No announcement yet.

Donchian Volume

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

  • Donchian Volume

    Hello All;
    I was curious if this can be done. I'm looking to look at the Volume for the last 10 days, like the Donchian, so IF the Volume is greater today then the last 10 days AND the close>=open give a BUY signal. and IF the close<=open and the Volume is greater to day then the last 10 days give a SELL signal. Here is my EFS so far, but it doesn't work, can someone help?
    THX...Greg
    //{{EFSWizard_Description
    //
    // This formula was generated by the Alert Wizard
    //
    //}}EFSWizard_Description


    //{{EFSWizard_Declarations
    var vLastAlert = -1;
    //}}EFSWizard_Declarations


    function preMain() {
    /**
    * This function is called only once, before any of the bars are loaded.
    * Place any study or EFS configuration commands here.
    */
    //{{EFSWizard_PreMain
    setPriceStudy(true);
    setStudyTitle("Volume Donchian");
    setCursorLabelName("?", 0);
    setDefaultBarStyle(PS_SOLID, 0);
    setDefaultBarFgColor(Color.red, 0);
    setDefaultBarThickness(1, 0);
    setPlotType(PLOTTYPE_LINE, 0);
    //}}EFSWizard_PreMain

    }

    function main() {
    /**
    * The main() function is called once per bar on all previous bars, once per
    * each incoming completed bar, and if you don't have 'setComputeOnClose(true)'
    * in your preMain(), it is also called on every tick.
    */

    //{{EFSWizard_Expressions
    //{{EFSWizard_Expression_1
    if (
    volume() >= volume(0, -10) &&
    open() >= close()
    ) onAction1()
    //}}EFSWizard_Expression_1

    //{{EFSWizard_Expression_2
    else if (
    volume() >= volume(0, -10) &&
    close() <= open()
    ) onAction2();
    //}}EFSWizard_Expression_2

    //}}EFSWizard_Expressions


    //{{EFSWizard_Return
    return ;
    //}}EFSWizard_Return

    }

    function postMain() {
    /**
    * The postMain() function is called only once, when the EFS is no longer used for
    * the current symbol (ie, symbol change, chart closing, or application shutdown).
    */
    }

    //{{EFSWizard_Actions
    //{{EFSWizard_Action_1
    function onAction1() {
    Strategy.doLong("BUY", Strategy.CLOSE, Strategy.THISBAR, Strategy.DEFAULT, 0);
    Alert.playSound("C:\\Program Files\\eSignal\\Sounds\\Ding.wav");
    vLastAlert = 1;
    }
    //}}EFSWizard_Action_1

    //{{EFSWizard_Action_2
    function onAction2() {
    Strategy.doShort("SELL", Strategy.CLOSE, Strategy.THISBAR, Strategy.DEFAULT, 0);
    Alert.playSound("C:\\Program Files\\eSignal\\Sounds\\Ohno.wav");
    vLastAlert = 2;
    }
    //}}EFSWizard_Action_2

    //}}EFSWizard_Actions

  • #2
    Hi Greg

    First, let me apologize for the less-than-timely response. Believe me, I know how it feels to put a post out with no responses. You just happened to catch me at a the wrong time.

    I'm not an expert in these studies, but look at highest() and hhv(). You'll have to put in the volume() as the study. My biggest question is I don't know the difference between hhv() and highest(). That said, I've used highest() to simulate Donchians on price successfully.

    ....

    Please don't give up posting here. There are a few of us that do participate in this space and we're delighted to have new-comers. You just caught us at a quite time.

    Michael (The Bean)

    Comment

    Working...
    X