READ-ONLY

The forum is now a read-only archive.

For bug reports & platform questions → [email protected]

Our community lives on Discord and YouTube — come join us!

Strategies not exiting after specified number of bars

6 replies

codeowl

Subscriber, bbp_participant, customer, community, sq-ultimate, 15 replies.

Visit profile

4 years ago #278420

Hi there,

I have configured a very simple build:

  • 1 entry condition
  • 0 exit conditions
  • Exit on Friday
  • Don’t trade weekends
  • Exit after bars: 1:5:1

The data I used is a custom session imported from TradeStation of 420 min bars.  You can see in the screen shot below the data looks good with zero gaps.

The screen show shows some of the config:

You can see here are the top 8 strategies and they all have trades that go longer than 5 days.

I have provided a zip with the strategy config and the data so you can replicate the issue.

Here is the instrument spec:

Here is the import config:

Some of the strategies have trades that go for 16 days or longer… I saw a couple with 18 day trades, but the builder config says exit after a max of 5 days.

It just seems no matter what I do I can’t get SQX to respect rules around exit times.

Regards.

 

Attachments:
You must be logged in to view attached files.

0

Tomas Matejka

Administrator, sq-ultimate, 2 replies.

Visit profile

4 years ago #278468

If you have exit at 5th day and it is a holiday it will be shifted to > 5 days

It is very common but it should be just few trades only. Others should be <= 5

0

Tomas Matejka

Administrator, sq-ultimate, 2 replies.

Visit profile

4 years ago #278470

I have built some strategies and all exit in <= 5 days. Can you attach a specific strategy that have trades longer than 5 days?

0

codeowl

Subscriber, bbp_participant, customer, community, sq-ultimate, 15 replies.

Visit profile

4 years ago #278538

Tomas,

Thanks for following up on this. I would be happy to give you some examples. I sorted the results of the build config I sent in my previous post by Net Profit highest to lowest and I looked at the first 34 and 29 of these went over 5 days, some up to 18 days. I have exported these strategies and attached them as requested.

I built 1000 strategies, I suspect I could provide 100s more examples if i looked at more.

Here are screen shots of what some of them look like:

Attachments:
You must be logged in to view attached files.

0

codeowl

Subscriber, bbp_participant, customer, community, sq-ultimate, 15 replies.

Visit profile

4 years ago #278540

Tomas,

Here is an other example, this time using a really simple template that says:

  • Exit on Friday
    OR
  • Exit if Bar Since Order Open > 4

When I load it into builder and build with the same config, again I sort NET Profit from highest to lowest and most of the strategies I looked at have multiple trades where the number of days is > 5.

I have attached a zip with the:

  • Template
  • Builder Config
  • Strategies Generated

Really keen to get to the bottom of this.

 

Attachments:
You must be logged in to view attached files.

0

Tomas Matejka

Administrator, sq-ultimate, 2 replies.

Visit profile

4 years ago #278582

It seems to work better if remove the DayOfWeek = Friday part of the exit condition from the template. Just keep using Trading Options – Friday Exit

Also please realize that the Friday bar closes at 16:00 US CT and the exit signal cannot be processed since the market closes.

I do not trade Dailyes but to get Friday exit working you might better check this https://futures.io/tradestation/55621-selling-closing-bar.html

0

codeowl

Subscriber, bbp_participant, customer, community, sq-ultimate, 15 replies.

Visit profile

4 years ago #278596

Tomas,

Thanks for the response.  But don’t you think there is a fundamental problem here?

Like the “DayOfWeek = Friday” is part of an OR statement.  Removing it should make no difference as even if it doesn’t get triggered the second half of the OR statement that says “Exit if Bar Since Order Open > 4” still should get evaluated as true and then the position should be closed.  There seems to be many, many cases where this is not happening.

How is it possible to develop robust strategies if you can’t do something as simple as exit after a number of bars?

As I outlined in previous posts I have tried using only Trading Options, I have tried using hard coded Template Rules, but there seems to be no reliable way to get the back test to exit at the end of the week or after number of bars.

Surely this is a serious bug that must be fixed?

Regards,

 

0

Viewing 6 replies - 1 through 6 (of 6 total)