Topics
Replies

rsoudani
19 Mar 2021, 08:44 ( Updated at: 19 Mar 2021, 08:45 )

RE:

Hello,
I have exactly the same problem, cTrader version: 4.0.7.48327, Windows 10. Can you help me?


@rsoudani

rsoudani
15 Mar 2021, 21:16

RE: RE: RE:

prosteel1 said:

amusleh said:

rsoudani said:

Hi, i'm working on my own strategy, looks good on demo account and on firts live tests, but i can not backtest it because i need low spreads, and i have raw spread account on icmarkets, but for backtesting in cTrader i can only get tickdata from server where i cant choose spread and it seems to be much to high (i need tick data not bar data). Do you have any suggestions?

Hi,

The tick data is from your broker price feed, you can try other brokers cTrader for backtesting and using their tick data. 

I use a condition to check if the channel height (ChHt) is large enough compared to the spread: (ChHt > 2 * (Symbol.Ask - Symbol.Bid))

This eliminates charts during high spread events like on the market open in order to ensure there is a small of risk to return. I also keep track of the channel height of successful trades during a backtest and store the highest value which is also used as a check to eliminate big gaps creating huge charts that block trades. I run a backtest once to get the highest chart height and then run it a second time so that huge charts resulting from gaps are eliminated the second time I do a backtest.

I love ICMarkets data fyi.  From what I have seen it looks like the live spread when using the backtesting setting > Data > 'Tick data from server (accurate') does provide accurate spread, but I haven't verified it. I use the above methods to eliminate high spreads so I don't trade them.

There might be other methods to eliminating trading during high spreads, these are what I use.

Are you running your bot using OnTick() as opposed to OnBar()? Running OnBar() instread of OnTick() might result in what you are describing.

Are you consistantly using Symbol.Bid and Symbol.Ask instead of LastBar.High or whatever the old crew use now days. When you are targeting spread as a metric and running OnTick, Symbol.Bid and Symbol.Ask is where it needs to be to use the tick data and thus get the accurate spread. I struggled with this for a while too.

 

Thank you for the answer! I use both OnBar and OnTick methods in my code, and I use Symbol.Bid and Symbol.Ask as you suggest but did not take channel height into account. For the sake of clarity, could you please specify how do you calculate / where you get channel height?


@rsoudani