Announcement

Collapse
No announcement yet.

buy sell tag

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

  • buy sell tag

    ALEX IS THERE A WAY TO PUT IN BUY,SELL TAGS WHEN A HIGH AND A LOW ARE REACHED IN A 20 BAR PERIOD?// Provided by eSignal (c) 2003 //
    ////////////////////////////////////////////////////////////////
    function preMain()
    {
    setStudyTitle("Linear Regression Indicator");
    setCursorLabelName("LR", 0);
    setDefaultBarFgColor(Color.red, 0);
    setDefaultBarThickness(3, 0);
    setPriceStudy(true);
    }

    function main(Length) {
    if(Length == null) Length = 5;
    var sum = 0;
    var i = 0;
    var mt = 0;
    var wt = 0;
    for(i = Length; i > 0; i--)
    sum += (i - (Length + 1) / 3) * close(i - Length);
    wt = 6 / (Length * (Length + 1)) * sum
    return wt;

  • #2
    pbohm
    It should be possible. One needs to create an array of the last 20 values then determine the high and low values using Math.max and Math.min then set the condition to trigger the flag.
    Alex

    Comment


    • #3
      buy sell tag

      ALEX IAM NOT SURE HOW THAT WOULD BE WRITTEN INTO THE FORMULA. IF YOU COULD HELP ME WITH THAT I CAN PROBABLY SET MY OWN VALUES. ALSO SETTING THE CONDITON WOULD BE VERY HELPFUL. THANK YOU PBOHM

      Comment


      • #4
        pbohm
        First of all when replying to a message please use the Post Reply button rather than the New Thread one. It makes it otherwise very difficult to follow a thread. (Moderator Edit - FYI, threads have been merged. ~Jay)
        Secondly please do not SHOUT.
        Anyhow attached is a study that plots a Donchian based on the Linear Regression and when the LR crosses above the upper Donchian it paints the bar blue and when it crosses below the lower Donchian it paints it red.
        All the sections of the formula added/modified to create the Donchian are clearly indicated in the script. FYI these have been lifted directly off the examples provided in the Help files created by Chris Kryza and available in the EFS Help Center and Library or in his group.
        Alex

        Attached Files
        Last edited by ACM; 10-31-2003, 08:44 AM.

        Comment


        • #5
          buy sell tag

          thank you very much . i am sorry for putting response in the wrong area,and also i was not trying to shout at all. anytime
          you help us we are very pleased with your speedy response.

          thank you again pbohm

          Comment

          Working...
          X