Heikin Ashi candles in DataStream 2

Questions about MultiCharts and user contributed studies.
auato
Posts: 89
Joined: 23 Nov 2016
Has thanked: 18 times

Heikin Ashi candles in DataStream 2

Postby auato » 20 Jul 2019

Hi all,
I have two Data streams, the second stream is with Haikin Ashi candles and with a SuperTrend indicator (variable "st") while the first Data stream is with regular bars and without any indicator. I would like to trigger the signal buy or sell starting from the stream Data2: when the close of Heikin Ashi is above or below Supertrend, it triggers a buy or sell for the stream Data1 but it is stubborn :) and looks like that it is not able to recognize the Heikin Ashi values.

Code: Select all

if marketposition = 0 and Close of Data2 > st of data2 then buy ("L") 1 contracts next bar at market;
if marketposition = 1 and Close of Data2 < st of data2 then sell ("STP_L") 1 contracts next bar at market;
if marketposition = 0 and Close of Data2 < st of data2 then sellshort ("S") 1 contracts next bar at market;
if marketposition =-1 and Close of Data2 > st of data2 then buytocover ("STP_S") 1 contracts next bar at market;
Thank you

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

Re: Heikin Ashi candles in DataStream 2

Postby TJ » 20 Jul 2019

Mixing non-time-based analysis with time-based analysis is always a challenge -- you have to reconcile the timing difference.

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

Re: Heikin Ashi candles in DataStream 2

Postby TJ » 20 Jul 2019

Signals are calculated at the end of bar (OOB).

Unless the data2 is closed before Data1, you will not get the realtime quote as the "Close" of data2.

auato
Posts: 89
Joined: 23 Nov 2016
Has thanked: 18 times

Re: Heikin Ashi candles in DataStream 2

Postby auato » 20 Jul 2019

Hi TJ, thank you.
But is the syntax of the code correct in your opinion ? And... as Data2 is set as Heikin Ashi when I declare

Code: Select all

...Close of Data2 > st of data2...
the statement "close of data2" what does it mean? Does it refer to the close of regular bar or the close of Heikin Ashi candle?

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

Re: Heikin Ashi candles in DataStream 2

Postby TJ » 20 Jul 2019

See post #18
[FAQ] Multiple Time Frame, Multi-Data Analysis
viewtopic.php?t=10811

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

Re: Heikin Ashi candles in DataStream 2

Postby TJ » 20 Jul 2019

See post #14
[FAQ] Multi-data strategy, Realtime-History Matching
viewtopic.php?t=10811


Return to “MultiCharts”