Call AddHLine() from Python script?

Hi all,

Simple question - is it possible to use something like Pascal’s Tool.AddHLine() function within a Python script?

Some sample code to help clarify… Here I’m trying to call AddHLine() from within Python, and I get an error back ‘module Tool has no attribute AddHLine()’ which is clear enough. Is there another name for the ‘add horizontal line’ function within Python, or is it just not possible to draw a horizontal line like this on a chart from within Python?

import Tool

#Init function gets called once when tool is applied/loaded
def Init():
    Tool.Props.Name = "TestAddHLine"

#Process function gets called when applied/loaded or when new data is received
#start, end are the start and end+1 indexes of the source data list.
def Process(start, end):
    Tool.AddHLine(2000)

Note: for this very simple example, I’m aware that I could just use something like

def Process(start, end):
    for i in range(start, end):
        Tool.DataOut.Row(i).Close = 2000

but the functionality I’m trying to implement is considerably more complex than that. If there’s no AddHLine() equivalent in Python, then I’ll switch over to Pascal instead.

Thanks in advance

David Mitchell

Just following up by saying I’ve now implemented this functionality inside Pascal. No need for a response from the Optuma team