QF Trading Workshop
Current location: Home > Workshops > QF Trading Workshop

Workshop #5 Quantum Price Levels (QPL)

Posted:2021-03-26 12:59:09 Click:2079

Workshop - Quantum Price Levels (QPL)


1. Introduction


This workshop will implement the knowledge learnt in the lecture to calculate Quantum Price Level (QPL) by using TWO programming tools:

A) Matlab as simulation and illustration for the numerical computation of the Quantum Energy Level discussed in Chap 5.

B) MT4 to show the major steps and modules for the real-time calculation of QPL for ANY financial product in MT 4 platform - Individual Assignment 1.


2. Matlab Method to calculate Quantum Energy Levels


% *********************************************************************
%
% Date: 5.1.2019
% Subject: Calculation of Quantum Price Level using QFSE
% Version; 1.0
%
% 1. Time Independent Schrodinger Equation on Quantum Finance (SEQF)
% [-h/2m d^2/d^2 + (d*r^2 - v*r^4)]q(r) = E*q(r)
% 2. It is a typical Quartic Anharmonic Schrodinger Equation with
% discrete energy levels.
% 3. Using Dasgupta et. al. (2007) works on the numerical techniques
% to the the quartic QHO problem.
% 4. Formula the SEQF as
% -d^q(r)/d^2 + (r^2 + l*r^4)*(r) = E * q(r)
% The Quantum Price Field Energy Levels are given by
% (E(n)/2n+1)^3 - (E(n)/2n+1) = (K0(n)^3)*l
% where
% K0(n) = ((1.1924+33.232383*(n-1)+56.22169*(n-1)*(n-1))/(1+43.6106*(n-1)))^(1/3);
% 5. For Implementation, set
% Max iteration M = 1000
% Lamda l = 0.2
% Max energy level N = 21%
%***********************************************************************
%********************
% Define parameters
%
MaxN = 21; % Max Qunatum Price Energy Levels
l = 1.16813758; % Lamda value for the SEQF
oldE = 0.0; % Aux E variable

%*********************
% Define and initialize the K and Energy arrays
%
E = zeros(3,MaxN); % Energy levels array
K = zeros(1,MaxN); % K parameter array

% Calculate ALL K2 parameters
for n=1:1:MaxN
K(n) = ((1.1924+33.232383*(n-1)+56.22169*(n-1)*(n-1))/(1+43.6106*(n-1)))^(1/3);
end

% Calculate ALL Energy Levels
for n=1:1:MaxN
a = (1/(2*(n-1)+1))^3;
b = 0;
c = -1/(2*(n-1)+1);
d = -1*l*(K(n)^3);
E(:,n) = roots([a,b,c,d]);
end

  1. Study the above Matlab code
  2. Open the Matlab program and copy it into the workspace.
  3. Save it to (says) QPL2019.mat
  4. Run QPL2019 and check the results.
  5. Save the result, as you might need it for your MT4 program (for checking).


3. MT4 Method for real-time calculation of QPL for any financial product


(Individual Programming Assignment #1)


3.1 Task and Objectives


- Write a MT4 program to perform a real time calculation of QPLs of ANY 5 financial products by using the numerical computation technique taught in Chap 5.

- The program MUST make use of the historical daily time series (at least 500 trading days) to generate the wave-function distribution, together with the numerical computation method mentioned in the class to calculate the first 20 Quantum Price Energy Levels for each financial products.

- Read below 4. Hints carefully and follow the program workflow to complete the program.


3.2 Deliverables


1. MT4 Program Source code (CalQPL_studentid.mq4)

2. MT4 Executable file (CalQPL_studentid.ex4)

3. DataFiles (FP means financial products, eg. CADUSD, details please refer to the Hints)

- Wavefunction statistic (FP_Qf)

- QPR

- QFEL

- QNQPR

- Lambda


3.3 Deadline (Tentative)

10:00 am 12 April 2019 (FRI)


4 Hints for Program Assignment #1


4.1 System Workflow


As mentioned in the class, the complete workflow for the time real numerical computation of QPL system consist of EIGHT processes, so shown.



4.2 Follow the attachment to complete the code


https://ispace.uic.edu.hk/pluginfile.php/444316/mod_page/content/10/QPL2019-student.html

						
						


到价提醒[关闭]