Login Page - Create Account

Support Board


Date/Time: Thu, 28 Mar 2024 14:46:04 +0000



[Programming Help] - Condition if Price close between n points from a level

View Count: 629

[2019-09-11 03:16:18]
Chippstrader - Posts: 30
Hi,

I am looking for a condition where price close by certain points to that condition should alert me.

For e.g. I am using Globex low for NQ100 and if close of price within 5 points of Globex Low alert me.

I tried using below OR condition but this can miss calculating odd ticks.

How do I calculate if price close (Globex low - 5 points for that bar?) I don't want to try C <= (ID4.SG2-20*0.25) as it will draw all over the place.

Globex Low = ID4.SG2
NQ - 0.25 per tick value.

=OR (C = ID4.SG2+(20*0.25), C = ID4.SG2+(16*0.25), C = ID4.SG2+(12*0.25), C = ID4.SG2+(12*0.25), C = ID4.SG2+(08*0.25), C = ID4.SG2+(04*0.25))
[2019-09-11 05:06:23]
Sawtooth - Posts: 3952
To alert at the first occurrence of price closing within 5 points above the Globex low, try this:
=AND(C[-1]>ID4.SG2[-1]+5,C<=ID4.SG2+5)
[2019-09-11 17:41:27]
Chippstrader - Posts: 30
Thank you. It tried that condition and I see little difference. I will share screenshot here.
imageGlowImage.jpg / V - Attached On 2019-09-11 17:41:13 UTC - Size: 39.18 KB - 239 views
[2019-09-11 18:05:38]
Sawtooth - Posts: 3952
The formula in post #2 will only alert when the Close price crosses the +5 line from above, and only from the previous bar.

Do you want an alert on every bar that closes between the +5 and the ONL ?
[2019-09-11 18:13:26]
Chippstrader - Posts: 30
Basically, I am working on spreadsheet automated trading. When I have a sell condition, it should also check if that price is between +5 of Glow so it will avoid taking a short trade. Same with Ghigh, if the price is close to Ghigh-5, a buy condition triggers do not buy near that level.

This is to avoid whipsaw in my system.

Thank you again for replying so quick. I appreciate it.
[2019-09-11 18:32:42]
Sawtooth - Posts: 3952
So both longs and shorts must happen between -5 of ONH and +5 of ONL?

K3:
=AND(YourBuyEntryConditions,E3<ID4.SG1@3-5,E3>ID4.SG2@3+5)
M3:
=AND(YourSellEntryConditions,E3<ID4.SG1@3-5,E3>ID4.SG2@3+5)

Where ID4.SG1 is the ONH, and ID4.SG2 is the ONL.
[2019-09-11 19:39:46]
Chippstrader - Posts: 30
I may be complicating it explain it to you.

Let me try again. I want to first try the condition. If the price trading around Glow+5 ( 7700(Glow)+5 ) If a sell signal comes within this price do not take it.

For Globex high-4 ( 7750(glow)-5 = within this range ignore but signal.

For now, I am using the Trading system Based on alert conditions (this is my market order signals). I am working on spreadsheet system for manual entries.


Buy signal is ID2.SG1 = C
Sell Signal is ID2.SG19 = C

How I can add "Buy condition" + no buy when the price is in Globexhigh-5 points area.
and "Sell condition" + no sell when the price is in GlowLow+5points area.

Thank you again for your efforts with this.
[2019-09-11 20:18:20]
Sawtooth - Posts: 3952
Ghigh = 7750
Ghigh-5 = 7745
All trades in between, here.
Clow+5 = 7705
Glow = 7700

Use the same formulas, except in Simple Alert syntax:

Buy signal:
=AND(YourBuyEntryConditions,C<ID4.SG1-5,C>ID4.SG2+5)
Sell signal:
=AND(YourSellEntryConditions,C<ID4.SG1-5,C>ID4.SG2+5)
Where ID4.SG1 is the Ghigh, and ID4.SG2 is the Glow.
[2019-09-11 23:07:53]
Chippstrader - Posts: 30
ok. I will give it a test and let you know.
[2019-09-11 23:11:26]
Chippstrader - Posts: 30
I see the buy signal may not above Globex High and sell below Globex Low.
[2019-09-11 23:30:18]
Sawtooth - Posts: 3952
The C<ID4.SG1-5,C>ID4.SG2+5) portion of the formula only allows entries between the Ghigh-5 and the Glow+5.
It does not allow entries above the Ghigh nor below the Glow.

If you are seeing entries elsewhere, then verify that ID4.SG1 is the Ghigh, and ID4.SG2 is the Glow, and edit the formula as needed.
[2019-09-11 23:44:04]
Chippstrader - Posts: 30
Thank you. I will check it out. My idea is in graph. I want to just ignore buy or sell only those areas and system can take trades remaining areas.

Thank you for replying. Please don't bother to reply if it consuming too much time of yours.
imageGlowImage2.jpg / V - Attached On 2019-09-11 23:43:32 UTC - Size: 179.38 KB - 253 views
Attachment Deleted.

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

Login

Login Page - Create Account