Reply

Look inside bar Tradestation vs SQ 1hr result failed

10 replies

rshah

Customer, bbp_participant, community, 21 replies.

Visit profile

6 years ago #114005

I have a very good strategy that produces good results in 1 hr EUR/USD but when i moved it to Tradestation and test it by enabling Look inside bar (tick by tick testing), the results for last 6 month is totally different and bad…(Six month because tradestation only allows 6 month of tick data).

 

i am assuming that SQ on  1 hr will exit or take entry only at close of 1hr bar even though profit is hit when bar is running but in tick data that is not the case (Close to real time data)…

 

how do i avoid that situation…. I am running strategies for couple of days in SQ to find few good ones and then i know there is a possibilities when i test it in tradestation by enabling tick data, my strategies will fail as within 1 hr bar, price can move up or down drastically sometime and i do not want to wait till close of the bar to exit or take profit. That means my couple of days effort is gone .

 

so what is the best way here .. Is there any way in SQ, i take take profit or stop loss when it happens rather then waiting for close of the bar  (E.g. SQ can look into unrealized loss or profit value and then exit or take profit rather then looking at realized profit at end of the bar.)

0

tomas262

Administrator, sq-ultimate, 684 replies.

Visit profile

6 years ago #131682

How does your strategy works? Does it enters and exits withing the same bar usually?

0

rshah

Customer, bbp_participant, community, 21 replies.

Visit profile

6 years ago #131702

No Tom.

 

it enters and exits at the next bar… it evaluates the condition at the end of the bar and enter or exit at the Open of the next bar (e.g. in my case  1hr bar)

 

entry is fine but exit, i do not want to wait till 1hr bar finishes knowing my profit target or stop loss is already hit while bar is running…. 

 

is there any solution to that or would I have to run evaluation always on tick data to avoid this kind of situation.

 

How do you guys use 1HR or 4HR TF… (Selected time frame option you choose or you guys choose Real tick data (Slowest option)  –  if you use selected TF option for 1hr or 4hr , you will run into similar situation as i did unless you guys are using some other alternative way.

 

 

0

tomas262

Administrator, sq-ultimate, 684 replies.

Visit profile

5 years ago #131945

Have you had success with your testing? The best practice is always to use tick data whenever it’s possible to get the highest precision if you are not intentionally working with bar closing prices. SQ is able to record PT fill for example at specified price even if you use only 1H data for example since it basically checks whether price exceeded that PT after entry. You can send the strategy to support@strategyquant.com and I will look at it

0

rshah

Customer, bbp_participant, community, 21 replies.

Visit profile

5 years ago #132010

2,6,10,11

Tom,

 

1) The best practice is always to use tick data whenever it’s possible to get the highest precision ?

Yes. i agree but tradestation does not provide tick data over 6 months so there is no way for me to back test more then 6 month in SQ using tradestation data.

however i can use tick data from  tick data downloader (Duskacopy) and back test in SQ, find good strategy but then  how do i test them in tradestation as tradestation does not have tick data for more then 6 month. how do i ensure that my strategy will perform the way it works in SQ using tickdata from Duskacopy into tradestation in future without testing them in tradestation provided backtest data.

 

2) SQ is able to record PT fill for example at specified price even if you use only 1H data for example since it basically checks whether price exceeded that PT after entry.

Nope. This statement is not correct if i understood it correctly then.  see attached screen shot as an example and please explain me why ?

 

Screenshot 1 (gbpusd_Duskcopy_1minPrecision_H1TF_v1) – I use duska data- use 1 min precision (Slow) and original TF – H1.   

 

 

Screenshot 2 (gbpusd_Duskcopy_SelectedTFPrecision_H1TF_v2) – I use duska data- use selected TF precision (fastest) and original TF – H1.   

 

 

now if SQ is able to record PT or SL at specified price instead of waiting for 1hr bar to close then 

1) entry timestamp and price should match for the trades in both screenshot — it does not –  (look at order 2, 6, 10, 11 in both screenshots)

2) Exit  – PT and SL should match if your statement is right about SQ is looking at specific price for PT and SL…–  It does not match —– ((look at order 2, 6, 10, 11 in both screenshots)  

 

my profitable trades turned negative.

 

i have also attached a strategy here for example.

 

 

 

 

0

rshah

Customer, bbp_participant, community, 21 replies.

Visit profile

5 years ago #132011

now i have also attached screenshots from tradestation as well.. i have enabled look inside bar testing ( 1 min ) on 1hr chart to compare apple to apple with duskcopy screen shot 2 ( 1min precision on 1hr chart).

 

Please compare trade number 1 and 3 in tradestation with order number 2 and 3 in duska copy screenshot.

 

 

0

tomas262

Administrator, sq-ultimate, 684 replies.

Visit profile

5 years ago #132054

how do i ensure that my strategy will perform the way it works in SQ using tickdata from Duskacopy into tradestation in future without testing them in tradestation provided backtest data.

 

You need to use the same data to achieve this. Have you compared data from TradeStation to Dukascopy? Do they match 99%? First you need to be sure about data before starting system development

0

rshah

Customer, bbp_participant, community, 21 replies.

Visit profile

5 years ago #132063

yes Tom, i agree that data from both dukascopy and tradestation has to match. it is a common sense otherwise results will differ.

 

my question number (1) was in relationship to your answer suggesting to use always tick data and my challenge was to find tick data for more then 6 months old in Tradestation.  I am sure other users are using tradestation platform but i am not sure how they are doing 5 yr or 10 yrs back testing ( using tick precision in tradestation) or (using tradestation data in SQ) — Using dukascopy tick data in SQ for backtesting will not be a viable option if i am planning to use tradestation platform and data for live trading.

 

can you please provide an answer on question (2) ?.

0

tomas262

Administrator, sq-ultimate, 684 replies.

Visit profile

5 years ago #132172

Hi,

 

I tried following scenario:

  1. Imported 30-min bar data for E-mini Dow Futures – YM
  2. Used precision: “Selected Timeframe only”
  3. Used mandatory PT & SL

I did some testing and you can see on my screenshot that SQ is able to record PT fill “intrabar” even if I used purely 30-min based price data. The logic here is if bar high exceeds PT price for a long position then target fill is recorded at PT price. You don’t need tick data for this really. The same logic applies here for SL.

 

I know guys who bought tick data here http://disktrading.is99.com/disktrading/ if you really need them but I personally never needed them. I like keeping things simple

0

rshah

Customer, bbp_participant, community, 21 replies.

Visit profile

5 years ago #132181

Tom

 

thanks for your help. i agree that if price hits bar high then PT will be recorded, but imagine for the same scenario, if i have a stop at 17590 and target at 17620.

 

Now i import the strategy in tradestation and back test it. In the tradestation back test, since we are using 30 min bar, tradestation backtest engine will only see open, close of the bar but would not know the sequence of high and low.  since in our case in your screen shot , it was a bullish bar. and it looks like low was close to open , tradestation will stop me out and record a loss for this trade in backtest.  Tradestation will assume low was first hit and then price went up…

 

but assume, you are running this strategy live, result could be different, price might have made high first after opening and then made low and i would have booked profit.  So it is the issue of Chronological order in backtesting.

 

Quote from Tradestation guide

Time-based bars include the Open, High, Low, and Close for the specified time period. When you work with historical data to test a strategy, TradeStation doesn’t know the chronological order of the transactions that make up the bar. The only transactions for which the chronology is known are the Open, which occurred first, and the Close, which occurred last. With time-based bars based on historical data, there is no way to know whether the market opened and then went down, or the market opened and then went up.  (((this is the issue i am struggling with))

 

So how do you deal with this assume if you are using Tradestation ??

 

I stopped using PT and SL along with stop trailing and profit trailing, movetobreakevan in SQ Strategy Generation to avoid this situation and until i figured out the solution or if you guys can suggest an alternative.

 

For now,  I am using indicator based exit rule and entry rule to avoid this situation.

 

I am attaching a screen shots of my HOLY GRAIL strategy from SQ. if i can find the answer then i can simulate the same in Tradestation and go live next day,]

 

Look cafefully SQN, MAX DD% and Return/DD ratio of this strategy and equity curve.

0

WayneCarr

Subscriber, bbp_participant, community, 3 replies.

Visit profile

5 years ago #132619

I stopped using PT and SL along with stop trailing and profit trailing, movetobreakevan in SQ Strategy Generation to avoid this situation and until i figured out the solution or if you guys can suggest an alternative.

0

Viewing 11 posts - 1 through 11 (of 11 total)