ScriptingLipi Script PrimerFirst Steps

Introduction to Lipi Scripting in GoCharting

GoCharting is a powerful charting platform used by traders worldwide. Its scripting language, LIPI, allows users to customize their charts, apply advanced indicators, and publish proprietary strategies. This guide introduces LIPI scripting with key features and practical steps to get started.

What is Lipi?

LIPI is the scripting language for GoCharting. It is designed for creating custom indicators and patterns that can be applied directly to GoCharting charts. With LIPI, traders can:

  • Create custom indicators
  • Enhance chart visualizations
  • Publish and share indicators
  • Automate calculations and trading rules

Writing and Reading Lipi Code

Creating a New Script

To start writing a Lipi script in GoCharting:

  1. Open the Script Editor: Click on the Script option in the bottom bar.
  2. Create a New Script: Select New, then provide a name for your script.
  3. Write the Code: Use the code editor to input your LIPI code.
  4. Save the Script: Click the Save button to store your script.
  5. Add to Chart: Press the Add button to apply your script as an indicator on the chart.

image

Reading the Code of an Indicator

To read the code of an existing indicator:

  1. Click on the arrow to open the indicator’s information.
  2. Click on the curly brackets icon to view the code for the indicator.

image


Structure of a Lipi Script

A typical Lipi script consists of:

  • Input Parameters: Define customizable settings for the indicator (e.g., period, color, line style).
  • Data Processing: Include calculations using price, volume, or custom data.
  • Output Visualization: Specify how the indicator will appear on the chart (e.g., lines, histograms, labels).

Example

indicator("Custom Moving Average", overlay=true)
length = input(14, "Length")
smaValue = talib.sma(close, length)
plot(smaValue, color=color.blue, linewidth=2)

Explanation:

  • input(): Adds a parameter to customize the moving average length.
  • talib.sma(): Calculates the simple moving average.
  • plot(): Displays the moving average line on the chart.

Publishing Indicators

1. Publish Your Own Indicator

To publish your own indicator for the community:

  1. Click on the Script option in the bottom bar.
  2. After generating and saving your code as mentioned above, click on the Publish button.
  3. You will see four options for publishing:
    • Private: Keeps your indicator visible only to you.
    • Public: Makes your indicator available to the entire community.
    • Protected: Shares the indicator but keeps the code private.
    • Open-Source: Shares both the indicator and its code publicly.

image


2. Check Out Your Own Published Scripts

To view the list of your published scripts:

  1. Go to the top-left corner of the chart and click on the User Profile icon.
  2. Navigate to the Scripts tab to see all your published scripts.

image


3. Check Out Your Own and Community Scripts

To explore both your scripts and those shared by the community:

  1. Click on the FX Study option in the top bar.
  2. Select Scripts to view the available indicators.

image


LIPI scripting transforms GoCharting into a flexible tool for advanced technical analysis. By understanding how to read, write, and publish LIPI scripts, you can unlock new trading possibilities tailored to your strategies.