Login Page - Create Account

Support Board


Date/Time: Fri, 26 Apr 2024 17:16:09 +0000



[User Discussion] - Spreadsheet: special bars as doji and pin-less

View Count: 881

[2020-02-13 23:07:56]
User190501 - Posts: 92
Hi Support,

While setting condition on ID0.SG4 , I have noticed that when the bar is a doj [last = open] or the bar has no pins , in which last = low or last =high, the condition using ID0.SG4 is not evaluated? Kindly advise.
[2020-02-14 21:57:10]
Sawtooth - Posts: 3976
You may need to remove floating point imprecision.
Using the Spreadsheet Study: Imprecision of Floating-Point Numbers and Comparisons
[2020-02-14 22:50:16]
User190501 - Posts: 92
Thanks for the feedback Tomglib, I set the number format for the O, H, L, Last to 0.01 in ES chart and all the studies as well but still same some cases didn't improve. The exit condition is when in a long trade a down bar takes place at lower or equal to the open of the previous bar then exit triggers.. I have attached an image.
imageexample.png / V - Attached On 2020-02-14 22:47:56 UTC - Size: 13.42 KB - 213 views
Attachment Deleted.
[2020-02-14 22:58:33]
Sawtooth - Posts: 3976
The Number Format does not remove floating point errors. It is only for display.

Did you do this to remove the imprecision?:
Using the Spreadsheet Study: Rounding of Values to Tick Size
[2020-02-15 00:02:59]
User190501 - Posts: 92
=OR ( AND( ID0.SG4@3<ID0.SG1@3, ID0.SG4@4>ID0.SG1@4, ID0.SG4@3<= ID0.SG1@4, ID0.SG4@3>ID1.SG1@3, ID0.SG4@3>ID1.SG2@3) , AND( ID0.SG4@5>ID0.SG1@5, ID0.SG4@4<ID0.SG1@4, ID0.SG4@3<ID0.SG1@3, ID0.SG4@4>ID0.SG1@5, ID0.SG4@3>ID1.SG1@3, ID0.SG4@3>ID1.SG2@3) , OR (AND(CROSSFROMABOVE(ID0.SG4@3:ID0.SG4@4, ID1.SG1@3:ID1.SG1@4),OR( ID0.SG4@3>=ID1.SG2@3, ID0.SG4@3>=ID2.SG1@3)), AND(CROSSFROMABOVE(ID0.SG4@3:ID0.SG4@4, ID1.SG2@3:ID1.SG2@4), OR(ID0.SG4@3>=ID1.SG1@3, ID0.SG4@3>=ID2.SG1@3)), AND(CROSSFROMABOVE(ID0.SG4@3:ID0.SG4@4, ID2.SG1@3:ID2.SG1@4), OR(ID0.SG4@4>=ID1.SG1@4, ID0.SG4@4>=ID1.SG2@4)) ) )


My form is a bit long and not sure if you need to make each compare or > or < to change it to the absolute ? for instance ID0.SG4@3> ID1.SG1@3 to be ABS(ID0.SG4@3-ID1.SG1@3) >0.005 and apply this to all compare formulas , but what if we have a crossabove/below ?
[2020-02-15 03:28:31]
Sawtooth - Posts: 3976
Do this:
Set 'Number of Formula Columns to something 20 or larger.

Put this in H21:
=1/ROUND(1/J21,0)

Put this in AB3:
=MROUND(B3,$H$21)

Put this in AC3:
=MROUND(C3,$H$21)

Put this in AD3:
=MROUND(D3,$H$21)

Put this in AE3:
=MROUND(E3,$H$21)

Now reference OHLC values that are rounded to the rounded tick size, using AB3, AC3, AD3, AE3, respectively.

(You only need to use the ID#.SG#@[row] format when referencing study outputs. Use cell/row references for all others. This keeps things tidier.)
[2020-02-15 07:37:14]
User190501 - Posts: 92
Thanks a lot for the idea of rounding to the tick size and the coding style tip.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account