Alertif question

I have a fundamental question of how to ensure my alerts are coming thru email - should i be using scan or explore after i code the alerts program as below: (I wanted this Alerts program to scan the symbols in my watch list and also assuming i can use "QSI#" for the name of the silver futures current rolled contract??)

Blockquote// Alerts for the price values
""
//Consolidated Break Stops

Buy = Cross(C, 14.7) AND Name()=="QSI#";

AlertIf( Buy, "EMAIL", "Consolidation Break for QSI trade- move the stop", 4 );

Buy = Cross(C, 1225) AND Name()=="QGC#";

AlertIf( Buy, "EMAIL", "Consolidation Break for QGC trade- move the stop", 4 );
""

Any pointers for this question? I would like to figure out how i can implement my program which has "AlertIf" instructions

Not sure if this is right question for the right category....i think this is a fundamental question:
"Once i write the program and save it (code above) - how do i actually execute it so i can get my alerts on my phone/email when the price levels are reached for a certain symbol as explained/instructed in the code?"

Thanks..Satish

The Users Manual answers all questions: http://www.amibroker.com/guide/h_alerts.html

I read the manual and tried the instructions to scan/produce alerts when certain symbols get to the price- i want to confirm if i am doing it right; Attached is the screenshotalerts%20Issue

Few questions:

  1. Are my scan settings right? (filter for a watchlist of symbols, "All Quotes", ignoring date range)
  2. How will it track prices in future to issue alerts at right time? (because Scan process seem to have completed)
  3. Why is it looking historical prices (as per scan output here) when the default look back is 1 - not just the last value ?
  4. Which time frame close price is scanned here? (daily, hourly etc?) Can I specify a specific time frame - if so, where should i try that?
  5. I am assuming symbol nomenclature such as QSI# is fine as that's what is used for charts display for future contract - currently active month? (I use IQFEED data)

Thank you,
Satish

Go to the Settings Window of AA, toolbox icon or use shortcut Alt + Enter.
You are still overlooking the basics and that means you have to go through the manual once again.

One can validate if you present all your settings against the requirement. No guess work.

Again go through manual and Auto-Repeat function.

Read manual, periodicity setting.

You have instructed the scan on "ALL Quotes", this means all data.
If you want to test the most recent day, use 1 recent bar(s) instead.

It is consistent with name its stored as in the DB.

Looking at the screenshot, and specifically your AFL, it will work but technically the whole purpose of Scan/Exploration is to the run the same AFL on all symbols filtered.

You don't need to code a specific condition for each symbol unless you have specific bits for each one.

Instead, go to the Filter Section, add symbols by Markets / Watchlists etc, you can even include or exclude them,
the AA is a very versatile part of AB and you can unleash its true potential if set up correctly.

1 Like

The price level alerts will be different for different symbols so i have to code different alertif commands

Thank you for the other responses - I will review and revert by rechecking the settings of AA

Thank you - i think it is working - although i still have to test it.

The key learnings are: Periodicity parameter and Autorepeat function - looks like the minimal interval timer is only 5 mins.

I have tested AA extensively in the past and am well aware of your other suggestions,,

Thank you,
Satish

You have to edit that textbox and hit enter.
You can even set it to 1 second. type "1s", make sure you hit enter.
so every minute is 1min and so on.
Default is 5min

1 Like

Do the alerts come when my Amibroker is running and my PC is in sleep mode?

Also, is it possible to have alerts sent to 2 email ids? Right now, i am getting this sent to tmobile email msg and my phone receives it as text message and sometimes this tmobile is down and this doesnt work - so would like to have an alternative

Thanks..Satish

Obviously NO.

Sleep is a state when processor IS NOT accessible to the end-user application (unless application forces system NOT to enter sleep - but that is big no-no for battery life). The application in Sleep state is NOT running, it is completely FROZEN, therefore application can NOT do anything.

Computer must be powered ON and NOT sleeping for application to do anything.

1 Like

Until I read TJ's post, I really thought you were joking :rofl: :rofl:

AlertIF is a bit complex in the underlying code.
https://www.amibroker.com/guide/h_alerts.html
It stores the TYPE and prevents repetitive signals so calling same AlertIF multiple times wont work.

If you want to send an email, you could just use SendEmail() but the problem is you would have to rewrite all the Logic to prevent repetitive signals and that will be tough.

I haven't tested it but if you can get around using a different TYPE, you maybe able to define two AlertIf, each with two email IDs but I don't know the consequence of the code going wrong.
Bcos with two AlertIf functions, they can easily go into an infinite loop each resetting the other like a Flip-Flop.

Probably TJ can answer in the best way.

2 Likes

is it possible to use alertif function with url. i tried but didnot get success.

buy=1; //any condition that generates buy
Message1 = "Buy: "+Strreplace(Name(),"&","n")+" -CMP: " + Close ;

URL1="https://api.telegram.org/botdummy/sendMessage?chat_id=@dummyuser&text="+Message1;

AlertIf(buy,"EXEC URL1",Name()+ C,1);


Please suggest how to use this. I read the manual but did not get enough information. Thanks