Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (howardR, sleakz), 688 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 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