Next Steps in Lipi Script

After exploring the basics and creating your first indicator, it’s time to delve deeper into the Lipi scripting environment. This guide outlines key concepts and best practices to help you progress in your journey with Lipi.


“Indicators”

  • Primarily used for visual analysis.
  • Perform calculations but do not include trading logic.
  • Run faster as they do not simulate trade executions.
  • Best for situations where backtesting is not required.

Indicators can:

  • Operate in overlay mode (on the chart’s bars) or pane mode (in a separate section).
  • Plot information in their respective spaces.

How Lipi Scripts Execute

Lipi scripts don’t execute like traditional programs. Instead, they operate in a loop, running once per bar in the chart, from left to right.

Key Points:

  1. Historical Bars:
    • Scripts calculate once for each bar that has already closed.
  2. Realtime Bar:
    • Scripts execute continuously on the last bar as prices or volumes change.
    • A final execution occurs when the realtime bar closes.
  3. Efficiency:
    • Calculations are cached; scripts do not reprocess historical bars on every update.

In historical mode, close represents the bar’s closing price. On the realtime bar, close provides the current price until the bar closes.

Time Series in Lipi

In Lipi, the primary data structure used is called a time series. A time series stores one value for each bar the script runs on, continuously expanding as the script processes more bars. You can reference past values from the time series using the history-referencing operator: []. For example, close[1] refers to the closing price of the bar before the one where the script is currently executing.

Although this indexing mechanism might seem similar to arrays for many programmers, a time series operates differently. Thinking of it as an array can hinder your understanding of this crucial Lipi Script concept. A solid grasp of both the execution model and time series is essential to understanding how Lipi scripts function. If you are unfamiliar with working with data organized as time series, practice will be necessary to effectively utilize them.

Publishing Scripts

Lipi is part of the GoCharting community, where traders and developers share their tools.

Options for Sharing:

  • Personal Use:
    • Write scripts in the Lipi Editor and use them privately.
  • Private Sharing:
    • Publish scripts privately and share the link with friends.
  • Public Sharing:
    • Share scripts with the broader community after ensuring they meet originality and documentation standards.

Where to Go from Here?

Learning Recommendations:

  • Experiment with example scripts in the Lipi User Manual.
  • Refer to the Language section for syntax and execution principles.
  • Explore the Concepts section for task-specific tutorials.
  • The FAQ section answers common questions from Lipi Script programmer.
  • The Release Notes page is where you can follow the frequent updates to Lipi Script.