Login Page - Create Account

Support Board


Date/Time: Thu, 18 Apr 2024 20:55:35 +0000



[Programming Help] - SpreadSheets - Referencing 'Last Entry Trade DateTime' (Cell J42)

View Count: 510

[2020-01-16 00:08:37]
a Gem Tree - Posts: 60
I would like to reference the bar (see: row) at which my last trade entry was taken. I believe Cell J42 can be used for this, but I'm not sure how.
Would I need to convert the data in J42 into fractime to do this? Or can I directly compare the J42 data to the data in Column A?

If Sierra has a page detailing this process, or something similar, can you please link me?
OR, if you have the patience and time, perhaps just list the steps
I'll need to take to get the reference to this (trade entry) Bar?
[2020-01-16 01:47:14]
Sawtooth - Posts: 3973
Would I need to convert the data in J42 into fractime to do this?
No. The FRACTIME function removes the date from DateTime value and leaves only the time. If you use FRACTIME, it would be true every day at the time/row where the entry time occurred.
can I directly compare the J42 data to the data in Column A?
Yes. Use this formula in a Formula Column:
=IF(ROW()=3,AND($J$42>A3,$J$42<$J$41),AND($J$42>A3,$J$42<A2))
This will be true in only the row where the day and time of the entry occurred. It will not be true in the row of the same time on another day.

Note: Referencing A2 in row 3 will return an error so:
If the row equals 3, find J42 between A3 and J41, else find J42 between an earlier row/DateTime and its previous row/DateTime.
[2020-01-16 03:22:49]
a Gem Tree - Posts: 60
Thank you Tom - I kinda wrote my own stuff, cus I just don't understand the code above.
So for anyone searching google for this stuff, here's a very simple solution, but one that uses 2 columns:

Column 1: - Written in Column S...
=AND(A3>$J$42)
Column 2:
=IF(AND(S3=1,S4=0), (INSERT your own function) ,0)


Note that, the column you are interested in, will be the 5th row.
So, if you want the last price of your trade entry bar, you must type, E5, in the 3rd row.

This means that you will not be able to reference the entry bar until 2 bars later.
But if you guys have a better solution as to how to write it, let me know.

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

Login

Login Page - Create Account