Skip to content

Scripts Supporting Mouse Click to Set Price

By Optuma Team · Updated 2020-04-03

Scripts can be set up to support the setting of price or date by a mouse click using the Points() function.

In this example 3 plots would be created, the first would be at the selected price, the second would be 1 ATR lower and the third would be 2 ATRs lower.

v=Points().Point1.Price;
plot1 = v;
plot2 = v - LAST(ATR());
plot3 = v - LAST(ATR())*2;

The formula should be saved as a script tool set to the Same View, so it can then be selected from your tool box:

The Points function allows the selection of up to 3 different price points (clicks) when applying the tool.

Example with two points:

V1 = POINTS().Point1.Price;
V2 = POINTS().Point2.Price;
Plot1 = (V1 + V2) / 2

This script would show the mid point between two selected prices.

The Points function additionally supports the selection of a Date / Time, for scripted tools you want to calculate from a specific date on the chart.

Example:

v=Points().Point1.DateTime;
plot1 = If(BARDATE() > v, highesthigh(), 0);

Show the Highest high (over the last 8 days) only after the selected date, otherwise show a zero value.

Choose which categories of cookies you allow. Strictly-necessary cookies are always on. You can change this any time via the "Cookie Settings" link in the footer.

  • Functional

    Remember preferences like dismissed banners and your dark-mode choice.

  • Analytics

    Help us understand how the site is used so we can improve it.

  • Marketing

    Measure our advertising and help us reach people who may be interested in Optuma.