NexusFi: Find Your Edge


Home Menu

 





Alert formula help


Discussion in Sierra Chart

Updated
    1. trending_up 2,821 views
    2. thumb_up 3 thanks given
    3. group 2 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 thafuz 
Greensboro NC/USA
 
Experience: Beginner
Platform: ninjatrader
Trading: Mini NQ and MNQ
Posts: 4 since Jan 2016
Thanks Given: 5
Thanks Received: 0

Hello,

I am trying to combine two alerts

My current alert is this
=AND(ID33.SG1=1,ID47.SG1>-10,ID48.SG1>-12,CROSSFROMBELOW(ID2.SG1,ID5.SG1))

I am trying to replace the crossover with price closing above an up sloped moving average(which I can not figure out how to do), I have the coloring set based on slope but I am not sure how to access the slope to use it in an alert.

I found this code on sierra charts forums by @TomLib

=AND(C[-1]<ID5.SG1[-3],C>ID5.SG1[-2]) which from the looks of it is the first bar that closes above the moving average not including the slope this could work.

Trying to combine
=AND(C[-1]<ID5.SG1[-3],C>ID5.SG1[-2])
+
=AND(ID33.SG1=1,ID47.SG1>-10,ID48.SG1>-12)

can someone help me with this?


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Kharg Island at 6%, Regime Fall at 1.5% -- The Black Swa …
Prediction Markets & Event Contracts
Trump Truth Social Fires Hormuz From 10% to 59% -- Arsen …
Prediction Markets & Event Contracts
One Wallet Made $200K in Hours: AP Probes Polymarket Cea …
Prediction Markets & Event Contracts
Iran Lebanon Problem Kills Switzerland Talks, Brent at $ …
Prediction Markets & Event Contracts
CFTC Opens First COT Report Review in 20 Years -- Asks W …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
205 thanks
Sober Journey With S&P
21 thanks
30 Sessions
20 thanks
Volume Indicators
8 thanks
Thanks Mike. Godspeed.
7 thanks
  #2 (permalink)
 Sawtooth 
Prescott AZ USA
 
Experience: Advanced
Platform: SierraChart
Broker: EdgeClear, FCM:Phillip, Data:Denali, Routing:Teton
Trading: YM RTY ES NQ
Posts: 480 since Nov 2009
Thanks Given: 222
Thanks Received: 608


Quoting 
I have the coloring set based on slope but I am not sure how to access the slope to use it in an alert.

https://www.sierrachart.com/index.php?page=doc/StudyChartAlertsAndScanning.php
Scroll way down to see formula examples #8 and #9.

If there are never any flat segments, example #8 will always work.
If there are any single flat segments, use example #9.
If there are multiple sequential flat segments, an intermediate study with another formula is needed.


Quoting 
I am trying to replace the crossover with price closing above an up sloped moving average

I think you'll want to keep the crossover so that you only get the alert once. Try this:
=AND(ID33.SG1=1,ID47.SG1>-10,ID48.SG1>-12,CROSSFROMBELOW(ID2.SG1,ID5.SG1) , ID5.SG1 > ID5.SG1[-1],ID5.SG1[-1] < ID5.SG1[-2])
This is from example #8, and only for an upsloped MA.


Reply With Quote
Thanked by:
  #3 (permalink)
 thafuz 
Greensboro NC/USA
 
Experience: Beginner
Platform: ninjatrader
Trading: Mini NQ and MNQ
Posts: 4 since Jan 2016
Thanks Given: 5
Thanks Received: 0



tomgilb View Post
https://www.sierrachart.com/index.php?page=doc/StudyChartAlertsAndScanning.php
Scroll way down to see formula examples #8 and #9.

If there are never any flat segments, example #8 will always work.
If there are any single flat segments, use example #9.
If there are multiple sequential flat segments, an intermediate study with another formula is needed.


I think you'll want to keep the crossover so that you only get the alert once. Try this:
=AND(ID33.SG1=1,ID47.SG1>-10,ID48.SG1>-12,CROSSFROMBELOW(ID2.SG1,ID5.SG1) , ID5.SG1 > ID5.SG1[-1],ID5.SG1[-1] < ID5.SG1[-2])
This is from example #8, and only for an upsloped MA.

I have additional criteria in a spreadsheet that it checks for, my problem is that sometimes the other criteria is met but a cross over doesn't happen the second time because the moving averages are already in sync. So this is just the trigger for the spreadsheet. Is it possible to use your other code but only the first occurence of it? @TomGlib

For the short I would need to do the same thing. These are Tilson moving averages so I do not have issues with flat segments.

Short code that I also would like to get rid of the crossover as well.
=AND( ID47.SG1<10,ID34.SG1=1,CROSSFROMABOVE(ID2.SG1,ID5.SG1))

Thank you so much for you help!


Started this thread Reply With Quote
  #4 (permalink)
 thafuz 
Greensboro NC/USA
 
Experience: Beginner
Platform: ninjatrader
Trading: Mini NQ and MNQ
Posts: 4 since Jan 2016
Thanks Given: 5
Thanks Received: 0


tomgilb View Post
https://www.sierrachart.com/index.php?page=doc/StudyChartAlertsAndScanning.php
Scroll way down to see formula examples #8 and #9.

If there are never any flat segments, example #8 will always work.
If there are any single flat segments, use example #9.
If there are multiple sequential flat segments, an intermediate study with another formula is needed.


I think you'll want to keep the crossover so that you only get the alert once. Try this:
=AND(ID33.SG1=1,ID47.SG1>-10,ID48.SG1>-12,CROSSFROMBELOW(ID2.SG1,ID5.SG1) , ID5.SG1 > ID5.SG1[-1],ID5.SG1[-1] < ID5.SG1[-2])
This is from example #8, and only for an upsloped MA.

I have additional criteria in a spreadsheet that it checks for, my problem is that sometimes the other criteria is met but a cross over doesn't happen the second time because the moving averages are already in sync. So this is just the trigger for the spreadsheet. Is it possible to use your other code but only the first occurence of it? @TomGlib

For the short I would need to do the same thing. These are Tilson moving averages so I do not have issues with flat segments.

Short code that I also would like to get rid of the crossover as well.
=AND( ID47.SG1<10,ID34.SG1=1,CROSSFROMABOVE(ID2.SG1,ID5.SG1))

Thank you so much for you help!


Started this thread Reply With Quote
  #5 (permalink)
 Sawtooth 
Prescott AZ USA
 
Experience: Advanced
Platform: SierraChart
Broker: EdgeClear, FCM:Phillip, Data:Denali, Routing:Teton
Trading: YM RTY ES NQ
Posts: 480 since Nov 2009
Thanks Given: 222
Thanks Received: 608


Quoting 
Is it possible to use your other code but only the first occurrence of it?

You'd probably need a persistent variable formula like this spreadsheet example:
https://www.sierrachart.com/index.php?page=doc/SpreadsheetExampleFormulasAndUsage.php
Scroll down to 'Buy on First Signal and Ignore Multiple Signals'

Persistent variables can also be created using the Spreadsheet Formula study, which is not a spreadsheet study, despite its name.

You've given formulas with ID2, ID5, ID33, ID34, ID47, ID48. It's difficult for me to offer specific advice.

If you want an alert when any one of several conditions goes TRUE when all the others are already TRUE, use a format like this:
=OR(AND(Condition1goesTRUE, Condition2isTRUE, Condition3isTRUE),AND(Condition1isTRUE, Condition2goesTRUE, Condition3isTRUE),AND(Condition1isTRUE, Condition2isTRUE, Condition3goesTRUE))


Reply With Quote
Thanked by:




Last Updated on May 27, 2021


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts