Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Trading Journey
by 7th_zorro. 04/27/24 04:42
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Akow, AndrewAMD, Quad), 733 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Notch Filter & Bandpass Filter #487094
01/16/23 06:09
01/16/23 06:09
Joined: Mar 2019
Posts: 22
S
Smallz Offline OP
Newbie
Smallz  Offline OP
Newbie
S

Joined: Mar 2019
Posts: 22
I played around with ChatGPT and asked it totell me what spectral filters can be used for trading and gave it an example in Lite-C.
Then I asked it for an example for a Nothc Filter and a Bandpass Filter

Here is what I got:
Code
 
// Notch filter
function tradeNF()
{
    var NotchWidth = optimize(10,5,30);
    var Threshold = optimize(0.1,0.05,0.5);
    var DominantFrequency = DominantFrequency(Prices);
    var NotchFrequency = DominantFrequency - NotchWidth;
    vars NotchFilter = series(NotchFilter(Prices,NotchFrequency,NotchWidth));
    vars Signals = series(Fisher(NotchFilter,NORMPERIOD));
    algoSetup();

    if(crossUnder(Signals,-Threshold)) 
        trade(-1);
    else if(crossOver(Signals,Threshold)) 
        trade(1);
}



and

Code
// BandStop filter
function tradeBSF()
{
    var BandStopWidth = optimize(10,5,30);
    var Threshold = optimize(0.1,0.05,0.5);
    var DominantFrequency = DominantFrequency(Prices);
    var StopFrequencyLow = DominantFrequency - BandStopWidth;
    var StopFrequencyHigh = DominantFrequency + BandStopWidth;
    vars BandStopFilter = series(BandStopFilter(Prices,StopFrequencyLow,StopFrequencyHigh));
    vars Signals = series(Fisher(BandStopFilter,NORMPERIOD));
    algoSetup();

    if(crossUnder(Signals,-Threshold)) 
        trade(-1);
    else if(crossOver(Signals,Threshold)) 
        trade(1);
}




"DominantFrequency" is an unknown variable, however
Anybody have fun playing around with this? Not sure about the optimize values, etc...

Last edited by Smallz; 01/16/23 06:13.
Re: Notch Filter & Bandpass Filter [Re: Smallz] #487410
04/10/23 18:09
04/10/23 18:09
Joined: Apr 2023
Posts: 15
R
rki Offline
Newbie
rki  Offline
Newbie
R

Joined: Apr 2023
Posts: 15
BandStop filter is not a BandPass filter


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1