DislikedCan anyone attach push alerts to the following indicators? The turtle channel shows where the price is in relation to the trend. The classic turtle gives buy sell signals along with exit signals in conjuction with the turtle channel indicator. So I guess i just need push alerts for the classic turtle indicator when it prints an arrow indicating a new sell/buy. I have example on a chart how it looks. Thanks in advance. {file} {file} {image}Ignored
- I don't have time to add separate push Alerts - I don't have time for testing - typing is quick.
- However, should be able - in this instance, but not always - to convert the popup alerts code to push alerts. After editing the popup Alert will be Push.
- Open indicator in MetatEditor.
- [Save as] new name to differentiate about to be edited indicator from original indicator.
- After [Save As] the new named indicator will be in the editor and the original indicator will have dropped out. The original indicator will still be on file via Navigator panel if needed.
- Change - 4 instances - of the code word 'Alert' to 'SendNotification'.
- Delete 'Alert' and Type 'SendN' - the code should auto complete to 'SendNotification'
Before:
Inserted Code
// Alerts if(TimeStamp != Time[0] && DisplayAlerts == true) { // Exit signals if(LongInfo[1] == OUT_OF_MARKET && LongInfo[2] == IN_THE_MARKET && AlertCount == 0) { Alert("[Classic Turtle Trader "+ TradePeriod +"-"+ StopPeriod +"]["+ Symbol() +"] Close longs"); } else if (ShortInfo[1] == OUT_OF_MARKET && ShortInfo[2] == IN_THE_MARKET && AlertCount == 0) { Alert("[Classic Turtle Trader "+ TradePeriod +"-"+ StopPeriod +"]["+ Symbol() +"] Close shorts"); } // Enter signals if(LongInfo[1] == IN_THE_MARKET && LongInfo[2] == OUT_OF_MARKET && AlertCount == 0) { Alert("[Classic Turtle Trader "+ TradePeriod +"-"+ StopPeriod +"]["+ Symbol() +"] BUY"); } else if (ShortInfo[1] == IN_THE_MARKET && ShortInfo[2] == OUT_OF_MARKET && AlertCount == 0) { Alert("[Classic Turtle Trader "+ TradePeriod +"-"+ StopPeriod +"]["+ Symbol() +"] SELL"); } TimeStamp = Time[0]; AlertCount = 0; }
After:
Inserted Code
// Alerts if(TimeStamp != Time[0] && DisplayAlerts == true) { // Exit signals if(LongInfo[1] == OUT_OF_MARKET && LongInfo[2] == IN_THE_MARKET && AlertCount == 0) { SendNotification("[Classic Turtle Trader "+ TradePeriod +"-"+ StopPeriod +"]["+ Symbol() +"] Close longs"); } else if (ShortInfo[1] == OUT_OF_MARKET && ShortInfo[2] == IN_THE_MARKET && AlertCount == 0) { SendNotification("[Classic Turtle Trader "+ TradePeriod +"-"+ StopPeriod +"]["+ Symbol() +"] Close shorts"); } // Enter signals if(LongInfo[1] == IN_THE_MARKET && LongInfo[2] == OUT_OF_MARKET && AlertCount == 0) { SendNotification("[Classic Turtle Trader "+ TradePeriod +"-"+ StopPeriod +"]["+ Symbol() +"] BUY"); } else if (ShortInfo[1] == IN_THE_MARKET && ShortInfo[2] == OUT_OF_MARKET && AlertCount == 0) { SendNotification("[Classic Turtle Trader "+ TradePeriod +"-"+ StopPeriod +"]["+ Symbol() +"] SELL"); } TimeStamp = Time[0]; AlertCount = 0; }
Compile: The edited code can only take effect if compiled.
Attached Image
Attached Image
Attached Image
Note: If after editing the code an error exists use Ctrl+Z to roll back the edited code to original code - then start again.
Note: Two warnings [2 warning(s)] will show - these warnings are of the original code - they are minor and for present should not impede operation and can be ignored - however you can try the following to eliminate the 2 warning(s) - I do not have time to test, but should be in order - I have added 2 x two brackets, [One extra bracket before 'CLOSE' (now 4 open brackets total) and one extra bracket after the last 'false' (now 3 close brackets total)] - you will have to suss the before - below is the after.
After:
Inserted Code
// Exit longs taking into account strict exits and the greedy mode // Loose mode only applies after the bar has closed if((((CLOSE < slow && i > 0) && (CLOSE > long_price || Greedy == false)) || (LOW < slow && StrictExit == true && (LOW > long_price || Greedy == false))) && LongInfo[i] == IN_THE_MARKET) { LongInfo[i] = OUT_OF_MARKET; ExtMapBuffer3[i] = LOW; } // Exit shorts taking into account strict exits and the greedy mode // Loose mode only applies after the bar has closed if((((CLOSE > shigh && i > 0) && (CLOSE < short_price || Greedy == false)) || (HIGH > shigh && StrictExit == true && (HIGH < short_price || Greedy == false))) && ShortInfo[i] == IN_THE_MARKET)
Attached Image
Attached Image
Attached Image
NO PM CODE REQUESTS - NO TIME // Posts are personal reference notes.
1