# Qlang Language

**URL:** https://quantlab.discourse.group/c/for-coding-language-questions/7.md

[Latest](https://quantlab.discourse.group/latest.md) · [Categories](https://quantlab.discourse.group/categories.md) · [Tags](https://quantlab.discourse.group/tags.md)

---

## [About the Qlang Language category](https://quantlab.discourse.group/t/about-the-qlang-language-category/16)

<div class="topic-metadata">

**Author:** [@QuantlabAdmin](https://quantlab.discourse.group/u/QuantlabAdmin)\
**Replies:** 0

</div>

Discussions and help with coding Qlang.

---

## [Structured bindings for \`out\` parameters — new in 4162](https://quantlab.discourse.group/t/structured-bindings-for-out-parameters-new-in-4162/124)

<div class="topic-metadata">

**Author:** [@QuantlabAdmin](https://quantlab.discourse.group/u/QuantlabAdmin)\
**Replies:** 0\
**Last updated:** [June 2, 2026, 5:20am UTC](https://quantlab.discourse.group/t/structured-bindings-for-out-parameters-new-in-4162/124 "2026-06-02T05:20:13Z")

</div>

Structured bindings for out parameters — new in 4162 Short version: if a void function returns values through out parameters, 4162 lets you capture them with a structured binding instead of pre-declaring each variable a…

---

## [Create vector(integer) efficiently](https://quantlab.discourse.group/t/create-vector-integer-efficiently/117)

<div class="topic-metadata">

**Author:** [@QuantBob](https://quantlab.discourse.group/u/QuantBob)\
**Replies:** 2\
**Last updated:** [October 9, 2025, 11:19am UTC](https://quantlab.discourse.group/t/create-vector-integer-efficiently/117 "2025-10-09T11:19:16Z")

</div>

Running Quantlab ver 4029 or later? There is a better way to get a vector of integers to use in various range loops or vector and matrix calculations. Some example code with comments below. → Key take-away. Do not use f…

---

## [Pythonify qlang](https://quantlab.discourse.group/t/pythonify-qlang/102)

<div class="topic-metadata">

**Author:** [@casperfdr](https://quantlab.discourse.group/u/casperfdr)\
**Replies:** 4\
**Last updated:** [March 18, 2025, 6:20am UTC](https://quantlab.discourse.group/t/pythonify-qlang/102 "2025-03-18T06:20:16Z")

</div>

An unknown feature in Qlang is that you can define operators, and the thing I miss most about python is the ability to add strings together. With the following code you will be able to add strings together in qlang as w…

---

## [For-loop in Qlang?](https://quantlab.discourse.group/t/for-loop-in-qlang/40)

<div class="topic-metadata">

**Author:** [@RutgerJ](https://quantlab.discourse.group/u/RutgerJ)\
**Replies:** 5\
**Last updated:** [February 21, 2025, 8:48am UTC](https://quantlab.discourse.group/t/for-loop-in-qlang/40 "2025-02-21T08:48:13Z")

</div>

There seems to be many ways to create for-loops in Qlang. Which options do I have and what is the difference?

---

## [Optimal series with realtime](https://quantlab.discourse.group/t/optimal-series-with-realtime/98)

<div class="topic-metadata">

**Author:** [@QuantBob](https://quantlab.discourse.group/u/QuantBob)\
**Replies:** 0\
**Last updated:** [September 18, 2024, 3:10pm UTC](https://quantlab.discourse.group/t/optimal-series-with-realtime/98 "2024-09-18T15:10:35Z")

</div>

Problem: When running large workspaces with many long timeseries where the last point is updated by realtime data from Bloomberg or Refinitiv, the calculations can become very inefficient - if naively recalculating the h…

---

## [Qlang Friday Banter](https://quantlab.discourse.group/t/qlang-friday-banter/85)

<div class="topic-metadata">

**Author:** [@joakimw](https://quantlab.discourse.group/u/joakimw)\
**Replies:** 2\
**Last updated:** [July 11, 2024, 10:46am UTC](https://quantlab.discourse.group/t/qlang-friday-banter/85 "2024-07-11T10:46:16Z")

</div>

I’m looking for a more descriptive name for this function, could anyone tell me what it does? :slight\_smile: void func( out integer x, out integer y) { x = (x|y)&~(x&y); y = (x|y)&~(x&y); x = (x|y)&~(x&y); } I can…

---

## [Serialize objects to JSON](https://quantlab.discourse.group/t/serialize-objects-to-json/65)

<div class="topic-metadata">

**Author:** [@kim](https://quantlab.discourse.group/u/kim)\
**Replies:** 1\
**Last updated:** [May 29, 2024, 8:14am UTC](https://quantlab.discourse.group/t/serialize-objects-to-json/65 "2024-05-29T08:14:20Z")

</div>

Can I save an object in my workspace across sessions by serializing it to JSON? If possible, how can I do it? And what limitations should I be aware of?

---

## [Brackets coding style in Qlang?](https://quantlab.discourse.group/t/brackets-coding-style-in-qlang/45)

<div class="topic-metadata">

**Author:** [@QuantBob](https://quantlab.discourse.group/u/QuantBob)\
**Replies:** 4\
**Last updated:** [May 29, 2024, 7:16am UTC](https://quantlab.discourse.group/t/brackets-coding-style-in-qlang/45 "2024-05-29T07:16:56Z")

</div>

What is common best practice among Qlang coders where to place the curly brackets at the start and end of a function and loop / if statements? myfunc() { ... } or myfunc(){ ... }

---

## [Virtual vs override functions](https://quantlab.discourse.group/t/virtual-vs-override-functions/50)

<div class="topic-metadata">

**Author:** [@casperfdr](https://quantlab.discourse.group/u/casperfdr)\
**Replies:** 1\
**Last updated:** [April 18, 2024, 12:25pm UTC](https://quantlab.discourse.group/t/virtual-vs-override-functions/50 "2024-04-18T12:25:20Z")

</div>

I made a class that inherits from a superclass and need to overwrite some functions. Both override void example\_function(); and virtual void example\_function(); seems to work. What is the difference and which one sho…

---

## [Pre allocate memory](https://quantlab.discourse.group/t/pre-allocate-memory/51)

<div class="topic-metadata">

**Author:** [@casperfdr](https://quantlab.discourse.group/u/casperfdr)\
**Replies:** 1\
**Last updated:** [April 18, 2024, 7:45am UTC](https://quantlab.discourse.group/t/pre-allocate-memory/51 "2024-04-18T07:45:31Z")

</div>

I need to store alot of data in a vector but don’t know in advance how much. Is there a way to pre allocate memory for my vector? What is best practice in these cases?
