Signals based on Trade data series and buy and sell based on bid and ask data series

Questions about MultiCharts and user contributed studies.
redwin86
Posts: 2
Joined: 17 Jul 2021

Signals based on Trade data series and buy and sell based on bid and ask data series

Postby redwin86 » 09 Apr 2023

currently i'm working on 3 same instruments with different data series (trade, bid and ask).

data1 as trade
data2 as ask
data3 as bid

i would like to use data1 trade series data as my trading signal generator, whatever signals generated from trade series data will initiate a buy/sell signals based on actual bid and ask data.

However, under strategy properties, i can only either select classic or extended data series.

if i selected classic, it doesnt reflect the actual bid and ask situation.

if i selected extended data series, it by default with calculate the strategy based on ask data series and the bid series of data. the signals generated are very different from trade series data.

appreciate if there is anyone can advise on this.

Thank you.

User avatar
TJ
Posts: 7743
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Signals based on Trade data series and buy and sell based on bid and ask data series

Postby TJ » 09 Apr 2023

If you this is a coding question, you need to post your codes.

User avatar
TJ
Posts: 7743
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Signals based on Trade data series and buy and sell based on bid and ask data series

Postby TJ » 09 Apr 2023

Please check the following threats for ideas:

[FAQ] EasyLanguage / PowerLanguage
viewtopic.php?t=6929

[FAQ] Autotrade / Backtest / Optimization
viewtopic.php?t=10811

redwin86
Posts: 2
Joined: 17 Jul 2021

Re: Signals based on Trade data series and buy and sell based on bid and ask data series

Postby redwin86 » 09 Apr 2023

Code: Select all

[IntrabarOrderGeneration = false] inputs: Length( 5 ), NumATRs( .75 ) ; Buy ( "VltClsLE" ) next bar at Close + AvgTrueRange( Length ) * NumATRs stop ; Sell ( "VltClsLX" ) next bar at Close - AvgTrueRange( Length ) * NumATRs stop ;
thank you for your replies, really appreciate it.

these are my codes.

Generally, i want a precise backtesting result based on actual bid and ask data series. However, i'm exploring a way that these codes can calculate based on Trade series data.

this is because i'm trading in IBKR CFD, where spread is applied.

for example, this code applies to UK100 Index trade series data, initiated "buy" or "sell" signal based on trade series of data. this is not realistic if i'm trading CFD.

not sure how to address this correctly and clearly
the question is it possible that the "buy" or "sell" signals from Trade series of data to be generated exactly the same with bid and ask series of data?


Return to “MultiCharts”