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. However, it was triggered twice before 1520. I dont know what went wrong. Please advice. Thank you.
The output values in editor do not match with the chart
- TJ
- Posts: 7744
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: The output values in editor do not match with the chart
see post #5Hi 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. However, it was triggered twice before 1520. I dont know what went wrong. Please advice. Thank you.
(5) [FAQ] Data2
viewtopic.php?f=16&t=6929
- 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
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.
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.
- TJ
- Posts: 7744
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: The output values in editor do not match with the chart
In an indicator, the "crosses below" command can give false intra-bar readings, if the value "goes back above" at EOB.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.
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.
Re: The output values in editor do not match with the chart
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?In an indicator, the "crosses below" command can give false intra-bar readings, if the value "goes back above" at EOB.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.
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.
Thanks so much
Stephen
Re: The output values in editor do not match with the chart
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?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.
Thanks so much
Stephen
- 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
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.