I have two MC signals that I would like to use as an Indicator so I can use the email alert function of an Indicator.
This is the signal script...
inputs: Price( Close ), FastLength( 4 ), MedLength( 9 ), SlowLength( 18 ) ;
variables: var0( 0 ), var1( 0 ), var2( 0 ) ;
var0 = AverageFC( Price, FastLength ) ;
var1 = AverageFC( Price, MedLength ) ;
var2 = AverageFC( Price, SlowLength ) ;
Condition1 = Price > var0 and var0 > var1 and var1 > var2 ;
condition2 = CurrentBar > 1 and Condition1 and Condition1[1] = false;
if condition2
then
Buy ( "MA3CrsLE" ) next bar at market ;
I would like to,remove the "Buy ( "MA3CrsLE" ) next bar at market ;" code in this signal and have it replcaed with a line of code that produces an Alert..
thank you
How to change Signal to an Indicator with alert function [SOLVED]
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: How to change Signal to an Indicator with alert function
This is a good place to start:I have two MC signals that I would like to use as an Indicator so I can use the email alert function of an Indicator.
This is the signal script...
inputs: Price( Close ), FastLength( 4 ), MedLength( 9 ), SlowLength( 18 ) ;
variables: var0( 0 ), var1( 0 ), var2( 0 ) ;
var0 = AverageFC( Price, FastLength ) ;
var1 = AverageFC( Price, MedLength ) ;
var2 = AverageFC( Price, SlowLength ) ;
Condition1 = Price > var0 and var0 > var1 and var1 > var2 ;
condition2 = CurrentBar > 1 and Condition1 and Condition1[1] = false;
if condition2
then
Buy ( "MA3CrsLE" ) next bar at market ;
I would like to,remove the "Buy ( "MA3CrsLE" ) next bar at market ;" code in this signal and have it replcaed with a line of code that produces an Alert..
thank you
viewtopic.php?f=16&t=6929
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: How to change Signal to an Indicator with alert function
Thanks TJ here is the script now in a code box, hope this makes it easier for someone to help me...
Code: Select all
inputs:
BollingerPrice( Close ),
TestPriceLBand( Close ),
Length( 20 ),
NumDevsDn( 2 ) ;
variables:
var0( 0 ) ;
var0 = BollingerBand( BollingerPrice, Length, -NumDevsDn ) ;
condition1 = CurrentBar > 1 and TestPriceLBand crosses over var0 ;
if condition1 then
Buy ( "BBandLE" ) next bar at var0 stop ;
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: How to change Signal to an Indicator with alert function [SOLVED]
Hello trim,
Alerts are generated when the Alert reserved word is triggered in your code. Both Indicators and signals can generate an alert now. Please review the help guide for Alert keyword to learn how to utilize it in your code.
Alerts are generated when the Alert reserved word is triggered in your code. Both Indicators and signals can generate an alert now. Please review the help guide for Alert keyword to learn how to utilize it in your code.