Login Page - Create Account

Support Board


Date/Time: Sun, 06 Oct 2024 10:54:13 +0000



[Programming Help] - Reset Signals after Trade Invalidation

View Count: 391

[2023-10-04 10:03:25]
User347921 - Posts: 38
Hello,

I'm working with "Spreadsheet System for Trading" and have established rules for Long & Short and have also used "Buy on First Signal and Ignore Multiple Signals https://www.sierrachart.com/index.php?page=doc/SpreadsheetExampleFormulasAndUsage.php#BuyOnFirstSignalAndIgnoreMultipleSignals".

Some Signals are invalidated by the next candle (e.g. Short Signal invalidated by the next candle crossing over the high of the entry candle, opposite for Long) and I'd like to reset the Signals when there is an invalidation, but I was not able to find a solution for the reset. All my conditions are set "Signal Only on Bar Close"

Any help would be appreciated.

https://www.sierrachart.com/image.php?Image=169641325338.png
[2023-10-04 16:02:49]
Sawtooth - Posts: 4093
I'd like to reset the Signals when there is an invalidation
The way to do this is to reset the persistent signal with its exit condition.

In your example, the trade would take place before you know it's invalid, so what is your exit in this case?
IOW, your SellEntry release condition cannot be your BuyEntry condition.
[2023-10-04 16:33:51]
User347921 - Posts: 38
Thank you for taking the time.

My exit conditions in column L for Long are if the CLOSE crosses under the LOW of the Entry candle OR if the CLOSE crosses under the LOW of the previous candle (the opposite for Short).

Because of the "Buy on First Signal and Ignore Multiple Signals" and the absence of opposite Signal despite the previous candle high/low was crossed (Exit Condition), the persistent Signal stays in the same direction. If you look at the graph I shared in my original post, I've an entry Short at 15:41, then the next candle breaks the high of the entry candle = Exit, but until the 15:56 bar I don't have an opposite Signal (not all condition for a Long were met) and therefore the "Buy on First Signal and Ignore Multiple Signals" stays valid.

Basically, I need to find a solution which looks like if there was an opposite Signal without generating a trade to cancel the effect of "Buy on First Signal and Ignore Multiple Signals" when the trade has been closed. (Sorry if the message is confusing, not sure how to explain the issue in simpler words).

Thank you
[2023-10-04 17:35:12]
Sawtooth - Posts: 4093
Try this:
P3:
=IF(BuyEntryCondition,1,IF(D3<D4,0,P4))
K3:
=AND(P4=0,P3)
Q3:
=IF(SellEntryCondition,1,IF(C3>C4,0,Q4))
M3:
=AND(Q4=0,Q3)

P3 is the Long Entry persist, Q3 is the Sell Entry persist.
Each is now independent.
[2023-10-04 18:28:19]
User347921 - Posts: 38
@Sawtooth Thanks a million! I just have to rebuild my spreadsheet as I moved some columns and everything went upside down. I'll go with the "ID1.SG1@3" style from now on. Trial and errors, this how I learn.
Again, thank you!
[2023-10-04 22:00:51]
User347921 - Posts: 38
Hi Sawtooth, you're a genuis! your suggestion works perfectly. I just need to find a way to get rid of the fake signals at the bottom right of the graph without entering late on the first Signals (left hand side). The problem with adding too many filters to remove the noise is you enter late on the good trades.
Thank you very much!

https://www.sierrachart.com/image.php?Image=1696456570550.png
Date Time Of Last Edit: 2023-10-04 22:04:15

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

Login

Login Page - Create Account