HiLo Activator

Optuma Forums Optuma Scripting HiLo Activator

This topic contains 0 replies, has 1 voice, and was last updated by Mathew Mathew 1 year, 1 month ago.

Viewing 1 post (of 1 total)
  • Author
  • #38987
    • Topics: 14
    • Replies: 781
    • Posts: 795

    Here is a script that I had to write for the CMT3 course that I am doing. It is based on Robert Krauz’s work and it take the average of the highs and the average of the lows. Only one of the lines is ever shown depending on which line last got broken. To achieve this in scripting, I used the SWITCH function to set the status and then the IF statement to choose the values I wanted. The last part just formats the output as dots like a PSAR tool.

    w1 = WEEK();
    dh1 = MA(w1, CALC=High);
    dl1 = MA(w1, CALC=Low);

    UseLow = switch(high() > dh1, low() < dl1);

    WeekHiLo= if(UseLow, dl1, dh1);

    // Format the Plot
    Plot1 = WeekHiLo;
    Plot1.Caption = Weekly HiLo Activator;
    Plot1.Colour = Blue;
    Plot1.Plotstyle = Dot;
    Plot1.LineWidth = 3;


Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

Pin It on Pinterest

Share This

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.