Announcement

Collapse
No announcement yet.

Par SAR

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

  • Par SAR

    Hi guys,

    I would like to know why I keep having the problem msg " can not get internal class to construct builitin study.

    I'm sure the problem is in the parapolic SAR line.
    I tried to configure how can i get signal when the close of the bar is below PSAR and Higher that PSAR but i failed.

    I would like to know how can i add PSAR to my formula below that type SELL when ever the closing price of the bar is below PSAR and Buy when ever the closing price is higher than PSAR.

    Kind Regards,
    sb


    Formula below
    //{{EFSWizard_Description
    //
    // This formula was generated by the Alert Wizard
    //
    //}}EFSWizard_Description 7532


    //{{EFSWizard_Declarations
    var vEMA9 = new MAStudy(9, 0, "Close", MAStudy.EXPONENTIAL);
    var vEMA34 = new MAStudy(34, 0, "Close", MAStudy.EXPONENTIAL);
    var vMACD21_89 = new MACDStudy(21, 89, 9, "Close", false);
    var vParSAR = ParabolicStudy(0.02, 0.02, 0.2);
    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("AK - Personal Use V3");
    //}}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 (
    vEMA9.getValue(MAStudy.MA) < vEMA34.getValue(MAStudy.MA) &&
    vMACD21_89.getValue(MACDStudy.MACD) < vMACD21_89.getValue(MACDStudy.SIGNAL) &&
    open() < vParSAR.getValue(ParabolicStudy.STOP)
    ) onAction1()
    //}}EFSWizard_Expression_1

    //{{EFSWizard_Expression_2
    else if (
    vEMA9.getValue(MAStudy.MA) > vEMA34.getValue(MAStudy.MA) &&
    vMACD21_89.getValue(MACDStudy.MACD) > vMACD21_89.getValue(MACDStudy.SIGNAL) &&
    open() > vParSAR.getValue(ParabolicStudy.STOP)
    ) onAction2();
    //}}EFSWizard_Expression_2

    //}}EFSWizard_Expressions


    //{{EFSWizard_Return
    return null;
    //}}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() {
    if (vLastAlert != 1) drawTextRelative(0, high(), "SELL-AK3", Color.RGB(155,0,0), Color.RGB(255,255,255), Text.LEFT, "Arial", 10);
    vLastAlert = 1;
    }
    //}}EFSWizard_Action_1

    //{{EFSWizard_Action_2
    function onAction2() {
    if (vLastAlert != 2) drawTextRelative(0, high(), "BUY -AK3", Color.RGB(0,128,0), Color.RGB(255,255,255), Text.LEFT, "Arial", 10);
    vLastAlert = 2;
    }
    //}}EFSWizard_Action_2

    //}}EFSWizard_Actions

  • #2
    sb
    I suspect you are using an old(er) version of eSignal. See this thread for an explanation of the problem.
    The current version which is available here fixes that problem
    Alex

    Comment

    Working...
    X