Support Board
Date/Time: Sat, 18 Jan 2025 05:14:28 +0000
[Programming Help] - Crossover - is there a bug?
View Count: 710
[2018-01-27 18:19:59] |
bala - Posts: 74 |
Some crossover signals are generated incorrectly? From your code: if (X1 > Y1 && X2 < Y2) return CROSS_FROM_TOP; else if (X1 < Y1 && X2 > Y2) return CROSS_FROM_BOTTOM; Consider variable values ( X1=98, Y1=100, Y2=96,X2=97) which generates CROSS_FROM_BOTTOM. In reality both curves are dropping. Correction: CROSS_FROM_BOTTOM when (X1 < Y1 && X2 > Y2 && X2>X1). CROSS_FROM_TOP when (X1 > Y1 && X2 < Y2 && Y2 < Y1). Thanks |
To post a message in this thread, you need to log in with your Sierra Chart account: