update
13th April 2020

LitScript Update

We've been working hard to make LitScript faster, better and stronger.

Complete rewrite

In order to achieve that, we had to break down everything and to rebuild it again from scratch. This isn't the first time we've done it, few months back LitScript was rewritten in order to provide better error handling which to be honest was horrendous back then.

Hopefully this will be end up as our 1st stable version of LitScript.

Like mentioned previously, this is the stepping stone for server-side scripts and alerts.

New script, new rules

We'll use this code to illustrate the changes:

study("My Script")
fast = 12, slow = input("Slow", 26)
fastMA = ema(close, fast)
slowMA = ema(close, slow)
macd = fastMA - slowMA
signal = sma(macd, 9)
plot(macd, color=blue)
plotshape(signal, "up", 10, color=#ff0)
//@version=1
study("My Script")
const fast = 12, slow = input("Slow", 26)
var fastMA = ema(close, fast)
var slowMA = ema(close, slow)
seq macd = fastMA - slowMA
var signal = sma(macd, 9)
plot(macd, color=color.blue)
plotshape(signal, shape.up, 10, color=#ff0)

That's it !

Important Details

So now you have to define type of variable, you can't just start writing the name or compiler will complain.

This change was fundamental for many reasons.


New features


Still experimental

We're not activating this by default, but once we iron out all the bugs and issues, we will completely kill the previous LitScript.

Since we built this from ground up, there's always a chance we made mistakes. We hope you'll help us finding out all those edge-cases we missed.

Quick migration guide

In order to activate new LitScript, just simply add the following snippet on the first line of your script.

//@version=1

Changelog

  • LitScript rewrite is currently being tested
  • Added some minor optimizations to new LitScript
  • Fixed code editor block comment highlighting
  • Fixed code editor indentation issues
  • Fixed error highlighting being stuck
  • Fixed some typos on the website