NexusFi: Find Your Edge


Home Menu

 





I need help to write a SC simple alert formula, please


Discussion in Sierra Chart

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




 
Search this Thread

I need help to write a SC simple alert formula, please

  #1 (permalink)
 
Rui S's Avatar
 Rui S 
Lisbon, Portugal
 
Experience: Intermediate
Platform: TWS and Sierra Charts
Broker: IB, Stage 5 / Dorman (Teton)
Trading: Stocks and E-minis
Posts: 140 since May 2012
Thanks Given: 189
Thanks Received: 55

Hello,

I have the “Horizontal Grid” Study (it’s one of the User Contributed Studies that comes with SC) installed in some of my charts.

This Study plots up to forty horizontal lines on a chart (SG1 to SG40), depending on the user settings.

I would like to set a Simple Alert in this Study to alert me when the last price enters the vicinity of any of the Study horizontal lines (i.e. plus or minus 2 ticks), coming from below or from above.

I have been trying to write the formula for this alert but I really can’t figure out how to do it.

Is there one of the several brilliant traders / programmers in futures.io (formerly BMT) willing to write this alert formula for me, please?

I would really appreciate this favor.

Thanks.

Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Deepmoney LLM
Elite Quantitative GenAI/LLM
Build trailing stop for micro index(s)
Psychology and Money Management
Ninja Mobile Trader VPS (ninjamobiletrader.com)
Trading Reviews and Vendors
Are there any eval firms that allow you to sink to your …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
60 thanks
Funded Trader platforms
37 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #2 (permalink)
 Jolew 
San Jose, CA
 
Experience: Intermediate
Platform: Sierra Chart
Broker: IB
Trading: Futures
Posts: 113 since Jan 2011
Thanks Given: 54
Thanks Received: 97

It is a little difficult to write against so many subgraphs (very long formula). It would be easier to just write the formula on its own with same parameters as horizontal grid such as:

=MOD(C+.5, 10)<=1

This would give an alert if within two ticks of every 10 even points on ES for example.

Reply With Quote
  #3 (permalink)
 
Rui S's Avatar
 Rui S 
Lisbon, Portugal
 
Experience: Intermediate
Platform: TWS and Sierra Charts
Broker: IB, Stage 5 / Dorman (Teton)
Trading: Stocks and E-minis
Posts: 140 since May 2012
Thanks Given: 189
Thanks Received: 55


@Jolew

Thank you for your reply.

The formula you posted works very well on ES. It will serve my needs perfectly.

However, I can't figure out how to set it to work with Euro Futures, which is the instrument I am currently trading.

I have the Grid spacing set to 0.00125 (12.5 ticks).

So, I am inserting the formula as this: =MOD(C+.00025,0.00125)<=1

And it doesn't work. I first thought that it could be because of the half tick so in order to test I made some more attempts like


=MOD(C+.0002,0.00125)<=1


=MOD(C+.0002,.0012)<=1


and some others but couldn't put it to work in any way.

What am I doing wrong?

Thanks.

Started this thread Reply With Quote
Thanked by:
  #4 (permalink)
 Jolew 
San Jose, CA
 
Experience: Intermediate
Platform: Sierra Chart
Broker: IB
Trading: Futures
Posts: 113 since Jan 2011
Thanks Given: 54
Thanks Received: 97

I guess the generalized formula would be:

=MOD(C+x, s)<=2*x

where x is the trigger distance to the grid lines (2 ticks in your case)
and s is the spacing between grid lines

So should be

=MOD(C+.0002,.00125)<=.0004

Reply With Quote
Thanked by:
  #5 (permalink)
 
Rui S's Avatar
 Rui S 
Lisbon, Portugal
 
Experience: Intermediate
Platform: TWS and Sierra Charts
Broker: IB, Stage 5 / Dorman (Teton)
Trading: Stocks and E-minis
Posts: 140 since May 2012
Thanks Given: 189
Thanks Received: 55

@Jolew

Brilliant.

Thank you for the clarification, it will help a lot if in the future I need to make any change.

That's exactly what I need. I would never figure that out by myself. Thank you very much.

Just to have the complete information, would you please tell me what is the "MOD" in that formula?


Another question: I need some more help to set one more simple alert, on a VWAP Study. I don't want to bother nor to ask too much from you, but do you think you could write the formula for me?

By all means, if you can't or don't have the time to do it please just say no. I will completely understand.

Thank you very much.

Started this thread Reply With Quote
Thanked by:
  #6 (permalink)
 Jolew 
San Jose, CA
 
Experience: Intermediate
Platform: Sierra Chart
Broker: IB
Trading: Futures
Posts: 113 since Jan 2011
Thanks Given: 54
Thanks Received: 97

MOD is same as it is used in Excel - the modulo or remainder of the first number divided by the second. It is in the SC documentation under spreadsheet functions.

I can try to help if it is something I'm familiar with.

Reply With Quote
Thanked by:
  #7 (permalink)
 
Rui S's Avatar
 Rui S 
Lisbon, Portugal
 
Experience: Intermediate
Platform: TWS and Sierra Charts
Broker: IB, Stage 5 / Dorman (Teton)
Trading: Stocks and E-minis
Posts: 140 since May 2012
Thanks Given: 189
Thanks Received: 55


Jolew View Post
MOD is same as it is used in Excel - the modulo or remainder of the first number divided by the second. It is in the SC documentation under spreadsheet functions.

I can try to help if it is something I'm familiar with.


I am sorry for this late reply, that's because I live in Europe and went to bed. And that is also the reason that my English may not be the best sometimes.

Thank you for the explanation about the MOD, it makes it much clearer for me now.

Unfortunately, I have never learned how to work with spreadsheets, whether Excel or SC. Sometimes I manage to use Excel spreadsheets (in a user perspective) but I don't have a clue how to configure them. And I guess I am too old to start learning it now. Nevertheless, I toke a look at the page of SC spreadsheet functions and it has a lot of interesting information.


Regarding the other alert I need:

It is to be set in the VwapBands Study Alert.

I would like to set this alert with the following three conditions:


1- Alert when the price approaches the vicinity of the Vwap (SG1) within 3 ticks, coming from above or from below;


2- Alert when the price approaches the vicinity of the Vwsd2 Upper (SG4) within 3 ticks, coming from bellow;


3- Alert when the price approaches the vicinity of the Vwsd2 Lower (SG5) within 3 ticks, coming from above;



I also would like it to be possible for me to change the range of the 3 ticks vicinity, when needed.

If possible, I would prefer to have it set as a Simple Alert formula because I don't use spreadsheets due my lack of knowledge.

If somehow you find it is easier to set it separated in 2 or 3 studies I wouldn't mind having it that way.


Now, if you find it is too much work or for any other reason you can't do it, please just tell. No worries.

I am already very grateful to you for writing the other simple alert formula for me.

Thank you very much.

Started this thread Reply With Quote
Thanked by:
  #8 (permalink)
 Jolew 
San Jose, CA
 
Experience: Intermediate
Platform: Sierra Chart
Broker: IB
Trading: Futures
Posts: 113 since Jan 2011
Thanks Given: 54
Thanks Received: 97

My suggestion would be to first add the "Bands/Envelope" study and make a fixed offset of 3 ticks based on the main graph 'last' price. Assume this is study ID2 and VWAP is ID1.


Rui S View Post
1- Alert when the price approaches the vicinity of the Vwap (SG1) within 3 ticks, coming from above or from below;

=OR(CROSSFROMBELOW(ID2.SG1,ID1.SG1),CROSSFROMABOVE(ID2.SG2,ID1.SG1))


Rui S View Post
2- Alert when the price approaches the vicinity of the Vwsd2 Upper (SG4) within 3 ticks, coming from bellow;

=CROSSFROMBELOW(ID2.SG1,ID1.SG4)


Rui S View Post
3- Alert when the price approaches the vicinity of the Vwsd2 Lower (SG5) within 3 ticks, coming from above;

=CROSSFROMABOVE(ID2.SG2,ID1.SG5)

You can hide the bands study so it doesn't appear on the chart.

Reply With Quote
Thanked by:
  #9 (permalink)
shanemcdonald28
new york
 
Posts: 355 since Mar 2012
Thanks Given: 665
Thanks Received: 582


Jolew View Post
My suggestion would be to first add the "Bands/Envelope" study and make a fixed offset of 3 ticks based on the main graph 'last' price. Assume this is study ID2 and VWAP is ID1.



=OR(CROSSFROMBELOW(ID2.SG1,ID1.SG1),CROSSFROMABOVE(ID2.SG2,ID1.SG1))



=CROSSFROMBELOW(ID2.SG1,ID1.SG4)



=CROSSFROMABOVE(ID2.SG2,ID1.SG5)

Hi

Would I be able to use that for an alert when the stoch slow D crosses above the 30 line or below the 70 line ?

sorry to jump in on your thread !

thank you
shane

Reply With Quote
Thanked by:
  #10 (permalink)
 Jolew 
San Jose, CA
 
Experience: Intermediate
Platform: Sierra Chart
Broker: IB
Trading: Futures
Posts: 113 since Jan 2011
Thanks Given: 54
Thanks Received: 97



shanemcdonald28 View Post
Would I be able to use that for an alert when the stoch slow D crosses above the 30 line or below the 70 line ?

It sounds like you want something like this.

=OR(CROSSFROMBELOW(SG2,SG4),CROSSFROMABOVE(SG2,SG3))

Reply With Quote
Thanked by:




Last Updated on October 14, 2013


© 2024 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 - Privacy Policy - Downloads - Top
no new posts