HiLo Activator

Optuma Forums Optuma Scripting HiLo Activator

This topic contains 0 replies, has 1 voice, and was last updated by Mathew Mathew 4 months, 1 week ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #38987
    Mathew
    Mathew
    • Topics: 11
    • Replies: 657
    • Posts: 668

    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;

    Capture

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

Pin It on Pinterest

Share This