SQLite insert or update

20 Mar, 2024
The "INSERT OR UPDATE" operation, often referred to as "UPSERT," is a database operation that either inserts a new row into a table if it doesn't already exist or updates an existing row if it does....
MQL4 MQL5

MQL5 use amount instead of lot size

21 Jan, 2024
In MQL5, when initiating a buy order, the platform typically uses lot size as a measure. However, there are instances where you might prefer to specify the amount in currency rather than lots. In...
pinescript icon

New symbol indicator in Pine Script 5

1 Oct, 2023
This snippet shows how you can show any symbol as indicator in Pine Script. This is a starting point, from here you can continue and modify the result.
MQL4 MQL5

Run Part of Your MQL5 Code Every Minute

30 Apr, 2023
If you prefer not to run your code on every tick, you can schedule it to run during the launch of a new bar or after any specific time period. This can be a useful feature for those who want more...
pinescript icon

Dividing Symbol Values in PineScript

29 Jun, 2022
Snippet showing how to do division in PineScript. First I import close data from security, then divide the values by 1000 and print it out as a line on the chart. You can change the formula or use...
MQL4 MQL5

MQL5: Use timeframes selection as input

29 Mar, 2022
This snippet shows how to use timeframes as input field. For that you just have to use the ENUM_TIMEFRAMES. It contains all of the predefined timeframes. This way you can use multiple times in a...
MQL4 MQL5

MQL5: Action at new candle

5 Oct, 2021
Do work only at the time of the birth of a new candle.
MQL4 MQL5

MQL5: Get current spread

4 Oct, 2021
This snippet shows how to get current spread as points. If you want it in price then you have to multiply it with point size or get ask and bid difference.
MQL4 MQL5

MQL5: Get current bid/ask price

4 Oct, 2021
This snippet shows how to get current bid and ask price. Two prices are there for buy and sell pricing and the difference of those is your spread.
MQL4 MQL5

MQL5: Trailing stop

1 Oct, 2021
Implementing a trailing stop in MQL5 involves continuously monitoring the market during each tick by iterating through all open positions. This allows the program to check if the market price has...
MQL4 MQL5

MQL5: Close all trades at the end of the day

1 Oct, 2021
This snippet is of a code that will close all trades at the end of the day. The percise time can be modified to your preferations.
MQL4 MQL5

MQL5: random if else

1 Oct, 2021
To get a random result, you can take MathRand() and use the modulus operator, it gives the reminder of division.
Python Logo

Defining class variables in Python

4 Sep, 2018
You can define class variables multiple ways in Python, but they also work differently. Underscore is used for "private" or "protected" variables, altough there are no such definitions in Python....
Python Logo

Show image in Python PyQt5 window

24 Dec, 2014
How to display an image in Python. Using PyQt5 application window.
Python Logo

Set window title for Python PyQt5 window

24 Dec, 2014
To set window title in Python PyQt5 you must have first created a window for your application.
Python Logo

Create application window using PyQt5 in Python

22 Dec, 2014
Create an application window using PyQt5 in Python. People at G+ suggested PyQt over Tkinter. So I am going to dig into that. I found a lot of tutorials about this process. Most of them included OOP...
Python Logo

Create a menu to Python Tkinter application window

20 Dec, 2014
Create a menu to your Python Tkinter application window. Create a simple pulldown / dropdown menu using TK in Python.
Python Logo

Create application window using Pythons Tkinter

20 Dec, 2014
Create an application window using Python's Tkinter. Window is the bases of every program, even full screen is actually a window.
Python Logo

For loop in Python

6 Aug, 2014
For loop in Python loops through a sequence of statements and iterates the code with current variable.

AutoIt - Get current mouse position coordinates

23 Feb, 2013
How to get current mouse position coordinates? You can create a simple script that shows a message box with coordinates on key-press.
Visual C#

Parse/read csv file using C#

6 May, 2012
The simplest way to parse csv files. I am using external library that does the magic for you. Csv file should be separated by commas and strings with double quotes.
Visual C#

File Browser Dialog in C#

4 May, 2012
How to create file browser dialogue in Microsoft Visual C#.
Unity game engine icon

Create GUI button in Unity using Javascript

18 Mar, 2012
Simple tutorial that shows you how to create GUI button in Unity using Javascript.