Multi Data Series trading doesn't work

Questions about MultiCharts and user contributed studies.
bszabo825
Posts: 6
Joined: 24 Oct 2014
Has thanked: 1 time

Multi Data Series trading doesn't work

Postby bszabo825 » 21 Dec 2020

Hi,

I'm having problem in automated trading. I have 10min regular chart as data1 and I have a 3min regular bar as data2 setup to check short term shifts before entering position. I'm trying to initiate the trading on:

Code: Select all

if barstatus(1) = 2 then begin if close data1[closebar+1]< close data1[closebar] then begin uptrend = true; downtrend = false; end; if close data1[closebar+1]> close data1[closebar] then begin uptrend = false; downtrend = true; end; end; if barstatus(1) = 2 then begin if close data2[CloseBarLong+1] < close data2[CloseBarLong] then begin LongCondition = true; ShortCondition = false; end; if close data2[CloseBarLong+1] > close data2[CloseBarLong] then begin LongCondition = false; ShortCondition = true; end; end;
Starting the trade on checking barstatus(1) = 2 and initiating with a simple :

Code: Select all

If LongCondition and uptrend = true then Buy ("Buy_MKT_LE") TradeContracts contracts next bar at market;
The problem is that for some reason the data 1 (10min bar) start the position trading only after the last 3 min bar is closed, means 1 min left (3 x 3 min bars after the last 10min bar closed) on the 10 min bar. So basically the position is put on chart 9 min after the previous 10min bar is closed. How can make it work when the new 10min bar opens it should check the data2 what is the current indicator status of the last closed bar, and initiate the trade.

Thanks,
Barnabas
Last edited by bszabo825 on 21 Dec 2020, edited 1 time in total.

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

Re: Multi Data Series trading doesn't work

Postby TJ » 21 Dec 2020

See post #1 & post #2
viewtopic.php?t=11713

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

Re: Multi Data Series trading doesn't work

Postby TJ » 21 Dec 2020

See post #18
Pay attention to red highlighted notes at the end.
viewtopic.php?t=10811


Return to “MultiCharts”