JS please can you provide a link to an Indicator or script that provides the ‘difference equation’ of price action?
Preferably not a link to reams of theory on Digital Signal Processing. I have scan read such (sincc you mentioned DSP on another Topic) and it has similarities to the theory of radar circuitry (wave frequencies, bandpass filters etc) .
Is there anything on this website that we can use to give us the ‘difference equation’?
Is DSP something new (to us?) that we should try out and you are the man who is going to lead us onward and upward by pointing us to a practicable and usable source of the ‘difference equation’?? 🙂
JSParticipant
Senior
Hi GraHal,
I hope you understand that I can’t reveal my algorithm because it took me 20 years to come to this point but you are in the right direction, it has similarities to the theory of wave frequencies and filters.
Black and Scholes also used a difference equation for option pricing (only continue instead of discreet).
I can tell you that ALL price action is discreet, lineair and time invariant. Such a system is called a LTD -system.
The general difference equation for a LTD -system is:
![{\displaystyle y[n]=\sum _{k=0}^{N}a_{k}\,x[n-k]+\sum _{i=1}^{M}b_{i}\,y[n-i]}](https://wikimedia.org/api/rest_v1/media/math/render/svg/65e91d48665524f120acfb6bbe0243e42f9b2a15)
It is not that hard, if i can do it you can do it.
Mods
To save hijacking jebus89 Topic any further, please could you transfer the last 2 posts above – mine and JS – to a new Topic named:
Digital Signal Processing – Defining & Using the ‘Difference Equation’
EricParticipant
Master
3 trades a year using 5 min timeframe seems odd?
JSParticipant
Senior
Hi Eric,
The system is Time Invariant so it doesn’t matter what timeframe your on.
You can use 5 min, 15 min, 1 hour, etc. and the system will open exactly the same amount of trades…
JSParticipant
Senior
Positions opened by the system at this moment…
So can PRT handle / calculate y[n] using the formula below?
Are you going to tell us (or direct us to a source) what the letters stand for when related to Price of an Instrument?
![{\displaystyle y[n]=\sum _{k=0}^{N}a_{k}\,x[n-k]+\sum _{i=1}^{M}b_{i}\,y[n-i]}](https://wikimedia.org/api/rest_v1/media/math/render/svg/65e91d48665524f120acfb6bbe0243e42f9b2a15)
JSParticipant
Senior
Hi GraHal,
Have you any idea how PRT works, what happens when you (for example) use a simple moving average and how it is calculated by PRT?
This is how PRT calculate a SMA:
N = number of samples (or time period)
Xi = Close[n]
Mu or y[n] is the variable
Hahaha … nice one! The link casts ‘light on the wizardry’! 🙂
From the definition below of
Difference Equation … it sounds similar to momentum?
An equation that shows the relationship between
consecutive values of a sequence and the differences among them.
JSParticipant
Senior
https://www.tradingview.com/chart/GBPUSD/WLP5849o-Digital-Filters-And-DSP/
Interesting article on trading view, shows that a SMA is the basis of a filter…
I used ChatGTP to create a DSP (LCCDE) – code, but no trades. Any Ideas?
DEFPARAM CumulateOrders = False
// Definiera koefficienterna för skillnadsekvationen
a0 = 0.5
a1 = 0.3
b1 = -0.2
// Inledande värden
y = close
// Beräkning av DSP-filter
y = a0 * close + a1 * close[1] + b1 * y[1]
SET STOP %loss 1
// Handel logik
IF NOT ONMARKET THEN
IF y > close THEN
BUY 1 CONTRACT AT MARKET
ELSIF y < close THEN
SELLSHORT 1 CONTRACT AT MARKET
ENDIF
ENDIF
set target %profit 1
Changing line 12 made it work, but I don’t know if that’s what you wanted:
DEFPARAM CumulateOrders = False
// Definiera koefficienterna för skillnadsekvationen
a0 = 0.5
a1 = 0.3
b1 = -0.2
// Inledande värden
y = close
// Beräkning av DSP-filter
y = a0 * close + a1 * close[1] + b1 * close[2] //changed
SET STOP %loss 1
// Handel logik
IF NOT ONMARKET THEN
IF y > close THEN
BUY 1 CONTRACT AT MARKET
ELSIF y < close THEN
SELLSHORT 1 CONTRACT AT MARKET
ENDIF
ENDIF
set target %profit 1
graph y