IntraBar Trades

Posted By: OptimusPrime

IntraBar Trades - 11/20/20 22:06

Hi Team:
I am having difficulty in live testing with intrabar trades. In testing with historical Tick data, I obtain intrabar trades within the hourly bar. In live trading, the trades are only sent at the beggining of each bar i.e. every hour.

I use History = ".t1" and the TICKS flag is set already. I also changed TickTime from the default values but that made no difference in live trading. Without going so far as changing TimeFrame to 0 every time an intrabar trade is intended, is there any thing I might be missing?

I have tried changing all orders to Limit Orders by using OrderLimit and even extending OrderDuration to high values.

Just looking for pointers. If you can point me in the direction of any setting I might want to try.

Thanks
Optimus

Attached picture IntraBar Trades.jpg
Posted By: strimp099

Re: IntraBar Trades - 02/18/21 12:58

Total shot in the dark but did you try tick() function?
Posted By: CpOo

Re: IntraBar Trades - 02/18/21 14:03

Hi, similar problem here with intraday trades and multiple timeframes and wonder if it's a frameSync() thing...

In my case I obtain quite different results if I change the start date for example if I start on september 2nd 2018 I obtain +100 in February 2019, but if I change the start date to september 1st or september 3rd I obtain in February +250 or -10... very different results five months later.

My configuration is:

BarPeriod = 1;

Timeframes of 10, 20 and 30 minutes.

I plot some indicators and prices in those timeframes and they look correct. Also I reset timeframe (timeframe = 1) before call enterLong / enterShort

Any idea would be much appreciated.
Posted By: OptimusPrime

Re: IntraBar Trades - 02/20/21 14:53

Thank you for your recommendations. >> Yes, I use the tick() function in the script.
>> I will try the timeframe=1 suggestion before each entry call and see it if there's a a change.

(I don't want to use hedge = 5 because I need the long and short trades to exist simultaneously.. not the net position).

When I run a backtest with hedge =2, the trades occur at various points within the 30 minute bar as intended. When I test it live, the trades are bundled up and placed at the start of each bar <--- this is different from the backtest behaviour.
© 2024 lite-C Forums