Support Board
Date/Time: Tue, 22 Apr 2025 18:19:28 +0000
[Programming Help] - Needing Help with Spreadsheet Formula's for Auto Trading System
View Count: 394
[2024-03-27 02:27:57] |
Derek J - Posts: 12 |
Hi, I have an auto trading system I am using and I am wanting to add one more step into the Buy Entry/Sell Entry formula Cell's. How could write it to where it won't trigger a trade unless the 9EMA is at least 5 points away from the high of the current candle for a Buy and the low of current candle for a short? Example: Buy Entry =AND(C3>C4, F4>4000, AA>C3byX?) C3 Is current candle's high, C4 is previous candle's high, F4 is previous candle's volume must be greater that 4000, and AA is my 9EMA. Not sure if there's away I can write it like I am wanting, Meaning it won't trigger unless C3 is 5 points (or more) away from AA. Don't care which direction either. AA can be above or below C3. If someone could write that out for me, it would help me out tremendously! |
[2024-03-27 13:29:00] |
Sawtooth - Posts: 4209 |
Try this: =AND(C3>C4, F4>4000, ABS(AA3-C3)>5) |
[2025-01-08 01:15:19] |
Derek J - Posts: 12 |
Hey @Sawtooth (or anyone else that can help please chime in). So I am refining this mean reversion Bollinger band strategy that basically buys the next candle that breaks the high of the setup candle (C4). However I've noticed that if the trade line (9ema, AA3) is right above the current price this will not always work. It will breach the high of the setup candle (C4) and immediately reverse as soon as it gets to (or close to) the 9ema. Sawtooth provided me with a formula that will not let it take the trade if it is within 5 ticks of the 9ema trade line (AA3) That works great except if price goes above the setup candle and moves more than 5 ticks from the 9ema it will still trigger the trade which is not good. I need it to enter as soon as price goes above the previous (setup C4) candle and only if the 9ema (AA3) is more than 5 ticks away at that time. How can I write this? I am thinking maybe something like only if the 9ema (AA3)>5 ticks from C3 and C3<2 ticks from C4? This way if price does end up moving up past the 9ema it won't trigger, because it is no longer within the 2 tick maximum from the C4 (setup) candle. Can someone help me write out this formula? Thanks in Advance, Everyone has been a huge help and I am very grateful for it! Date Time Of Last Edit: 2025-01-08 01:16:21
|
[2025-01-08 01:38:39] |
Sawtooth - Posts: 4209 |
Try this: =AND(C3>C4, (C3-C4)<2, F4>4000, ABS(AA3-C3)>5) BTW, this formula is referencing points, not ticks. |
[2025-01-08 18:43:05] |
Derek J - Posts: 12 |
Thanks Sawtooth! Not sure if I am doing it right, but something about (C3-C4)<2 in parentheses, makes it to where the rest of the formula is ignored. Meaning now every time C3 is less than 2 points away from C4 it places a buy signal.
|
[2025-01-08 18:45:22] |
Derek J - Posts: 12 |
I should add it places a buy signal when it is involved with the lower BB. Not when it breaks the previous candle's high like it should. . |
To post a message in this thread, you need to log in with your Sierra Chart account: