Soon available

Not on the Chrome Web Store yet

ProRealCode Studio is on its way. As soon as it is published, this button will take you straight to its Chrome Web Store page.

Chapter 02 · Part I — Getting started

Your first indicator, on the chart in five minutes.

ProRealCode Studio comes with ready-made examples. Here you open the first one, run it on your chart, save it under your own name and find it again. No code to write.

  1. 01Open an example The code appears in the editor.
  2. 02Run it Studio puts it on the chart.
  3. 03See it on the chart Two blue curves follow the price.
  4. 04Save it It becomes your own code.
  5. 05Find it again It is listed in “My codes”.
The ProRealCode Studio editor docked under the chart, empty: the rail of icons on the left edge, the buttons Run, Save, Variables, View and Close at the top right, and the status bar along the bottom.
The editor under the chart: the rail on the left, the buttons top right, the status bar at the bottom.
The left end of the editor's status bar: a green light, then “chart linked · 3,000 bars”.
Check first: the status bar reads “chart linked”.
The buttons at the top right of the editor: Run, Save, Variables, View, A−, A+, the three dots, the arrow and Close.
The two buttons of this chapter: “Run” and “Save”.
Before you startProRealCode Studio is installed and its editor is open under a ProRealTime chart (chapter 01). No prorealcode.com account needed here, though one is recommended (chapter 05).
ProRealCode StudioUser guide · Chapter 02
Step 1 · Open an example

Open the example that comes first in the list.

The Codes, indicators and strategies window on Examples: the ProRealCode Script folder is open, with 1 · Your first indicator at the top, its padlock, and a pencil and a chart icon at the end of each row. 1 2 3 4
The “Codes, indicators and strategies” window, on the examples that ship with Studio.
  1. “Examples”, under BUNDLED. The codes that come with Studio.
  2. The “ProRealCode Script” folder. Its examples are numbered. Start at 1.
  3. The padlock. An example is read-only. “Save” makes a copy into your own codes.
  4. The pencil opens the example in the editor, without putting it on the chart. The chart icon next to it does the opposite: it puts the example on the chart without opening it. Not used here.
  1. Click the folder icon at the top of the rail, on the left edge of the editor.The “Codes, indicators and strategies” window opens. The “Codes” row of the ƒ launcher opens it too.
  2. Click “Examples” in the left column, then the “ProRealCode Script” folder if it is closed.“1 · Your first indicator” is the first row.
  3. On that row, click the pencil.The example opens in a new tab of the editor, behind the window.
  4. Close the window with the × at its top right.The editor shows the example's code.
ProRealCode StudioUser guide · Chapter 02
Step 2 · Run it

One click on “Run”, and the code goes onto the chart.

The editor with the tab 1 · Your first indicator: in the header, the code's name with the chips unsaved and Studio Only, and the Run button at the right under the mouse pointer. 1 2
The example in the editor, before its first run.
  1. The code's name and its chips. “unsaved”: nothing is saved yet, that is step 4. “Studio Only”: the code uses an instruction that only ProRealCode Studio understands, here input(), one of Studio's additions. A code without additions runs on ProRealTime too (chapter 00).
  2. “Run”. With the cursor in the editor, Ctrl + Enter does the same.
  1. Click “Run”.Studio computes the example and draws it on the chart. Step 3 shows what to look for.
  2. Leave the tab as it is for now.“Run” never saves. The chip still reads “unsaved” until step 4.

Five lines do the work

The rest of the example is comments, in grey in the editor. The numbers on the left are the editor's line numbers.

19input(period, 20, "MA period", int)20input(source, 0, "0 = close, 1 = typical price", int)28ma = ExponentialAverage[period](src)32band = ma + Average[period](abs(close - ma))36RETURN ma AS "EMA" COLOURED(90, 170, 255) STYLE(line, 2), band AS "Envelope" COLOURED(90, 170, 255, 120) STYLE(dottedline2, 1)

Lines 19 and 20 declare two settings. The period starts at 20; you can change it later without touching the code (chapter 08).

Lines 28 and 32 compute the two curves: an exponential average, and the same average lifted by its usual distance to the price.

Line 36 draws them, with a name, a colour and a style each. It is one long line, wrapped here to fit the page.

ProRealCode StudioUser guide · Chapter 02
Step 3 · See it on the chart

Two blue curves now follow the price.

EnvelopeEMA
Illustration. What the example draws: a solid light-blue line named “EMA” and a dotted one above it named “Envelope”. Your candles keep your chart's own colours.

Both curves move with the price, so Studio draws them over the candles. A code whose values sit far from the price, an oscillator for instance, gets its own panel under the chart instead (chapter 12).

Try it: change a colour

  1. In the editor, on line 36, replace COLOURED(90, 170, 255) with COLOURED(255, 140, 0).The button now reads “Run ●”: the editor holds a change the chart has not seen yet.
  2. Click “Run”.The solid curve turns orange. The dotted one stays blue: its own colour, further along the same line, did not change.
Illustration. After the change.
Nothing on the chart?Look at the status bar, bottom left of the editor. “chart linked” in green: the link is fine. “linking chart…” in amber: Studio has found the chart but cannot draw on it yet. “no chart” in red: open an instrument chart on the platform. Chapter 04 covers the link with the chart.
ProRealCode StudioUser guide · Chapter 02
Step 4 · Save it

Give it your name. From then on, it is your code.

The Save indicator as dialog, with the name Guide – My first indicator typed in, and the Cancel and OK buttons.
The dialog of a first save. The name typed here is the one used for this guide's captures.
  1. Click “Save”, or press Ctrl + S in the editor.A dialog asks “Save indicator as:”, with the example's name already filled in.
  2. Type a name of your own, “My first indicator” for instance, and click “OK”.The tab takes that name. The example under “Examples” does not change.
  3. Later, after another change, click “Save” again.No question this time: Studio writes over the same code.

The chip next to the code's name

It says where the code is saved. The same chip appears on the code's row in “My codes” (step 5).

ChipWhat it means
unsavedThe editor holds changes that are not saved yet. Ctrl + S saves them.
savedSaved in this browser. There is no account to sync it to: connect one to find your codes on another computer (chapter 05).
to syncSaved in this browser, and waiting to reach your prorealcode.com account.
syncedSaved, and in sync with your account.
A name already used replaces that codeIf one of your codes already has the name you type, “Save” writes over it without asking. Capitals do not count: “my first indicator” and “My First Indicator” are the same name. Pick a name you have not used.
ProRealCode StudioUser guide · Chapter 02
Step 5 · Find it again

Your code waits for you in “My codes”.

The Codes, indicators and strategies window on My codes, filtered on the word Guide: one code, Guide – My first indicator, with a green dot, the line applied ×1, the date, 37 lines and the synced chip, then a pencil, a chart icon and the other row buttons. 1 2 3 4 5
“My codes”, filtered on the word “Guide”. For this capture the code was saved as “Guide – My first indicator”.
  1. “My codes”, under PERSONAL. Every code you have saved.
  2. The filter. Type part of a name to shorten the list.
  3. The name. The green dot means the code is on the chart right now.
  4. The details. How many copies are on the chart (“applied ×1”), the date of the last save, the number of lines, and the chip of step 4.
  5. The pencil and the chart icon. The pencil reopens the code in the editor. The chart icon puts one more copy of it on the chart.
  1. Click the folder icon at the top of the rail.The window opens on “My codes”.
  2. Type the first letters of your code's name in the field “Filter your codes by name…”.Only the codes whose name matches stay in the list.
  3. Click the pencil to reopen the code.If the code is already open in a tab, Studio brings that tab forward instead of opening a second one.
ProRealCode StudioUser guide · Chapter 02
Chapter 02 · In short

Five steps, and an example became your own code.

You opened a read-only example, ran it, watched it draw on the chart and saved a copy under your own name. That copy is in “My codes”, ready to reopen or to put on the chart again.

The other examples work the same way. The one below, from the same folder, draws a shaded ribbon and a table in the corner of the chart.

In the editorDoes
Ctrl + EnterRun
Ctrl + SSave
Spot EUR/USD in daily candles, platform in dark mode: a ribbon of moving averages shaded green when rising and red when falling, and a REGIME table in the top right corner with four rows.
The example “Trend heat ribbon + regime HUD” on Spot EUR/USD, daily. This capture was taken with the platform in dark mode.

“Save” did not ask me for a name. Why?

The tab was already linked to a saved code, so Studio wrote over it. That is the case after a first save, or when one of your codes already has that name.

Did I change the example by editing it?

No. Examples are read-only. Your changes live in your tab, and “Save” stores them under your own name.

Where is my code kept if I have no account?

In this browser. The chip reads “saved”. Connect a prorealcode.com account to sync your codes (chapter 05).

Can I put the same code on the chart twice?

Yes. Each click on the chart icon in “My codes” adds one more copy, each with its own settings (chapter 08).

Next

Chapter 03 · A tour of the interface

The editor, the rail on its left, the status bar, and the places the editor can sit on your screen.

ProRealCode StudioUser guide · Chapter 02
ProRealCode ProRealCode
Loading...