The output values in editor do not match with the chart

Questions about MultiCharts and user contributed studies.
Spikehog
Posts: 39
Joined: 09 Dec 2013
Has thanked: 26 times
Been thanked: 1 time

The output values in editor do not match with the chart

Postby Spikehog » 04 Dec 2014

Hi there, I got two instruments on the same chart. Both are HSIZ14, data1 is in 1 min and data2 is in 5 mins(which is hidden). And I got MACD on data2 and its parameters are (12, 26, 9) which forms as an exit signal if MACDdivergence crosses under zero.

Its coding is as following: If MACDDivergence of Data2 crosses under 0 then Sell ( "BtdLX-" ) next bar at market ;

I did print out the values of MACD on data2 which shows that it became negative(minus) at 1323 as well as at 1430. The exit signal is named as "BtdLX-" and you can see that MACDdivergence did not cross under zero untill 1520 on the chart.
04122014c.PNG
(211.17 KiB) Downloaded 632 times
However, it was triggered twice before 1520. I dont know what went wrong. Please advice. Thank you.

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

Re: The output values in editor do not match with the chart

Postby TJ » 04 Dec 2014

Hi there, I got two instruments on the same chart. Both are HSIZ14, data1 is in 1 min and data2 is in 5 mins(which is hidden). And I got MACD on data2 and its parameters are (12, 26, 9) which forms as an exit signal if MACDdivergence crosses under zero.

Its coding is as following: If MACDDivergence of Data2 crosses under 0 then Sell ( "BtdLX-" ) next bar at market ;

I did print out the values of MACD on data2 which shows that it became negative(minus) at 1323 as well as at 1430. The exit signal is named as "BtdLX-" and you can see that MACDdivergence did not cross under zero untill 1520 on the chart.
04122014c.PNG
However, it was triggered twice before 1520. I dont know what went wrong. Please advice. Thank you.
see post #5
(5) [FAQ] Data2
viewtopic.php?f=16&t=6929

User avatar
furytrader
Posts: 354
Joined: 30 Jul 2010
Location: Chicago, IL
Has thanked: 155 times
Been thanked: 217 times

Re: The output values in editor do not match with the chart

Postby furytrader » 04 Dec 2014

Without seeing your code, it's hard to tell exactly what's going wrong. If you want to post the code (while removing any proprietary secrets), that would help in troubleshooting this.

As an aside, I have never really trusted the "crosses below" command. What I do, instead, is see whether the previous value of the indicator was >= 0 and the current value is < 0.

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

Re: The output values in editor do not match with the chart

Postby TJ » 04 Dec 2014

Without seeing your code, it's hard to tell exactly what's going wrong. If you want to post the code (while removing any proprietary secrets), that would help in troubleshooting this.

As an aside, I have never really trusted the "crosses below" command. What I do, instead, is see whether the previous value of the indicator was >= 0 and the current value is < 0.
In an indicator, the "crosses below" command can give false intra-bar readings, if the value "goes back above" at EOB.

Strategies are calculated EOB, it should should not give false readings.

However, I agree with you, for the reason you cited, I do not use the "Cross Above" or "Cross Below" statements.

Spikehog
Posts: 39
Joined: 09 Dec 2013
Has thanked: 26 times
Been thanked: 1 time

Re: The output values in editor do not match with the chart

Postby Spikehog » 05 Dec 2014

Without seeing your code, it's hard to tell exactly what's going wrong. If you want to post the code (while removing any proprietary secrets), that would help in troubleshooting this.

As an aside, I have never really trusted the "crosses below" command. What I do, instead, is see whether the previous value of the indicator was >= 0 and the current value is < 0.
In an indicator, the "crosses below" command can give false intra-bar readings, if the value "goes back above" at EOB.

Strategies are calculated EOB, it should should not give false readings.

However, I agree with you, for the reason you cited, I do not use the "Cross Above" or "Cross Below" statements.
TJ, are you saying that if the intra-bar order generation is not activated, then all of the strategies are based on End Of Bar which shouldn't give any false readings?

Thanks so much
Stephen

Spikehog
Posts: 39
Joined: 09 Dec 2013
Has thanked: 26 times
Been thanked: 1 time

Re: The output values in editor do not match with the chart

Postby Spikehog » 05 Dec 2014

Without seeing your code, it's hard to tell exactly what's going wrong. If you want to post the code (while removing any proprietary secrets), that would help in troubleshooting this.

As an aside, I have never really trusted the "crosses below" command. What I do, instead, is see whether the previous value of the indicator was >= 0 and the current value is < 0.
Hi FuryTrader, I understand what you say but I don't quite get it. I mean what is the main difference between using "crosses below" and "<0" ? Could you please give me an example?

Thanks so much
Stephen

User avatar
furytrader
Posts: 354
Joined: 30 Jul 2010
Location: Chicago, IL
Has thanked: 155 times
Been thanked: 217 times

Re: The output values in editor do not match with the chart

Postby furytrader » 05 Dec 2014

The reason I like to use that is because it uses conditional statements that I am familiar with and trust. I've had weird results using crosses above or crosses below.


Return to “MultiCharts”