GSB Forums

Not logged in [Login - Register]

Futures and forex trading contains substantial risk and is not for every investor. An investor could
potentially lose all or more than the initial investment. Risk capital is money that can be lost without
jeopardizing ones’ financial security or life style. Only risk capital should be used for trading and only
those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of
future results
Go To Bottom

Printable Version  
Author: Subject: Adding some fundamental data: Commitments of Traders Report
John62
Junior Member
**




Posts: 23
Registered: 29-9-2017
Member Is Offline

Mood: No Mood

[*] posted on 28-3-2018 at 03:55 AM
Adding some fundamental data: Commitments of Traders Report


I did a test by adding an extra secondary filter on the GSB NG_DEMO model. I used the momentum of the Net Commercials.
Some background on COT https://www.ireallytrade.com/cotreport.html
The COT data is available from Tradestation:

Results
Percent Profitable from 70.32 to 79.12
Profit factor from 3.64 to 7.72
Average Trade from 369.54 to 558.02
Nr of trades is down to 91 and Net Profit to 50.780. Further research is necessary, but I think it has potential as a filter.

Add this Tradestation Code to your model at the correct positions and add an extra daily datastream:

Inputs: CommMomDays(35);

Vars: //cot
string FieldNamePrefix( "" ),
string CommLongFieldNme( "" ),
string CommShortFieldNme( "" ),
double CommLong( 0 ),
double oCommLongErr( 0 ),
double CommShort( 0 ),
double oCommShortErr( 0 ),
double CommNet( 0 ),
double COTMom ( 0 );


// Get COT data
if Category > 0 then
Raiseruntimeerror(!( "Commitments of Traders studies can be applied only to futures symbols." ) );

FieldNamePrefix = "COTF-";
CommLongFieldNme = FieldNamePrefix + "12";
CommShortFieldNme = FieldNamePrefix + "13";

CommLong = FundValue( CommLongFieldNme, 0, oCommLongErr ) of data(3); // !!! Use daily data here
CommShort = FundValue( CommShortFieldNme, 0, oCommShortErr)of data(3);

if oCommLongErr = fdrOk and oCommShortErr = fdrOk then
Begin
CommNet = CommLong - CommShort;
COTMom=Momentum(CommNet,CommMomDays);
End
Else
Begin
Raiseruntimeerror( !( "Error in Commitments of Traders studies: ") );
End;

// Buy/Sell
If decision = 1 And sfDecision = 1 and COTMom < 0 Then
Begin
Buy("Long entry") 1 contracts this bar on close;
End
Else If decision = -1 And sfDecision = -1 and COTMom > 0 Then
Begin
SellShort("Short entry") 1 contracts this bar on close;
End;



NG_DEMO_COT.JPG - 105kB


View user's profile View All Posts By User
John62
Junior Member
**




Posts: 23
Registered: 29-9-2017
Member Is Offline

Mood: No Mood

[*] posted on 28-3-2018 at 04:10 AM


I also did some testing by adding Net Commercials as an extra data input to GSB. Several of the best systems used the COT datastream. You can get the data from the Tradestation indicator and format it in Excel to the correct format. The sample dataset for NG is attached for your own testing.

Attachment: Login to view the details



View user's profile View All Posts By User
rws
Member
***




Posts: 114
Registered: 12-6-2017
Member Is Offline

Mood: No Mood

[*] posted on 28-3-2018 at 12:10 PM


Very good !

View user's profile View All Posts By User
admin
Super Administrator
*********




Posts: 5069
Registered: 7-4-2017
Member Is Offline

Mood: No Mood

[*] posted on 28-3-2018 at 03:10 PM


Whats the symbol for COT. Has anyone tried this on ES market., IE GSBsys1ES or NQ?

View user's profile View All Posts By User
John62
Junior Member
**




Posts: 23
Registered: 29-9-2017
Member Is Offline

Mood: No Mood

[*] posted on 29-3-2018 at 02:11 AM


It is not a separate symbol, it is additional information for each future symbol. You can access it with the Fundvalue function in TradeStation. See the sample above. I think COT works best for markets with fysical delivery, and not stock indexes. But i did not try yet.

View user's profile View All Posts By User
admin
Super Administrator
*********




Posts: 5069
Registered: 7-4-2017
Member Is Offline

Mood: No Mood

[*] posted on 29-3-2018 at 05:38 AM


Quote: Originally posted by John62  
It is not a separate symbol, it is additional information for each future symbol. You can access it with the Fundvalue function in TradeStation. See the sample above. I think COT works best for markets with fysical delivery, and not stock indexes. But i did not try yet.

Thanks for that tip.
Please keep me informed on this.


View user's profile View All Posts By User
John62
Junior Member
**




Posts: 23
Registered: 29-9-2017
Member Is Offline

Mood: No Mood

[*] posted on 30-3-2018 at 08:45 AM


Quote: Originally posted by admin  
Whats the symbol for COT. Has anyone tried this on ES market., IE GSBsys1ES or NQ?


I did a test with GSBsys1ES. I used the COT data of the @SP contract. Because COT needs daily data and GSB 500 bars lookback. I took only trades from 1/1/2006 tot compare the same trading period.

Percent profitable and Average Trade little better, but the profit factor from 2.98 to 3.92!





GSBsys1ES_ORG.JPG - 113kBGSBsys1ES_COT.JPG - 111kB


View user's profile View All Posts By User
John62
Junior Member
**




Posts: 23
Registered: 29-9-2017
Member Is Offline

Mood: No Mood

[*] posted on 30-3-2018 at 10:04 AM


For your own testing. A complete ES dataset with a COT file for GSB.

Attachment: Login to view the details



View user's profile View All Posts By User
admin
Super Administrator
*********




Posts: 5069
Registered: 7-4-2017
Member Is Offline

Mood: No Mood

[*] posted on 31-3-2018 at 12:12 AM


Quote: Originally posted by John62  
For your own testing. A complete ES dataset with a COT file for GSB.

Interesting. It improved long but not short.
I did testing on go long if {all the usual} and close >close[1]
with the inverse for short.
It worked for one GSB system on es, but later when I tried it, worse on another.
What you have done is good, but requires more testing to validate.
I have been thinking about the addition secondary filters that are over due to be implemented. We really want to find SF that are true for all systems on the market, not just the one that appears to test better.


View user's profile View All Posts By User
Carl
Member
***




Posts: 343
Registered: 10-5-2017
Member Is Offline

Mood: No Mood

[*] posted on 4-4-2018 at 01:16 AM


Hi John62,

Just tried your COT on RB.
Do we need a daily bar for COT? Or just one bar per session?
So ie session is 0900-1430, use a 330 min bar for COT?

Thanks


View user's profile View All Posts By User
rws
Member
***




Posts: 114
Registered: 12-6-2017
Member Is Offline

Mood: No Mood

[*] posted on 4-4-2018 at 01:35 PM


This rule can have erratic results,

close >close[1]

In general it is believed that a relation between 3 bars can
have some good results. But you often need a bit more.

Here are some test examples in Amibroker, there are better
examples from the Amibroker closed forum but that is not for republishing available.

https://www.wisestocktrader.com/indicators/1139-candlestick-...
this one can enhanced so that it can find the candle stick patterns with the highest profit either over a ticker in seconds till minuts or a portfolio of thousands of tickers in a couple of hours.

Even better is if you could generate any combination of OHLC between the last 3 bars and combine that with indicators.

I sent you some opensource code that I do not want to post here.


Quote: Originally posted by Carl  
Hi John62,

Just tried your COT on RB.
Do we need a daily bar for COT? Or just one bar per session?
So ie session is 0900-1430, use a 330 min bar for COT?

Thanks


View user's profile View All Posts By User
admin
Super Administrator
*********




Posts: 5069
Registered: 7-4-2017
Member Is Offline

Mood: No Mood

[*] posted on 4-4-2018 at 03:52 PM


Quote: Originally posted by rws  
This rule can have erratic results,

close >close[1]


I did a little more testing on ES30 min systems and found close>close[1] to be erratic, so I dont think it was a good idea. We need to test these concepts on multiple systems to see if they are generally true.


View user's profile View All Posts By User
rws
Member
***




Posts: 114
Registered: 12-6-2017
Member Is Offline

Mood: No Mood

[*] posted on 4-4-2018 at 04:26 PM


Here are some more examples

http://www.usingeasylanguage.com/free-tradestation-code/patt...

The best patterns could be found with software that specializes in patterns and the best patterns could be in the example above so a custom indicator could test them.


View user's profile View All Posts By User
rws
Member
***




Posts: 114
Registered: 12-6-2017
Member Is Offline

Mood: No Mood

[*] posted on 4-4-2018 at 05:13 PM


That example is if you want to find a pattern in tradestation or in a custom indicator but if you already know the best patterns you could describe all the OHLC comparisons of the last few bars and give them a number and have another parameter activate the predefined pattern.

View user's profile View All Posts By User
cyrus68
Member
***




Posts: 171
Registered: 5-6-2017
Member Is Offline

Mood: No Mood

[*] posted on 4-4-2018 at 11:55 PM


I'm not sure how pattern recognition can be included in GSB.
One thing to remember is that systems focused entirely on pattern recognition, based on price action, are essentially parameterless and can't be walk forwarded.


View user's profile View All Posts By User
rws
Member
***




Posts: 114
Registered: 12-6-2017
Member Is Offline

Mood: No Mood

[*] posted on 5-4-2018 at 06:02 AM


If you have the 10 best patterns in a script, and have assigned a parameter to them then it is still parametric. This is the way how I already do that in Amibroker.

View user's profile View All Posts By User
curt999
Junior Member
**




Posts: 51
Registered: 24-7-2017
Member Is Offline

Mood: No Mood

[*] posted on 5-4-2018 at 12:46 PM


just assign 1 or 0 say for example candlestick patterns it either exists or does not..in the base gsb code result =0 or 1..you would need to output the custom indicator file in the correct format..

View user's profile View All Posts By User
John62
Junior Member
**




Posts: 23
Registered: 29-9-2017
Member Is Offline

Mood: No Mood

[*] posted on 5-4-2018 at 02:38 PM


Quote: Originally posted by Carl  
Hi John62,

Just tried your COT on RB.
Do we need a daily bar for COT? Or just one bar per session?
So ie session is 0900-1430, use a 330 min bar for COT?

Thanks

For RB you have to take the COT based on RB, the data is in Tradestation. The COT report is weekly, i used the daily data (but 5 days have the same value). Correct about the min.


View user's profile View All Posts By User
cyrus68
Member
***




Posts: 171
Registered: 5-6-2017
Member Is Offline

Mood: No Mood

[*] posted on 6-4-2018 at 02:13 AM


In a walk forward you are optimising parameters. Assigning 0 or 1 to patterns does not create a parameter that is optimisable.

View user's profile View All Posts By User
rws
Member
***




Posts: 114
Registered: 12-6-2017
Member Is Offline

Mood: No Mood

[*] posted on 6-4-2018 at 02:34 PM


I still have to test this in GSB but in Amibroker there is no problem at all to do a walk forward with either predefined patterns or search for calculated best patterns based on any condition like RAR/MD, % wins etc for the next forward loop. It just will use the best pattern of the previous period based on WF criteria.

I hope I can do this in GSB because I like to know if combining patterns with indicators will show something. Another thing with patterns is that they are often more stable than indicators at least if you have a couple of predefined patterns that you already have found to be stable over several tickers or many stocks of the index you are trying to optimize.





View user's profile View All Posts By User
rws
Member
***




Posts: 114
Registered: 12-6-2017
Member Is Offline

Mood: No Mood

[*] posted on 6-4-2018 at 02:47 PM


It is not like assigning 0 or 1 to a pattern
P should be the parameter of which specified pattern to use.
The pattern formula should calculates if the current bar results in a 0 or 1 signal.

If p=1 pattern1
if p=2 pattern2
if p=3 pattern3

The pattern will generate a zero or 1 for every bar and I hope GSB could make something out of this. I still have to figure out custom indicators, I hope it allows to do things like this.


View user's profile View All Posts By User

  Go To Top

Trademaid forum. Software tools for TradeStation, MultiCharts & NinjaTrader
[Queries: 59] [PHP: 25.6% - SQL: 74.4%]