Bill311 Posted March 12, 2019 Report Posted March 12, 2019 Is there a way to include the price on the alert message? Quote
Jerry Medved Posted March 12, 2019 Report Posted March 12, 2019 Most MT alerts already show the price at the time the alert was triggered by default, unless you specified a custom message for the alert. If you did that, you can specify [LAST] in the message and MT will substitute the price for that placeholder. Quote
Bill311 Posted March 13, 2019 Author Report Posted March 13, 2019 Where do I specify [Last] in the following alert msg. I tried different it at different positions and I am getting an error. Quote
Jerry Medved Posted March 13, 2019 Report Posted March 13, 2019 1) what type of alert are you doing? 2) what "following alert msg"? 3) what error? (gotta give details) where exactly are you trying to do this? In alerts you can specify the alert NOTE which is basically a custom description that can either add to or replace the default one. That is where the [Last] would be entered. Quote
Bill311 Posted March 13, 2019 Author Report Posted March 13, 2019 Strangely, the attached code was truncated. I enter this on the paintbar editor. 1) what type of alert are you doing? Scan 2) what "following alert msg"? TriggerAlert("SELL", @"Strong sell"); 3) what error? (gotta give details) " Invalid Expression Term" on the paintbar checker. where exactly are you trying to do this? In alerts you can specify the alert NOTE which is basically a custom description that can either add to or replace the default one. That is where the [Last] would be entered. Quote
Jerry Medved Posted March 13, 2019 Report Posted March 13, 2019 ok I see. You would normally not enter alert details like that at the paintbar level. Instead, when actually turning on the alert, you would do it there. . you could however add the price to the message of the alert if you wanted. TriggerAlert("SELL", "Strong sell @ " + Close.ToString()); would result in: Strong sell @ 123.45 Quote
Bill311 Posted March 13, 2019 Author Report Posted March 13, 2019 It works. How do I limit the value displayed to 2 decimal places? Thanks. Quote
Jerry Medved Posted March 13, 2019 Report Posted March 13, 2019 I will email you an updated version wehre you will be able to specify .ToString("#,###,##0.00") Quote
Bill311 Posted March 14, 2019 Author Report Posted March 14, 2019 The current output for the alert is Alert "<BUY>" on SMTC Scan "SCAN02" @51.39 Is there way to reorganize? To this: <BUY> SMTC @51.39 on Scan "SCAN02" The "Alert " wording is redundant since the alert goes to the alert log only.. Quote
Bill311 Posted March 14, 2019 Author Report Posted March 14, 2019 Or maybe to the following <BUY> SMTC @51.39 on "SCAN02" Quote
Jerry Medved Posted March 14, 2019 Report Posted March 14, 2019 when defining the alert on the scan tab parameters, that is where you can change it to anything you want. Click on the NOTE tab on the alert editor screen, select to REPLACE then enter whatever info you want in there. MT supports various placeholders. right click for options. Quote
Bill311 Posted March 14, 2019 Author Report Posted March 14, 2019 I don't know what I am doing wrong but I am not getting the syntax I am looking for. I entered the following on the alert editor and select REPLACE : [DESC] [SYMBOL] @[LAST] [ALERTTYPE] I am still getting the same syntax as before. I did enable and also disable the "Global, None" alert but it didn't make any difference. After I delete "Global, None" now it always force me to select an Alert Type when I create a new "Global" alert. Quote
Jerry Medved Posted March 15, 2019 Report Posted March 15, 2019 the [DESC] tag is the default alert description, so your result will start with whatever the description was there before. that may be what you are seeing. After that however, you will see the symbol, etc. For example, I ran a test that had a default triggered alert description show as: Alert "52wLow!" on DLHC Scan "*** New Paintbar" I changed it to be yours. now it shows as: Alert "52wLow!" on DLHC Scan "*** New Paintbar" DLHC @6.02 Scan if you don't want the default alert description, don't include [DESC] As for Global, None - not really sure what you are talking about. that would show on the Alert Editor if you selected to create a Global Alert but didn't yet specify the type (thus the "none"). That has nothing to do with scan alerts. You would turn on the scan alert on the portfolio's Scan tab. Click on the PARAMS button on lower left of that tab, then check the alert box. Quote
Bill311 Posted March 15, 2019 Author Report Posted March 15, 2019 I am a little confused now. I simply wanted this syntax from the scan to appear on both the alert pop window and the alert log: <BUY> SMTC @51.39 on "SCAN02" instead of the current output: Alert "<BUY>" on SMTC Scan "SCAN02" @51.39 which was created by the following code on the scan : This is what I did per your suggestion: First, I entered the following syntax on the Alert Editor [DESC] [SYMBOL] @[LAST] [ALERTTYPE] On the Alert Editor there was a default "Global, none". Second, I enabled and disabled "Global, None" but it make no differences. When I deleted it, it can't be recreated again and was forced to select a pre-defined alert type. Third, the Alert is enabled on the scan. Quote
Jerry Medved Posted March 15, 2019 Report Posted March 15, 2019 OK, but you didn't read what I said. You should NOT be in the alert editor AT ALL for Paintbar and scan alerts. You should be on the Portfolio SCANNER tab. click on the PARAMS button. click on the alert button. on there, on the NOTE Tab, specify what I said, without DESC Quote
Bill311 Posted March 15, 2019 Author Report Posted March 15, 2019 Thanks for the clarification. However, it still won't give me the syntax I am looking for. <BUY> SMTC @51.39 on "SCAN02" The best I can get is the same as the original. Alert "<BUY>" on SMTC Scan "SCAN02" @51.39 No place holder for the following: [NAME] Scan name [DESCRIPTION] just the message and not including the other words. For example, <BUY> instead of "Alert "<BUY>" on SMTC Scan "SCAN02"" Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.