GSB Forums

Swing trading systems

jptann - 6-8-2017 at 05:07 PM

Peter:

I wanted to run some studies on swing trading. I turned the Market on close to false, but I'm not getting any systems. I lowered the PF but increased the minimum NP in the settings, also included and increase in a number of trades. Did I just make the criteria too difficult or is there some other switches that need to be modified.

Thanks

admin - 7-8-2017 at 01:47 AM

Swing wont work as well as moc for ES. Start by putting appsettings - allowing alloos to pass. (alloosallow.txt)
Allow the training metrics under app settings to be loose too, then tighten them up as you get some systems coming.

crazyhedgehog - 7-8-2017 at 01:38 PM

I managed to build swing systems for US/S/W etc so can be done. Best is to do as Peter suggested and also try different fitness formulas to see which one gives higher % of systems that pass OOS (at least that's the approach I use).

jptann - 8-8-2017 at 02:17 PM

Peter:

Using your suggestions I had no issue getting some strategies. I was asking for too many trades. The good news is that all the good looking trades utilized my proprietary indicator that I have been using for the last 20 years, so it did give me a good feeling about what I have been doing.

Your system came back with many fewer trades (400 trades) since 2000 or around 20 per month. The good news is that it was earning a little more than $10K per year and the out of sample validation trades continued in this vain. Of course the drawdown was more than I want but that can be mitigate within a portfolio.

Good job on the custom indicator implementation. Big improvement for swing systems.

None of the day trading systems use the indicator and I believe that is because the indicator reacts too slow. I need to investigate a faster version of it and will try that next.

admin - 9-8-2017 at 04:56 AM

Please keep us informed with your progress. Im happy its working well.

emsjoflo - 11-8-2017 at 05:02 AM

What should I name a daily file? What time and hour/minute format? I tried load a daily txt file that I had working on an earlier version of GSB and it makes GSB version 34.9 crash

admin - 11-8-2017 at 05:05 AM

user need something like ES.1440.Minutes.anything.txt, assuming you have 1440 minutes in a day.
Daily ok for data2, but I dont think it will wok, or work well with data1. Untested by me but thats my gut reaction.

emsjoflo - 11-8-2017 at 05:19 AM

It was trying version 34.9. It seems to be working on ver.32.7

admin - 11-8-2017 at 05:35 AM

Filename format changed in 34.9 to acomadate seconds

emsjoflo - 11-8-2017 at 05:39 AM

Got it working with daily data. I had to add the symbol to the Contracts list. (Menu:Tools/Contract List)

jptann - 11-8-2017 at 11:22 AM

Peter:

I was using 33.1 and had the day trading system marked. I used an ES file for 29M with time of 0845_1503, all central time. The runs produced in the GSB did not reflect the set exit on close correctly and had many trades that went for many days. I said maybe I needed to calculate the time closes differently, but when I picked one of the strategies and placed it in TS, the set exit on close worked perfectly. Of course, I got different results, but there may be a bug in the GSB version they way it recognizes and end of day marker. I made sure the times were Exchange times and also this last bar would indicate an end of day as I set up the TS data stream.

I will go back to using 30 minute files. Seems to not have an issue with these, but different time frames around 30M are interesting since the whole world is on 30M bars

emsjoflo - 11-8-2017 at 12:18 PM

Has anyone been able to get any results with daily data? I'm not getting any trades. I thought I had it working with an earlier version but the versions earlier than 30.0 say the code is too old to run.

admin - 11-8-2017 at 11:40 PM

Quote: Originally posted by jptann  
Peter:

I was using 33.1 and had the day trading system marked. I used an ES file for 29M with time of 0845_1503, all central time. The runs produced in the GSB did not reflect the set exit on close correctly and had many trades that went for many days. I said maybe I needed to calculate the time closes differently, but when I picked one of the strategies and placed it in TS, the set exit on close worked perfectly. Of course, I got different results, but there may be a bug in the GSB version they way it recognizes and end of day marker. I made sure the times were Exchange times and also this last bar would indicate an end of day as I set up the TS data stream.

I will go back to using 30 minute files. Seems to not have an issue with these, but different time frames around 30M are interesting since the whole world is on 30M bars

Go to tools, contracts list and make sure the session close time is 1503

Swing Trade issues

boosted - 12-6-2018 at 01:30 PM

I'm trying to build a very simple swing trade test strategy for pre-processing using SPY as Dat1 and various cash/indexes as Data2.

My app settings are alloos default app. The opt. settings are mostly default with some very minor changes including changing Quantity since SPY is the Data1 tradeable.

The problem I am having is that every single trade that opens will close same day at close, which is not swing trading but day trading. I tried turning Market on Day Close to true and false and tried Minutes option also. I have Times of Day set to 16:00:00 for exit but would prefer exit and entry to be determined by GSB and whatever entry and exit times (open or close of day) it finds to be best.

For the life of me I cannot figure out why its closing every trade same day its opened. I have read through many forum posts, read documentation on this subject (very sparse) and haven't had any luck getting it to carry a position past the day of entry into the future.

I don't want to use Target or Stop Loss options, I simply want GSB only to enter and exit trades at open or close of day, also allow the trade to stay open for days not close it out EOD all the time (perplexing why it does this). I want to force GSB to only open or close a position at market open or market close, whatever it deems most suitable for the swing trade. I can easily do this in TS but can't seem to get GSB to do this.

Also, I found I can't use SPY390m in Data1 and an index with 390m in Data2 and find any systems.

Any help is appreciated.

admin - 12-6-2018 at 04:10 PM

Quote: Originally posted by boosted  
I'm trying to build a very simple swing trade test strategy for pre-processing using SPY as Dat1 and various cash/indexes as Data2.

My app settings are alloos default app. The opt. settings are mostly default with some very minor changes including changing Quantity since SPY is the Data1 tradeable.

The problem I am having is that every single trade that opens will close same day at close, which is not swing trading but day trading. I tried turning Market on Day Close to true and false and tried Minutes option also. I have Times of Day set to 16:00:00 for exit but would prefer exit and entry to be determined by GSB and whatever entry and exit times (open or close of day) it finds to be best.

For the life of me I cannot figure out why its closing every trade same day its opened. I have read through many forum posts, read documentation on this subject (very sparse) and haven't had any luck getting it to carry a position past the day of entry into the future.

I don't want to use Target or Stop Loss options, I simply want GSB only to enter and exit trades at open or close of day, also allow the trade to stay open for days not close it out EOD all the time (perplexing why it does this). I want to force GSB to only open or close a position at market open or market close, whatever it deems most suitable for the swing trade. I can easily do this in TS but can't seem to get GSB to do this.

Also, I found I can't use SPY390m in Data1 and an index with 390m in Data2 and find any systems.

Any help is appreciated.


Try turning secondary filters off. If that doesnt work do a support upload. (under help) Its been maybe six months since I tried to do what your doing, so very rusty on it.

jptann - 13-6-2018 at 12:44 PM

I think the issue is with your exit time for SPY. I work in commodities, so not sure. Is the last bar for SPY end at 4PM East Coast Time or does it trade further into the overnight market. Finally, is you are doing a swing trade, are you using after hour trading as part of your data? This will influence the system. Make sure your day trading switches are off. That is, do not close at the end of the day trading or use the "set market on close" instructions.

One final idea. Are you using limit trades. Sometimes you can't be assured of a trade, so I would recommend no limit trades and some reasonable slippage for each market trade implemented. Its been a long time since I traded stocks so I'm not sure what a good slippage would be, but you should have some negative impact to the system when you input a market order at the open of the next bar. There is no assurance that you can get that market price, so the way to handle this is to go back in your actual trading history and see what the SPY slippage is. It may be trivial, like $0.01 but on the ES (futures) 1/2 of a tick for each market order is what I have averaged over the last 20 years. So I charge each of the contracts I trade a very healthy commission ($1.50 per side per contract) along with a $6.25 slippage for each side per contract. My experience is that with these type of costs figured in, high frequency "scalp" type trades are not available to me and I need to do a lot more work. Since I only work on commodities, I suspect your issue is how SPY is set up in GSB and how you use any custom time frames for closing the trade or trading in the after market. Hope this helps somewhat. Peter is usually very good about his response, unless he is traveling somewhere out of Australia.

Carl - 13-6-2018 at 01:35 PM

Earlier today I started four GSB runs to build four sets of swing trading systems.
Bar sizes 30, 60, 60 and 120 minutes. Only data1, no data2.

Switched off the Market on close exit. Am using a stoploss and a profit target twice the stoploss.

In this case I don't care when the entry is and when the exit.

Everything seems to work okay.

I wonder if it is possible to set GSB to build swing strategies that only trade on open or on close?

boosted - 13-6-2018 at 02:09 PM

Quote: Originally posted by jptann  
I think the issue is with your exit time for SPY. I work in commodities, so not sure. Is the last bar for SPY end at 4PM East Coast Time or does it trade further into the overnight market. Finally, is you are doing a swing trade, are you using after hour trading as part of your data? This will influence the system. Make sure your day trading switches are off. That is, do not close at the end of the day trading or use the "set market on close" instructions.

One final idea. Are you using limit trades. Sometimes you can't be assured of a trade, so I would recommend no limit trades and some reasonable slippage for each market trade implemented. Its been a long time since I traded stocks so I'm not sure what a good slippage would be, but you should have some negative impact to the system when you input a market order at the open of the next bar. There is no assurance that you can get that market price, so the way to handle this is to go back in your actual trading history and see what the SPY slippage is. It may be trivial, like $0.01 but on the ES (futures) 1/2 of a tick for each market order is what I have averaged over the last 20 years. So I charge each of the contracts I trade a very healthy commission ($1.50 per side per contract) along with a $6.25 slippage for each side per contract. My experience is that with these type of costs figured in, high frequency "scalp" type trades are not available to me and I need to do a lot more work. Since I only work on commodities, I suspect your issue is how SPY is set up in GSB and how you use any custom time frames for closing the trade or trading in the after market. Hope this helps somewhat. Peter is usually very good about his response, unless he is traveling somewhere out of Australia.


Yes, I always put commish and slippage in every backtest no matter what. In this case I used 390m SPY data1 and SPX data2. I did finally get it to work today. I did turn off Market on Close (I did this before with no luck) and was able to keep Secondary Filter Enabled. Who knows why it finally decided to give some systems. Also, it did hold positions for multiple days. Thanks for you input jptann.

boosted - 13-6-2018 at 02:21 PM

Quote: Originally posted by Carl  
Earlier today I started four GSB runs to build four sets of swing trading systems.
Bar sizes 30, 60, 60 and 120 minutes. Only data1, no data2.

Switched off the Market on close exit. Am using a stoploss and a profit target twice the stoploss.

In this case I don't care when the entry is and when the exit.

Everything seems to work okay.

I wonder if it is possible to set GSB to build swing strategies that only trade on open or on close?


Good ideas for me to keep in mind when putting together a swing trade GSB.

I only want to open and close trades at the open or close of market. I was able to get it to open and close at close of day using 390m data1 and 2. Unfortunately I dont know of any way to force GSB to open or close trades at open of day.

Good thing is I got it to finally work. The downside is no GSB strats were as profitable and good as a very crued simple one I put together on TS using only one indicator. I would think considering the brute power and complexity of GSB it would at the very least come up with one of many strategies that met or exceeded the simple one indicator I built. Very odd.

I have a question for you Carl. Is it possible to build swing strats using 390m as Data1 and a combo of smaller time frames on Data 2?

By the way, thanks for chiming in, you too jp. Nice that others are here to help others.

admin - 13-6-2018 at 04:15 PM

[rquote]

I only want to open and close trades at the open or close of market. I was able to get it to open and close at close of day using 390m data1 and 2. Unfortunately I dont know of any way to force GSB to open or close trades at open of day.
[/rquote]
Currently GSB is using only market on close orders. Limits,stop and open planed but the exits and additional secondary filter is likely next after the multidata frame trading.
The mutidata frame is close to finished, but stops and secondary filters are a big job to complete

boosted - 13-6-2018 at 06:45 PM

sounds good Peter. Look forward to the new multidata feature.

Thanks for update

boosted - 15-6-2018 at 10:56 AM

UPDATE: Once I got the SPY 390m Data1 and Data2 working I found something else that seems odd with the strategy results that I hope somebody can offer an explanation.

Issue: I am using SPY 390m data since its inception (Feb 93'). Strategy backtest bars is set to 500 in GSB and TS. When GSB produces thousands of strategies every single one I looked at (at least 100+) all have first trade date in June/July of 2004. This is a swing trade system. I dont have stops, profit targets or anything else of any significance that would cause GSB to require 11yrs of data to produce its first trade. That is extremely odd.

Can anyone offer an explanation behind why this might be. I figured I would start seeing trade results starting in mid to late 95' at minimum and 96' for sure.

Is there some logic in GSB causing this oddity?

Thanks.


admin - 15-6-2018 at 03:40 PM

Quote: Originally posted by boosted  
UPDATE: Once I got the SPY 390m Data1 and Data2 working I found something else that seems odd with the strategy results that I hope somebody can offer an explanation.

Issue: I am using SPY 390m data since its inception (Feb 93'). Strategy backtest bars is set to 500 in GSB and TS. When GSB produces thousands of strategies every single one I looked at (at least 100+) all have first trade date in June/July of 2004. This is a swing trade system. I dont have stops, profit targets or anything else of any significance that would cause GSB to require 11yrs of data to produce its first trade. That is extremely odd.

Can anyone offer an explanation behind why this might be. I figured I would start seeing trade results starting in mid to late 95' at minimum and 96' for sure.

Is there some logic in GSB causing this oddity?

Thanks.

Do you have closed secondary filter enabled? Try it disabled.
Try the dow data instead.(build new systems on it)
You could also try verification data on the dow.
I build day trading system since 1997 or 2000 on ES, so suspect you have a data issue.
Try puting a system out of GSB to ts, make sure no date filters are active in the code, and see if it trades.

boosted - 15-6-2018 at 04:52 PM

I built the strategies with Closed secondary filter disabled. It had no problem building thousands of strategies.

I dumped a random strategy that was built by GSB into TS and first trade was exactly as I described before, first trade June/July 2004 instead of what I would of expected June/July 2000.

I then followed your instructions and commented out the begin date portion of the code and sure enough first trade started in June 2000 so that is what I would of expected
from GSB instead of trades starting in June 2004.

So I am curious now. Why did GSB put a begin date in the final code of June 2004? I used default opt. settings dates (1900-2100) so
not sure what the GSB logic was to place begin date June 2004 into code.

Also, I am now wondering if GSB built all of the strategies correctly using the data from inception of SPY. My data file starts with inception of SPY, which is July 98'. I double checked my data file
and everything looks correct (start and end dates for data).

So I am now left wondering if GSB logic is working correctly.

Any thoughts?

boosted - 15-6-2018 at 05:07 PM

sorry, made a mistake.

I was looking at a true SPY daily chart vs the SPY 390m chart.

Why is it when I open a SPY 390m chart the max data I get is July 98' whereas if I open a true daily bar SPY chart it goes back to inception Feb 93'. That is a big difference. That means GSB won't ever look at data prior to July 98 because GSB only accepts 390m chart data not a true Daily chart data stream, correct?

But my orignal commentarty about the begin date GSB trades remains that same.

admin - 15-6-2018 at 09:33 PM

Try Dow and try the same code in ts. Make sure no date filters active. If it doesn't go in ts it's possible the range is too low to trigger the systems. In excel you could convert daily code to 390 then export again as csv

boosted - 18-6-2018 at 04:36 PM

I am a bit confused as to how exactly I do this...."In excel you could convert daily code to 390 then export again as csv."

I have SPY390m data that can only go back to July 98' in TS. But if I load up a TS SPY Daily chart I can get data back to Feb 93'.

I tried taking daily SPY data and copy and paste the data into SPY 390m .txt file but GSB won't accept even though looking at the daily data compared to 390m data
it looks the same.

Detailed steps as to how I can take SPY daily data from Feb 93' to June 98' and add to 390m SPY .txt file that works with GSB would be greatly appreciated since the data looks same to me but GSB for some reason not liking it.

Thanks.

admin - 18-6-2018 at 05:12 PM

Quote: Originally posted by boosted  
I am a bit confused as to how exactly I do this...."In excel you could convert daily code to 390 then export again as csv."

I have SPY390m data that can only go back to July 98' in TS. But if I load up a TS SPY Daily chart I can get data back to Feb 93'.

I tried taking daily SPY data and copy and paste the data into SPY 390m .txt file but GSB won't accept even though looking at the daily data compared to 390m data
it looks the same.

Detailed steps as to how I can take SPY daily data from Feb 93' to June 98' and add to 390m SPY .txt file that works with GSB would be greatly appreciated since the data looks same to me but GSB for some reason not liking it.

Thanks.


look at this data
//daily bars
"Date","Time","Open","High","Low","Close","Vol","OI"
05/07/2018,16:00,266.89,268.02,266.11,266.92,55304907,0


//390 min
"Date","Time","Open","High","Low","Close","Up","Down"
05/07/2018,16:00,266.90,268.02,266.11,266.91,20882710,20715663

they are the same except how volume works. So you could rename a daily bar csv to be es.390.minute.txt
You will have to disable indicators that use volume, or risk mild issue where TS<>GSB. There is only a few and I have had a mental blank as to what ones. I can ask programmer.
My logic for this is 20882710+20715663 <>55304907

If this is rejected by GSB, let me know The issue will be the volume format.

moveo - 20-7-2018 at 07:03 AM


This week I tried to find swing systems on ES.
I had good luck with the first 10 min run GSB.
Very stable oos with only 3 Indicators

perf.jpg - 280kB equity.jpg - 213kB

admin - 20-7-2018 at 03:42 PM

Quote: Originally posted by moveo  

This week I tried to find swing systems on ES.
I had good luck with the first 10 min run GSB.
Very stable oos with only 3 Indicators


Thats impressive and I'm keen to build some.
Can you publish some settings used. What were results like from 2000 to 2004. I normally use 2000 on-wards.
Did you do market verification tests at all?

moveo - 20-7-2018 at 11:09 PM

I used all data jan 2004 - feb 2017 for training, 2000 stop,
2000 target, all other pretty much GSB standard settings.
Tried nth day feature but had no luck with swing systems.
Sadly I could not repeat it to get a comparable system with this
quality.This is the nature of genetic algorithm.
So the potential in GSB is great, but the art is to
fish it out.

equity1.jpg - 185kB

It is interesting to know whether there has been progress in research with the swing trade

Yishke - 9-4-2021 at 09:15 AM

Quote: Originally posted by moveo  

This week I tried to find swing systems on ES.
I had good luck with the first 10 min run GSB.
Very stable oos with only 3 Indicators


admin - 9-4-2021 at 05:22 PM

@moveo SO much has happened in GSB, and its like you have got the star ship enterprise with a entire galaxy to explore.
You should try secondary filter closedlessClosedbpv and also try (separately) the closetohighlow3{v4} secondary filter.
also try closetohighlow3{v4} secondary filter. with these settings. Not sure if they are in your build, but will be when I release the next build < 1 week
I assume you tried long only


tf.png - 185kB

engtraderfx - 28-9-2021 at 06:44 AM

Hi Peter, I am running a swing system in multicharts with TP & SL of 2000 using inbuilt functions SetStopLoss / SetProfitTarget, don't know if see this in TS but i notices MC seems to track the open profit/loss even outside session time (830 to 1500) I assume as the continuous symbol is pretty much 24 hour, & therefor has exited at stop or profit. Backtests fine but in real time seems to be exiting incorrectly. Wondering if anyone else has issue, thinking I may need to hard code the exits based on price so only calculated during session time? Any thought, dave

Daniel UK1 - 28-9-2021 at 02:28 PM

engtraderfx, fwiw, i execute on MC, and for index swings, i use rth custom session time in mc, and only allow execution within rth setting in IB... i also manage stops and target emulation locally... (to avoid cross order issue with i with intraday systems)
In this setup you will not face the issue you are having..

Question is though, what data you have used to build your systems on, 24h ? then you cant use my above setup of course, i only use rth as build data... and not 24h but regulate entry and exit by gsb time setting in left side gui.


Daniel UK1 - 28-9-2021 at 02:34 PM

Quote: Originally posted by moveo  
I used all data jan 2004 - feb 2017 for training, 2000 stop,
2000 target, all other pretty much GSB standard settings.
Tried nth day feature but had no luck with swing systems.
Sadly I could not repeat it to get a comparable system with this
quality.This is the nature of genetic algorithm.
So the potential in GSB is great, but the art is to
fish it out.



It might sounds "unlogical" but often using all data, is less good that nth...

Included macros by peter for swings, will provide you with systems far better than what you show, use that as benchmark, that you can try to beat.
(that is hard for swings) since included settings is very good.
Stops i think you will find that 2k for swings will not be good for index.

bidirectional systems for swing index is much more difficult than directional.

Just a few cents of thoughts, good luck.

admin - 29-9-2021 at 12:06 AM

From memory im using nth 80 for build that converts to nth all when its in the manager.
Systems should appear much better if nth all was used, but thats because nothing is out of sample while my method gives 50% out of sample.
The test would be what the out of sample stats are like between the two methods
Agreed bydirectional is harder. Ive made one but I dont think its as good as the long only.
Thanks for your comments.

engtraderfx - 29-9-2021 at 04:57 AM

Quote: Originally posted by Daniel UK1  
engtraderfx, fwiw, i execute on MC, and for index swings, i use rth custom session time in mc, and only allow execution within rth setting in IB... i also manage stops and target emulation locally... (to avoid cross order issue with i with intraday systems)
In this setup you will not face the issue you are having..

Question is though, what data you have used to build your systems on, 24h ? then you cant use my above setup of course, i only use rth as build data... and not 24h but regulate entry and exit by gsb time setting in left side gui.



Thanks Daniel, i checked setting & using local emulation, hmm. In MC Quote Manager I just set to full session time & just use MC session time to use data i need for 830-1500. (I do that in case I need data for different session times). Maybe that's how MC works, it seems to keep calculating open profit outside session time? Might look at calculating TP / SL as per Peters code for stops.

Daniel UK1 - 29-9-2021 at 06:11 AM

Quote: Originally posted by engtraderfx  
Quote: Originally posted by Daniel UK1  
engtraderfx, fwiw, i execute on MC, and for index swings, i use rth custom session time in mc, and only allow execution within rth setting in IB... i also manage stops and target emulation locally... (to avoid cross order issue with i with intraday systems)
In this setup you will not face the issue you are having..

Question is though, what data you have used to build your systems on, 24h ? then you cant use my above setup of course, i only use rth as build data... and not 24h but regulate entry and exit by gsb time setting in left side gui.




Thanks Daniel, i checked setting & using local emulation, hmm. In MC Quote Manager I just set to full session time & just use MC session time to use data i need for 830-1500. (I do that in case I need data for different session times). Maybe that's how MC works, it seems to keep calculating open profit outside session time? Might look at calculating TP / SL as per Peters code for stops.


First thing you should try to figure out, is what data session did you build on to get the traded system from GSB? if you used 24h data or rth session?

You need to make sure you are using the ame for your real trading of the system in MC.

You control sessioin time in MC from custom session templates used..
If you create a session template that only uses rth, liike 830 - 15 .. then you will only get targets and stops based on that active sessioin.

But check data file you used in GSB, 24 data or rth ? or you used peters data .. i believe then its 830 - 15..

But you really "should" only use your own data, so you can control and make sure you use what it is you actually wants to use..



engtraderfx - 30-9-2021 at 07:22 PM

Hi, yes its all built on IQ data with session time 830 to 1500 & use same for custom session time. I use the continuous IQ contract @ES#C as feed & map to current contract in IB (MESZ1 for example). Works fine for day trade systems but noted MC keep calculating real time Profit / Loss outside of session time.

engtraderfx - 30-9-2021 at 07:23 PM

Hi, yes its all built on IQ data with session time 830 to 1500 & use same for custom session time. I use the continuous IQ contract @ES#C as feed & map to current contract in IB (MESZ1 for example). Works fine for day trade systems but noted MC keep calculating real time Profit / Loss outside of session time.

admin - 30-9-2021 at 08:11 PM

it might be ok if mc calculates that out of hours, as long as trades dont execute out of hours. Performance reports should not show any a/hours data.
Otherwise if there is a day session es contract, you could try that

engtraderfx - 17-10-2021 at 05:30 PM

fyi just saw comment by Daniel UK1 on general support post which reflects my experience....stop/profit targets continue to be calculated by MC outside of session time on local emulation which I thought needed as stops/limits we want only executed during session. Just had another one last week hit TP outside session time but should have executed (for higher profit) on open of next bar, interested to see how resolve that issue? Otherwise i may try internal coding for Stop/PT.

"Also, i found out the hard way, that MC calculates stops and targets when using local emulation by using BROKER (NOT your data provider )prices regardless of session time used, so DONT use local emulation if anyone is executing with MC."


admin - 17-10-2021 at 06:07 PM

@engtraderfx. This is news to me as ts hypothetical reports normally match ts reports extremely close. Could the issue be in forward testing they use the a/h data?
It could be fine to calculate real time profits after hours, as long as you dont take fills out of hours. Are the stop and pt held in the exchange after hours?
Should I document how to use local emulation? No idea what it looks like but a screen shot could be good.
Im not sure if internal coding will fix this issue, but im interest to know if it does.

engtraderfx - 17-10-2021 at 09:40 PM

Peter, yes the issue is backtests are fine in MC, the issue is as noted MC calculates stops & executes in realtime even outside session time. I haven't found a workaround yet, wanted to work in local mode to prevent overlap of other systems & thought it would work but does't so far. I could try limiting the mapped data for current contract to session time as well but not sure that works or even want to as may need data for other systems. Will try setting up internal coding for profit / stop (similar to existing gsb code i would think), albeit will rely on real time market orders as per local emulation. Will pass on code when I get around to it.

cheers, dave

Daniel UK1 - 18-10-2021 at 01:59 AM

Entrader, Yeah its a tricky one, local emulation setting in MC can not be used, since MC will use broker feed for sending stops and targets, i.e you used session time is redundant. The stops and targets will hit 24h if using local emulatioin.
So backtests will look fine but live trading not the same.

If this shall work, Only possibility is to emulate stops and targets in the GSB code and not MC, then the session time will be respected.

Peter, i propose that for swing systems this is done by GSB perhaps as an option ? send stops and targets when hit or as now at position entered.

admin - 18-10-2021 at 02:13 AM

Quote: Originally posted by Daniel UK1  
Entrader, Yeah its a tricky one, local emulation setting in MC can not be used, since MC will use broker feed for sending stops and targets, i.e you used session time is redundant. The stops and targets will hit 24h if using local emulatioin.
So backtests will look fine but live trading not the same.

If this shall work, Only possibility is to emulate stops and targets in the GSB code and not MC, then the session time will be respected.

Peter, i propose that for swing systems this is done by GSB perhaps as an option ? send stops and targets when hit or as now at position entered.

stops after they hit is too dangerous if its if openequity<-stoploss then ... exit
this is upto 30 minute delay on the exit if your on 30 min bars
seems silly you need to code around such a basic issue in MC. after all these years no one has ever brought it to my attention. Does mc support have a fix for this?

Daniel UK1 - 19-10-2021 at 02:28 AM

Quote: Originally posted by admin  
Quote: Originally posted by Daniel UK1  
Entrader, Yeah its a tricky one, local emulation setting in MC can not be used, since MC will use broker feed for sending stops and targets, i.e you used session time is redundant. The stops and targets will hit 24h if using local emulatioin.
So backtests will look fine but live trading not the same.

If this shall work, Only possibility is to emulate stops and targets in the GSB code and not MC, then the session time will be respected.

Peter, i propose that for swing systems this is done by GSB perhaps as an option ? send stops and targets when hit or as now at position entered.

stops after they hit is too dangerous if its if openequity<-stoploss then ... exit
this is upto 30 minute delay on the exit if your on 30 min bars
seems silly you need to code around such a basic issue in MC. after all these years no one has ever brought it to my attention. Does mc support have a fix for this?


Sorry Peter, obviously one should not wait to send stop order until bar close.

I think the issue with local emulation have arrised only lately when swing systems was introduced in GSB, and the issue of needing to use "ocal emulation" therefore only came up now, and with this also brought the issue that MC forcing the use of broker price..

I have spoken to MC in length about this, and there is no way around it.
MC uses broker price, either trade or bid,ask, if using local emulation.
Making your session template useless for limiting stops and targets to a certain session.

Only way around this is to adapt code.

admin - 19-10-2021 at 02:53 AM

what about not having market held orders, and only send order when mc detects a fill. This is the method I used on IBlink.
"If this shall work, Only possibility is to emulate stops and targets in the GSB code and not MC"
I dont know how to adapt the code regardless. you can have a stop keyed to entry price, but I dont see how thats going to fix things.

Daniel UK1 - 19-10-2021 at 04:03 AM

Yes we are trying to get away from having market held orders since this is the issue in the first place.

So yes, not having market held orders is the solution, but question is how to solve this in the code itself by GSB.
Local emulation is ruled out as we now know.




admin - 19-10-2021 at 05:05 AM

Quote: Originally posted by Daniel UK1  
Yes we are trying to get away from having market held orders since this is the issue in the first place.

So yes, not having market held orders is the solution, but question is how to solve this in the code itself by GSB.
Local emulation is ruled out as we now know.

would if time <1500 then setstoploss(stp) work. Its not active at close of last bar, but active every other bar


Daniel UK1 - 19-10-2021 at 04:41 PM

Quote: Originally posted by admin  
Quote: Originally posted by Daniel UK1  
Yes we are trying to get away from having market held orders since this is the issue in the first place.

So yes, not having market held orders is the solution, but question is how to solve this in the code itself by GSB.
Local emulation is ruled out as we now know.

would if time <1500 then setstoploss(stp) work. Its not active at close of last bar, but active every other bar



Hi Peter, good idea, but sadly it would not solve the main issue, and that is to avoid having the orders held at exchange, since the issue we are facing is that the market held orders when using stops and targets, creates problems since during the swing trades many intraday systems will take crossing direction orders, creating issues at IB.

So what we want to achieve, is to have the option to have gsb swing system not send orders resting at exchange but rather to send them when trade or bid/ask hit for the stop or target for the symbol .

Tricky issue this.

admin - 20-10-2021 at 04:39 AM

very hard to fix the ib issues if you go short and long at the same time. THats outside the scope of gsb
if you delay by a few seconds one entry order if you get two at once, MIGHT help the issue.

your going to get less issues if you dont have a market held PT.
doing if openpostiionprofit>pt then sell at next bar / or
if openpostiionprofit*0.8>pt then sell at entryprice+ptpoints limit is going to help but not resolve the issue
you can also make multiple sub accounts at IB. I know thats a pain as you cant cross margin, but you should be trading roughly twice exchange margin capital levels

Mathematical manipulation of a known indicator

Yishke - 27-10-2021 at 01:25 AM

Text Is it possible in GSB to build, not only a combination of indicators, but also an indicator within another indicator or a mathematical manipulation of a known indicator?

admin - 27-10-2021 at 02:06 AM

Quote: Originally posted by Yishke  
Text Is it possible in GSB to build, not only a combination of indicators, but also an indicator within another indicator or a mathematical manipulation of a known indicator?

Not possible, though im happy to add users own indicators into gsb if they are public domain and not too complex

GSB Exit Features

Yishke - 27-10-2021 at 03:32 AM

Is it possible in "GSB Exit Features" to set a parameter to be examined and not a natural number?

admin - 27-10-2021 at 03:42 AM

Quote: Originally posted by Yishke  
Is it possible in "GSB Exit Features" to set a parameter to be examined and not a natural number?

IM not clear what you mean. GSB can exit when the entry signal reverse, moc, pt stop, and a few other type of exits.

Yishke - 27-10-2021 at 04:37 AM

Quote: Originally posted by admin  
Quote: Originally posted by Yishke  
Is it possible in "GSB Exit Features" to set a parameter to be examined and not a natural number?

IM not clear what you mean. GSB can exit when the entry signal reverse, moc, pt stop, and a few other type of exits.


Instead of exiting a $ 500 OR 1000$ stop loss position, GSB will determine the most profitable parameter.

More than that!

There are many other settings, where instead of placing a number, a variable can be placed, and GSB will check what is the most worthwhile option

zdenekt - 29-10-2021 at 07:17 AM

I was thinking of something similar for swing systems on other markets than indexes. How to find a reasonable stop and target values for swing systems in different markets and different time frames.
If we could do it when building systems.
Let's say that for STOP we can set from 1000 to 3000, step 500 .... and similar for Target.
But then don't include it in the walkforward, just use fixed numbers.

It might be okay to use the ATR version of STOP and TARGET.
Just set a fixed ATR length (length 100 is sometimes better than 14) and optimize the multiplier from eg 2 to 5, step 1 .... and similar for Target (do not include in the walkforward).

When we find some robust values with a few good indicators then we can build systems with fixed values of STOP and TARGET (or defined ATR multipliers).

Daniel UK1 - 30-10-2021 at 02:41 AM

An interesting fact, is that over 4 years of running GSB more or less full time, i can only think of 1 market and 1 type of systems that have performed better with targets and exit type other than eod.

Stops i either use as a "large enough to never get hit" type of systems, or its used as an important variable together with targets as a ratio, but that equation is very likely to break and i have not succeeded with this when datamining for systems.

The size of the stops, if used without targets, you will "learn" after some time spent with GSB what a market need and not.

Imho, after introducing targets you include a variable and that variable will make you more vulnerable to curvefittting, so your process becomes even more important than ever in order to end up with something robust.

The eod exit, is the most robust part of your system and is an edge in itself.

Just my 2 cents..


johnw1357 - 31-10-2021 at 09:58 PM

Could you provide email for GSB support? I sent email and got no response for 3 days.

johnw1357 - 31-10-2021 at 09:58 PM

Could you provide email for GSB support? I sent email and got no response for 3 days.

admin - 31-10-2021 at 10:14 PM

Quote: Originally posted by johnw1357  
Could you provide email for GSB support? I sent email and got no response for 3 days.

Hi John,
sorry but I have no emails from you.
I will send you a test email.

johnw1357 - 31-10-2021 at 10:39 PM

Could you pls let me know your email. I will resend. thanks

johnw1357 - 31-10-2021 at 10:39 PM

Could you pls let me know your email. I will resend. thanks

admin - 31-10-2021 at 10:41 PM

Quote: Originally posted by johnw1357  
Could you pls let me know your email. I will resend. thanks

you can use peterzwag@gmail.com but I sent you a test 30 minutes ago.
Can you also delete your posts once we have emails working. Trying to keep forum de-cluttered

admin - 1-11-2021 at 04:19 PM

@yishke
GSB can allow genetic algorithms to choose a stop
Too be honest, the stop is one of the last things you need to concern yourself about in GSB. If its big its not critical. Too small and you end up loosing money when it gets volitle.
Ive seen users make nothing on months where im making 10k or so per system as the users stuck with really tight stops.
Your posts are also duplicate. Can you delete the duplicates?

I like Daniels post a few days ago where he says
"An interesting fact, is that over 4 years of running GSB more or less full time, i can only think of 1 market and 1 type of systems that have performed better with targets and exit type other than eod.

Stops i either use as a "large enough to never get hit" type of systems, or its used as an important variable together with targets as a ratio, but that equation is very likely to break and i have not succeeded with this when datamining for systems.

The size of the stops, if used without targets, you will "learn" after some time spent with GSB what a market need and not.

Imho, after introducing targets you include a variable and that variable will make you more vulnerable to curvefittting, so your process becomes even more important than ever in order to end up with something robust.

The eod exit, is the most robust part of your system and is an edge in itself.

Just my 2 cents.."



Daniel UK1 - 1-11-2021 at 04:31 PM

Yishke, a helpful tip, in general, you dont really want unique stops per system... as an initial trial run for a market, you just need to run a larger stop, just use 2-3k as an example,, run standard gsb setup from peter, it does not matter if its not perfect... take a decent system or a few, put it in ts or mc, run optimiser for stop 500-3000.. you now have a pretty good understanding what the market needs... then back to gsb and use this stop for your process run... in your process you can then in the end, finetune your stop within to see how the character of the systems built as a total and metrics change if you for example change between 2 or 2500.. Or you disregard this tip, and go your own way.. lots of options :)

Daniel UK1 - 3-11-2021 at 03:29 AM

Execution issue with swing/overnight systems as is today, i would say its impossible to use existing code from GSB and expect execution as one might intend in MC. This is not mean as a critic to GSB, but rather to bring it up and see if there are things that can be improved, some people might think that issues does not exist for them, but that is just a matter of time for that realisation. :)

Issues
1: Emulate of stops and targets in MC, not going to work since its using broker bid/ask/trade data, and NOT your datafeed for charts, hence you chart session template is not used and you will get triggers and fills of orders outside of your session template.

2: Stops and targets resting at market if not using above, will get filled/execute outside RTH.

3: If you somehow manage to get your resting orders not to fill/execute outside RTH if price is to far away when in RTH gain and is supposed to be triggered, they wont get filled/executed due to "safety" distance between trigger and price.

4: The known issue with existing swing positions often is contrary to direction of other intraday positions you might have, causing in IB "order price change for your new stops or targets" (happened to me yesterday btw, stop price for a new order was move by IB in a huge amount because it could not cross existing resting swing target or stop.


I would say, as is today, its impossible to execute swing as intended (if intention is to use a certain session time and only execute rth) in MC by using GSB code. If any user has solved any of the above, kindly share.


admin - 3-11-2021 at 03:47 AM

@Daniel, can you ask MC support over this? Can you also drive IB from MC via Ninjatrader?
I dont live trade with MC, so limited in how I can help. No active PT will help but not fix it.
code that says if time =eod then {make stop massive} might help.

Daniel UK1 - 3-11-2021 at 01:23 PM

@Peter, i have discussed this issue with them many times, it needs to be handled in code they say. I am also not sure what they can change to help, they have declined to change local emulation to use chart data instead of broker.

IB issues with different directions in positions in same symbol, is not possible to solve only reduce.

But issues with outside RTH executions can be helped by better order management handling in code, and crossing order issue is reduced if orders are handled better in code.

Question, since this is something that affects everyone at least everyone using MC, can possibly we a have a better / different order handling in GSB code when using "not MOC close " so that its possible to execute in liive trading as backtest shows ?

To further complicate the issue, RTH Setting in TWS iB presets, will ONLY have an affect on stops in the markets, Globex/Nymex/Ecbot Futures, so a swing target limit or market order will always be filled if active outside of RTH, but a stop order will honour the RTH setting and not be filled.



Thoughts

zdenekt - 3-11-2021 at 03:38 PM

@Peter and Daniel, thank you for all your points.

I fully understand benefits of EOD exit.
When I work on swing systems then I don't want to use End of day exit....but i need at least some exit.
Therefore I would welcome a simple ATR exit where I would define a Multiplier for Stop and Target (because some markets have huge differences in daily ranges in previous and recent years).

Later I can use another exit in Tradestation but I can't do anything else in GSB right now (just fixed stop and target for all data range).

admin - 3-11-2021 at 04:19 PM

@Daniel, "it needs to be handled in code they say" Can they elaborate? In any company, the skill set varies and talk to another rep can help

admin - 3-11-2021 at 09:50 PM

Quote: Originally posted by zdenekt  
@Peter and Daniel, thank you for all your points.

I fully understand benefits of EOD exit.
When I work on swing systems then I don't want to use End of day exit....but i need at least some exit.
Therefore I would welcome a simple ATR exit where I would define a Multiplier for Stop and Target (because some markets have huge differences in daily ranges in previous and recent years).

Later I can use another exit in Tradestation but I can't do anything else in GSB right now (just fixed stop and target for all data range).


We are planing some sort of ATR stop, but it wont happen until the NT fixes, new filters and some users bug fixes are done. For now a fixed PT should do. This is what all the es / nq systems I have listed for sale use, it it works well. If you have bought any of these systems, and want to add atr stop / pt, I would be interested in the change in results

Daniel UK1 - 4-11-2021 at 09:47 AM

Quote: Originally posted by admin  
@Daniel, "it needs to be handled in code they say" Can they elaborate? In any company, the skill set varies and talk to another rep can help


Peter, thanks, yes thats for sure
Anyway, code as is, works great from GSB, one just needs to be aware of the quirks and uniqueness of the different platforms in order to execute as efficient as possible to enable oneself to take advantage of the great systems GSB can provide.

I assume thats why IB link was created :)

admin - 5-11-2021 at 12:09 AM

Correct, and the situation where you go long and short at the same instance, is one of the hardest issues to fix.
There are numerous ts/mc to tws bridges and you might want to buy one. Thats the first feature I would look for

Yishke - 21-11-2021 at 10:26 AM

Quote: Originally posted by Daniel UK1  
Yishke, a helpful tip, in general, you dont really want unique stops per system... as an initial trial run for a market, you just need to run a larger stop, just use 2-3k as an example,, run standard gsb setup from peter, it does not matter if its not perfect... take a decent system or a few, put it in ts or mc, run optimiser for stop 500-3000.. you now have a pretty good understanding what the market needs... then back to gsb and use this stop for your process run... in your process you can then in the end, finetune your stop within to see how the character of the systems built as a total and metrics change if you for example change between 2 or 2500.. Or you disregard this tip, and go your own way.. lots of options :)


I came from the position that determining the stop or profit taking would be a variable that GSP would measure the best

admin - 21-11-2021 at 03:56 PM

@Yishke, GSB can do this, but the amount of combinations of systems and parameters is so large, in practice I feel this will not work well.
I found even when i put a gsb system into TS/EWFO, im getting better results keeping the stop large and fixed in value.
The stop is often something I optimize manually as the very last thing in a system to be tweaked.
Generally I have an idea of the stop size to use, and all similar systems should work best with similar stops
On the swing long term ES systems, there can be a fair range of valid stops / pt - and I sometimes diversify these to make the systems less correlated.
Daniel made a similar comment somewhere in the forum too, saying similar things (about 2 months ago)

sfuser108 - 12-12-2021 at 09:26 AM

Peter - Can you please elaborate where this is set... screenshots would be very helpful...

Thanx


Quote: Originally posted by admin  
Swing wont work as well as moc for ES. Start by putting appsettings - allowing alloos to pass. (alloosallow.txt)
Allow the training metrics under app settings to be loose too, then tighten them up as you get some systems coming.

admin - 12-12-2021 at 04:07 PM

@sfuser108, swing long works well, but swinglong short much harder


tradinig.png - 134kB

sfuser108 - 12-12-2021 at 06:59 PM

Thanx Peter.

I was referring to your response to OP "Start by putting appsettings - allowing alloos to pass. (alloosallow.txt)"

What is "alloos" and the setting you reference. I understand the Long only works better...

Please clarify

Thanx

admin - 12-12-2021 at 07:19 PM

I have no idea on alloosallow.txt. Perhaps it was from gsb many years ago. Can you show me where you got this info from? Its not in the current documentation

sfuser108 - 12-12-2021 at 08:02 PM

Its the second message (from admin) on this topic on page 1.



Forum.PNG - 51kB

admin - 13-12-2021 at 12:28 AM

The date of the post is 2017. GSB was primitive then and that feature no longer exits in that form. Refer to the picture I posted above.
Very few posts that old are going to be useful now.