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  
 Pages:  1  2    4    6  ..  19
Author: Subject: Report bugs here
boosted
Junior Member
**




Posts: 73
Registered: 16-6-2017
Member Is Offline

Mood: No Mood

[*] posted on 11-7-2017 at 07:17 PM


I know this is not what one would consider a bug, but if any back-testing is going to be properly done with stocks or ETF's, there must be ($ per Share/Contract) added as an option for both Commission and Slippage as it is in TradeStation otherwise GSB cannot properly account for the changing $ cost of each trade.

Regardless if you choose Fixed Quantity (ie 1000 shares) or Capital (ie $100,000) option within GSB the price of the stock or ETF can and will change over time (ie splits, reverse splits). With this in mind, the trading costs (ie commission and slippage) must be accounted for using $ per Share/Contract Cost/Calculation. The spreads change over time depending upon price and volatility including share size / $ amount used for position sizing. Commission and slippage cannot be accounted for the same as one would do for futures. Without this change to GSB any back-testing results for stocks and ETF's will be off and costs not properly accounted for.

Stocks and ETF's costs need to be accurately accounted for. This change will do that.

It should also be noted that adding an option within GSB of "Fill entire order when trade price exceeds limit price" is very important for both futures and stocks. This option in my opinion provides a more accurate and slightly conservative but trustworthy result when back-testing. I realize this is an option within TradeStation but that is after GSB has built and back-tested the strategy. This really should be included as an option and part of GSB. Too many times strategies built without this option can lead to unrealistic back-tested results.

I know I prefer to have these things accounted for when building a strategy so there are no surprises when the strategy is dumped into TS and eventually traded with real $ and results end up not what you expected because these simple things were not taken care of during the build. No doubt others would find this important too.

Finding, testing, more testing, incubating etc. a strategy is time consuming, the last thing a strategy builder wants is to waste more time re-testing because the simple things such as properly accounted for commish/slippage and order fills were not taken care of during the strategy building process.


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




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

Mood: No Mood

[*] posted on 11-7-2017 at 07:24 PM


Hi Boosted
Stock support is not finished, and your idea on commission sounds great.
Currently there is no support for limit orders, all are market entry orders. When we go to limits we can add that feature.
Your commission idea will come out fairly soon as will % return metrics.


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




Posts: 73
Registered: 16-6-2017
Member Is Offline

Mood: No Mood

[*] posted on 11-7-2017 at 07:34 PM


Hi Peter,

An feel an apology is in order. Now that I re-read my post it both sounded redundant and a bit aggressive. I know you didn't mention any of that, but I thought I would since that is the way it sounded to me when I looked at it again. Sorry about that, I'll do better next time.

Sounds like you are on top of it, hope to see these features soon.

Thanks for the update.


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




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

Mood: No Mood

[*] posted on 11-7-2017 at 07:43 PM


Your very welcome. The nature of software so often is people are annoyed at things it wont do, or bugs etc.
The good news is the direction of GSB is good & progress rapid. Look at what win 3.0 (or before) was like, or early andriod compared to now.
Just to clarify. Do we need separate commission and slippage field? Im trying to keep things simple, and as little maths as possible to keep GSB speed very high.


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




Posts: 73
Registered: 16-6-2017
Member Is Offline

Mood: No Mood

[*] posted on 11-7-2017 at 08:16 PM


Some traders pay a flat commission (ie $5-7 per trade) and others like me pay per share. Futures trading involves being charged a flat rate per contract, at least to my knowledge, unlike stocks which can vary per share or per trade as noted above. It is different for each trader depending upon their broker and what plans they offer and what the trader prefers.

Stocks and ETF's have unique commission/slippage requirements that need to be accounted for that futures do not have. Over time the spread for a stock/ETF changes depending upon its price and volatility.

I don't think there is a way to get around accounting for commission and slippage separately.

Trading VXX is a very good example why this is required. It is continually reverse split so if you back-test you will have to use the GSB Capital option (ie 100k) since the price years ago was $15k+ compared to now of only $13+. You would only be trading 6-7 shares back then but now you would be trading over 2000 shares at today's prices, not to mention if I were to add a script to the TS code that traded my ongoing equity balance. As you can see from this extreme example, stocks and ETF's have to include $ per Share/Contract or the whole back-test will fail to account for the ever changing slippage and commission which is based upon how many shares being traded.

So if you are buying 10 shares to start (years ago) but end up in a few years trading multiple thousands of shares, just the spread alone (expressed in pennies) can have a huge impact on slippage and commission (depending upon per trade or per share plan).

It would be nice and convenient to keep it with one input "Commission/Slippage" but unfortunately it has to be separate and be accounted for on a $ per share basis to be true and accurate. This is unique to stocks and ETF's, futures don't have this problem.

I am open to hear any other work around to keep GSB slim and fast.


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




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

Mood: No Mood

[*] posted on 13-7-2017 at 03:00 PM



The tab with the Tradestation code after WF contains the "WF best" data and not the "WF OOS" data.
Is this a bug?


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




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

Mood: No Mood

[*] posted on 13-7-2017 at 03:02 PM
The tab with the Tradestation code after WF contains the "WF best" data and not the "WF OOS" data.




GSB 29.7 screenshot1.png - 676kBGSB 29.7 screenshot2.png - 694kB


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




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

Mood: No Mood

[*] posted on 13-7-2017 at 03:59 PM


Quote: Originally posted by Carl  

The tab with the Tradestation code after WF contains the "WF best" data and not the "WF OOS" data.

Thats correct Carl. We always use the IS curve for live trading, but then what you trade becomes the next OOS.
If you trade using the OOS curve paramaters, your real time results will be degraded.


View user's profile View All Posts By User
moveo
Josef
**




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

Mood: No Mood

[*] posted on 14-7-2017 at 02:26 PM


Since build 29.2 GSB uses other portions of training and test data than chosen in settings.
As example in screenshots,

GSB 28.1 takes correctly the chosen set 50/50, first trade was 2016-02-05.

GSB 29.2 or 30.0 takes other portions as the 50/50 chosen in settings, first trade was 2016-03-29.

Don`t know why it takes nearly two month longer to start the first trade.
As result backtest termination and performance filter settings
don`t work as they are adjusted. This does not stand out if long data like 5 years or more are chosen.

The complete data in my test goes from 2016-01-04 to 2016-12-30

trades300.jpg - 739kBequity300.jpg - 525kB281trades.jpg - 592kB281Equity.jpg - 431kB


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




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

Mood: No Mood

[*] posted on 14-7-2017 at 04:40 PM


Quote: Originally posted by moveo  
Since build 29.2 GSB uses other portions of training and test data than chosen in settings.
As example in screenshots,

GSB works by date, not by trade number. For this example best to put the x axis to date.
Use a long date period to clarify this issue as this will make more clear where the actual start date is in %. For example a system may be trading in test period, but no trades may have occurred for some time. I suspect you have a short range in ES15. This is not good conceptually. GSB needs lots of data to make a more valid statistical model. Also your secondary filter is set to genetic, best be set to closeMinuseCloseD. You should be using other data streams for data2. The 30 min SPX, IDX is fine, as long as they are on the same time zone as ES.15.
In build 30, ES.15.830_TO_1500_centralUSAtime.txt was updated as the old es15 data was bad.

50pc.png - 105kB tradenum.png - 109kB


View user's profile View All Posts By User
moveo
Josef
**




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

Mood: No Mood

[*] posted on 15-7-2017 at 04:44 AM


This setup with 1 year 15min data I use for quick tests. For example to check how different settings influence performance
or when a new GSB build comes out, to see in short what has changed.
In this case with GSB 30.0 I noticed the 2 month delay in trade start compared to GSB 28.1

gsb281.jpg - 525kBgsb300.jpg - 629kB


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




Posts: 73
Registered: 16-6-2017
Member Is Offline

Mood: No Mood

[*] posted on 15-7-2017 at 03:46 PM


I would not say this is a bug, but may be something that was overlooked. I am talking about trading using stop losses.

Specifically, if you create a strategy within GSB that uses a stop loss order, nowhere in the GSB TS script does it account for how many times you may enter or exit a trade intraday.

I ran across this issue when I created a strategy using GSB with a stop loss order (I normally don't do this but was curious). I took the finished GSB TS created script and placed into TS. When reviewing all of the trades in TS
I noticed there were sometimes multiple entries and stop loss exits intraday. Essentially it would enter a trade then hit stop loss for exit, but then very shortly after the strategy would make another entry (I assume indicators still reporting its still good time to enter) only to be exited again at my stop loss. So my stop loss worked but it really didn't as I intended since it was hit the first time then re-entry then stop loss hit again (ie $450 stop loss hit once, then after another entry and stop hit again intraday for another $450 loss).

I don't think this is the intent of most. I believe GSB needs to have an option to limit how many entries or exits can be made in one day. I know how to do this with some editing of TS code, but this option should really be a part of GSB so it can build suitable strategies that work as intended and not be surprised by this type of outcome.

I added this script to fix the problem ( and (EntriesToday(Date) < 1 or EndofSess), but really should be an option within GSB. I added this script to the IF....THEN entry portion of TS script.

When this is added to the IF...THEN entry portion it will limit your entries per date to 1. There is a way to allow for more entries intraday with a small change.


View user's profile View All Posts By User
moveo
Josef
**




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

Mood: No Mood

[*] posted on 16-7-2017 at 01:23 AM


GSB 30.3 is very RAM hungry during WFO .
Ram demand is continuously rising up until Windows shuts down GSB.
32 GB RAM is installed


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




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

Mood: No Mood

[*] posted on 16-7-2017 at 02:37 AM


Hi Moveo, same issue here (32 GB RAM).

In 29.3 it was possible to let GSB run and perform WF 300/300 on 5 strategies at the same time.

In 30.3 I let GSB run and performed only 1 WF, RAM usage went up to 95% and GSB crashed.


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




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

Mood: No Mood

[*] posted on 16-7-2017 at 03:52 AM


When saving a GSB strategy the default file name consists of "save date - save time - generated number (?)".
i.e. 20170716-113347-432949-1.systems

Maybe an idea to use the id number in the Tradestation script as the default file name?
i.e. // ID: 20170715-213402-848098-VLxP3


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




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

Mood: No Mood

[*] posted on 16-7-2017 at 07:50 PM


I will look into the ram issue. I found dropping population helped a lot, and gave me lots more speed.
Im also going to add a peak ram counter, not just ram. With 15 min of data and lots of data streams, I hit 60gb of ram usage with 300 population.
speed double now im on 150 population.
Factors in ram are the amount of bars in the data streams, and the amount of secondary data streams.
More ram is likely due to us doing the same precision in numbers as TS. This is one of the reasons for TS<>GSB.
A month or so ago, we dropped the precision to significantly drop the ram useage. If its a choice of TS=GSB vs ram, we chose TS=GSB
Later note. On defaults of 2 secondary data streams, I think im peaking 8.5 gb of ram. Its when I had 15 min bars and 5 data2 that ram blew out heaps.


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




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

Mood: No Mood

[*] posted on 16-7-2017 at 07:53 PM


Quote: Originally posted by Carl  
When saving a GSB strategy the default file name consists of "save date - save time - generated number (?)".
i.e. 20170716-113347-432949-1.systems

Maybe an idea to use the id number in the Tradestation script as the default file name?
i.e. // ID: 20170715-213402-848098-VLxP3


I think thats a good idea. Will get it on to do list.


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




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

Mood: No Mood

[*] posted on 16-7-2017 at 07:54 PM


Quote: Originally posted by boosted  

I added this script to fix the problem ( and (EntriesToday(Date) < 1 or EndofSess), but really should be an option within GSB. I added this script to the IF....THEN entry portion of TS script.

When this is added to the IF...THEN entry portion it will limit your entries per date to 1. There is a way to allow for more entries intraday with a small change.


We will put this on the to do list. Good idea.


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




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

Mood: No Mood

[*] posted on 16-7-2017 at 08:02 PM


Quote: Originally posted by moveo  
Since build 29.2 GSB uses other portions of training and test data than chosen in settings.
As example in screenshots,

GSB Will not take the trade on the first bar of data.
It takes trades when the first signal comes up.
You could save the system from 29 build and load on 30 build, and see where the first trade comes up.


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




Posts: 39
Registered: 7-7-2017
Member Is Offline

Mood: No Mood

[*] posted on 17-7-2017 at 02:32 AM


I was backtesting with my own data (exported from Ninjatrader) on GSB version 29.2 it was working fine -- but when I try the same data on version 30.3, I get exceptions


System.AggregateException: One or more errors occurred. ---> System.ArithmeticException: Function does not accept floating point Not-a-Number values.
at System.Math.Sign(Double value)
at GSB.Rpn.RpnExpression.ZeroSafe(Double Value)
at GSB.Rpn.RpnExpression.Evaluate()
at GSB.Strategies.GsbStrategy.OnBarClose(Bar bar)
at GSB.Strategies.TsStrategy.Backtest()
at GSB.Optimizers.GeneticAlgorithm.BackTest(Single[] parameters, Int32 i, ParallelLoopState state, PerformanceSummary[] performances)
at GSB.Optimizers.GeneticAlgorithm.<>c__DisplayClass83_0.b__0(Int32 i, ParallelLoopState state)
at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.b__1()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.b__0(Object )
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
at System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, Action`2 body)
at GSB.Optimizers.GeneticAlgorithm.OptimizeChromosomes(Chromosome[] chromosomes, Int32 index)
at GSB.Optimizers.GeneticAlgorithm.Optimize()
at GSB.Optimizers.Optimizer.Optimize(Boolean isResume)
at GSB.UI.Forms.MainForm.<>c__DisplayClass106_0.b__0()
---> (Inner Exception #0) System.ArithmeticException: Function does not accept floating point Not-a-Number values.
at System.Math.Sign(Double value)
at GSB.Rpn.RpnExpression.ZeroSafe(Double Value)
at GSB.Rpn.RpnExpression.Evaluate()
at GSB.Strategies.GsbStrategy.OnBarClose(Bar bar)
at GSB.Strategies.TsStrategy.Backtest()
at GSB.Optimizers.GeneticAlgorithm.BackTest(Single[] parameters, Int32 i, ParallelLoopState state, PerformanceSummary[] performances)
at GSB.Optimizers.GeneticAlgorithm.<>c__DisplayClass83_0.b__0(Int32 i, ParallelLoopState state)
at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.b__1()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.b__0(Object )<---


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




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

Mood: No Mood

[*] posted on 17-7-2017 at 02:41 AM


Quote: Originally posted by emsjoflo  
I was backtesting with my own data (exported from Ninjatrader) on GSB version 29.2 it was working fine -- but when I try the same data on version 30.3, I get exceptions
<---

Here is a possible explanation.
Does 30.2 continue building systems, but give an exception?
Is the speed about normal?
If so then one of the combinations of indicators gives this error, and its not related to the version number.


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




Posts: 39
Registered: 7-7-2017
Member Is Offline

Mood: No Mood

[*] posted on 17-7-2017 at 03:25 AM


30.3 seemed to continue building systems after the exception -- albeit at a much slower rate -- like 100/min instead of 5-7k/min.
I'm wondering if it is because my data includes the night session


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




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

Mood: No Mood

[*] posted on 17-7-2017 at 03:27 AM


the slow speed means there are multiple exceptions. Night session is ok, but there must be issues with your data.
Might be an idea to not mix ts and ninja data


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




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

Mood: No Mood

[*] posted on 17-7-2017 at 06:34 AM


Quote: Originally posted by moveo  
GSB 30.3 is very RAM hungry during WFO .
Ram demand is continuously rising up until Windows shuts down GSB.
32 GB RAM is installed

This should be fixed in 30.5
Testing it now and hope to release it < 24hours.
It also has intraday drawdown metrics


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




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

Mood: No Mood

[*] posted on 17-7-2017 at 06:38 PM


Quote: Originally posted by moveo  
GSB 30.3 is very RAM hungry during WFO .
Ram demand is continuously rising up until Windows shuts down GSB.
32 GB RAM is installed


This is fixed in 30.5.
I had 15 min with about 6 data streams crash on 64 gb of ram.
Runs fine now.


View user's profile View All Posts By User
 Pages:  1  2    4    6  ..  19

  Go To Top

Trademaid forum. Software tools for TradeStation, MultiCharts & NinjaTrader
[Queries: 67] [PHP: 35.0% - SQL: 65.0%]