Login Page - Create Account

Support Board


Date/Time: Mon, 16 Sep 2024 19:07:39 +0000



Post From: Trigger a Trade When Another Condition is TRUE Several Bars Earlier

[2024-07-02 23:35:33]
Sawtooth - Posts: 4091
Any pointers in the right direction much appreciated.
The ID12.SG2 TRUE condition needs to be made persistent, until C>H[-1], then released with another condition.

Since you are not using a spreadsheet study, use the Spreadsheet Formula study, like this in its Formula field:
=IF(ID12.SG2,1,IF(ReleaseCondition,0,ID13.SG1[-1]))
where ID13 is this Spreadsheet Formula study.
This will return 1 at every bar since ID12.SG2 was TRUE, until it is released, then it will return 0.

Then use this formula for your trade entry:
=AND(ID13.SG2,C>H[-1])