limit e-mail alerts - futures io
futures io futures trading



limit e-mail alerts


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Quick Summary with 1 posts (0 thanks)
    2. looks_two Jorma with 1 posts (0 thanks)
    3. looks_3 sam028 with 1 posts (0 thanks)
    4. looks_4 rleplae with 1 posts (0 thanks)
    1. trending_up 595 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 3 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

limit e-mail alerts

(login for full post details)
  #1 (permalink)
Versailles Ile de france France
 
Experience: Beginner
Platform: Sierra
Trading: Futures
 
Posts: 12 since Dec 2013
Thanks: 0 given, 0 received

this the program of my indicator and i want to receive 1 or 2 mails per bar, no more.
I asked in ninjatrader forum and they told me this:

Declare an integer variable. Have this variable reset to 0 on the first tick of the bar. Where you have the alert / email, add a condition that checks the value of the integer variable being under how many alerts / emails you want. Increment the integer variable each time the alert / email is triggered.
In your alert call, be sure to set the rearmSeconds to a value above 0, and to a comfortable level.

but i don' t know how to do this.


//
// Copyright (C) 2006, NinjaTrader LLC <ninjatrader@ninjatrader.com>.
// NinjaTrader reserves the right to modify or overwrite this NinjaScript component with each release.
//

#region Using declarations
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Data;
using NinjaTrader.Gui.Chart;
#endregion

#region NinjaScript generated code. Neither change nor remove.
// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
public partial class Indicator : IndicatorBase
{
private RMO[] cacheRMO = null;
private RMOarrowColor[] cacheRMOarrowColor = null;
private RMOlowerStraight[] cacheRMOlowerStraight = null;

private static RMO checkRMO = new RMO();
private static RMOarrowColor checkRMOarrowColor = new RMOarrowColor();
private static RMOlowerStraight checkRMOlowerStraight = new RMOlowerStraight();

/// <summary>
/// RMO Indicator
/// </summary>
/// <returns></returns>
public RMO RMO(int length, int rmoLength, bool showRMO, int swingTrdLen)
{
return RMO(Input, length, rmoLength, showRMO, swingTrdLen);
}

/// <summary>
/// RMO Indicator
/// </summary>
/// <returns></returns>
public RMO RMO(Data.IDataSeries input, int length, int rmoLength, bool showRMO, int swingTrdLen)
{
if (cacheRMO != null)
for (int idx = 0; idx < cacheRMO.Length; idx++)
if (cacheRMO[idx].Length == length && cacheRMO[idx].RmoLength == rmoLength && cacheRMO[idx].ShowRMO == showRMO && cacheRMO[idx].SwingTrdLen == swingTrdLen && cacheRMO[idx].EqualsInput(input))
return cacheRMO[idx];

lock (checkRMO)
{
checkRMO.Length = length;
length = checkRMO.Length;
checkRMO.RmoLength = rmoLength;
rmoLength = checkRMO.RmoLength;
checkRMO.ShowRMO = showRMO;
showRMO = checkRMO.ShowRMO;
checkRMO.SwingTrdLen = swingTrdLen;
swingTrdLen = checkRMO.SwingTrdLen;

if (cacheRMO != null)
for (int idx = 0; idx < cacheRMO.Length; idx++)
if (cacheRMO[idx].Length == length && cacheRMO[idx].RmoLength == rmoLength && cacheRMO[idx].ShowRMO == showRMO && cacheRMO[idx].SwingTrdLen == swingTrdLen && cacheRMO[idx].EqualsInput(input))
return cacheRMO[idx];

RMO indicator = new RMO();
indicator.BarsRequired = BarsRequired;
indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
indicator.MaximumBarsLookBack = MaximumBarsLookBack;
#endif
indicator.Input = input;
indicator.Length = length;
indicator.RmoLength = rmoLength;
indicator.ShowRMO = showRMO;
indicator.SwingTrdLen = swingTrdLen;
Indicators.Add(indicator);
indicator.SetUp();

RMO[] tmp = new RMO[cacheRMO == null ? 1 : cacheRMO.Length + 1];
if (cacheRMO != null)
cacheRMO.CopyTo(tmp, 0);
tmp[tmp.Length - 1] = indicator;
cacheRMO = tmp;
return indicator;
}
}

/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
public RMOarrowColor RMOarrowColor(string alertSound, string emailFrom, string emailTo, int length, int rmoLength, int separation, int swingTrdLen)
{
return RMOarrowColor(Input, alertSound, emailFrom, emailTo, length, rmoLength, separation, swingTrdLen);
}

/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
public RMOarrowColor RMOarrowColor(Data.IDataSeries input, string alertSound, string emailFrom, string emailTo, int length, int rmoLength, int separation, int swingTrdLen)
{
if (cacheRMOarrowColor != null)
for (int idx = 0; idx < cacheRMOarrowColor.Length; idx++)
if (cacheRMOarrowColor[idx].AlertSound == alertSound && cacheRMOarrowColor[idx].EmailFrom == emailFrom && cacheRMOarrowColor[idx].EmailTo == emailTo && cacheRMOarrowColor[idx].Length == length && cacheRMOarrowColor[idx].RmoLength == rmoLength && cacheRMOarrowColor[idx].Separation == separation && cacheRMOarrowColor[idx].SwingTrdLen == swingTrdLen && cacheRMOarrowColor[idx].EqualsInput(input))
return cacheRMOarrowColor[idx];

lock (checkRMOarrowColor)
{
checkRMOarrowColor.AlertSound = alertSound;
alertSound = checkRMOarrowColor.AlertSound;
checkRMOarrowColor.EmailFrom = emailFrom;
emailFrom = checkRMOarrowColor.EmailFrom;
checkRMOarrowColor.EmailTo = emailTo;
emailTo = checkRMOarrowColor.EmailTo;
checkRMOarrowColor.Length = length;
length = checkRMOarrowColor.Length;
checkRMOarrowColor.RmoLength = rmoLength;
rmoLength = checkRMOarrowColor.RmoLength;
checkRMOarrowColor.Separation = separation;
separation = checkRMOarrowColor.Separation;
checkRMOarrowColor.SwingTrdLen = swingTrdLen;
swingTrdLen = checkRMOarrowColor.SwingTrdLen;

if (cacheRMOarrowColor != null)
for (int idx = 0; idx < cacheRMOarrowColor.Length; idx++)
if (cacheRMOarrowColor[idx].AlertSound == alertSound && cacheRMOarrowColor[idx].EmailFrom == emailFrom && cacheRMOarrowColor[idx].EmailTo == emailTo && cacheRMOarrowColor[idx].Length == length && cacheRMOarrowColor[idx].RmoLength == rmoLength && cacheRMOarrowColor[idx].Separation == separation && cacheRMOarrowColor[idx].SwingTrdLen == swingTrdLen && cacheRMOarrowColor[idx].EqualsInput(input))
return cacheRMOarrowColor[idx];

RMOarrowColor indicator = new RMOarrowColor();
indicator.BarsRequired = BarsRequired;
indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
indicator.MaximumBarsLookBack = MaximumBarsLookBack;
#endif
indicator.Input = input;
indicator.AlertSound = alertSound;
indicator.EmailFrom = emailFrom;
indicator.EmailTo = emailTo;
indicator.Length = length;
indicator.RmoLength = rmoLength;
indicator.Separation = separation;
indicator.SwingTrdLen = swingTrdLen;
Indicators.Add(indicator);
indicator.SetUp();

RMOarrowColor[] tmp = new RMOarrowColor[cacheRMOarrowColor == null ? 1 : cacheRMOarrowColor.Length + 1];
if (cacheRMOarrowColor != null)
cacheRMOarrowColor.CopyTo(tmp, 0);
tmp[tmp.Length - 1] = indicator;
cacheRMOarrowColor = tmp;
return indicator;
}
}

/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
public RMOlowerStraight RMOlowerStraight(int length, int rmoLength, int separation, bool showLabel, int swingTrdLen)
{
return RMOlowerStraight(Input, length, rmoLength, separation, showLabel, swingTrdLen);
}

/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
public RMOlowerStraight RMOlowerStraight(Data.IDataSeries input, int length, int rmoLength, int separation, bool showLabel, int swingTrdLen)
{
if (cacheRMOlowerStraight != null)
for (int idx = 0; idx < cacheRMOlowerStraight.Length; idx++)
if (cacheRMOlowerStraight[idx].Length == length && cacheRMOlowerStraight[idx].RmoLength == rmoLength && cacheRMOlowerStraight[idx].Separation == separation && cacheRMOlowerStraight[idx].ShowLabel == showLabel && cacheRMOlowerStraight[idx].SwingTrdLen == swingTrdLen && cacheRMOlowerStraight[idx].EqualsInput(input))
return cacheRMOlowerStraight[idx];

lock (checkRMOlowerStraight)
{
checkRMOlowerStraight.Length = length;
length = checkRMOlowerStraight.Length;
checkRMOlowerStraight.RmoLength = rmoLength;
rmoLength = checkRMOlowerStraight.RmoLength;
checkRMOlowerStraight.Separation = separation;
separation = checkRMOlowerStraight.Separation;
checkRMOlowerStraight.ShowLabel = showLabel;
showLabel = checkRMOlowerStraight.ShowLabel;
checkRMOlowerStraight.SwingTrdLen = swingTrdLen;
swingTrdLen = checkRMOlowerStraight.SwingTrdLen;

if (cacheRMOlowerStraight != null)
for (int idx = 0; idx < cacheRMOlowerStraight.Length; idx++)
if (cacheRMOlowerStraight[idx].Length == length && cacheRMOlowerStraight[idx].RmoLength == rmoLength && cacheRMOlowerStraight[idx].Separation == separation && cacheRMOlowerStraight[idx].ShowLabel == showLabel && cacheRMOlowerStraight[idx].SwingTrdLen == swingTrdLen && cacheRMOlowerStraight[idx].EqualsInput(input))
return cacheRMOlowerStraight[idx];

RMOlowerStraight indicator = new RMOlowerStraight();
indicator.BarsRequired = BarsRequired;
indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
indicator.MaximumBarsLookBack = MaximumBarsLookBack;
#endif
indicator.Input = input;
indicator.Length = length;
indicator.RmoLength = rmoLength;
indicator.Separation = separation;
indicator.ShowLabel = showLabel;
indicator.SwingTrdLen = swingTrdLen;
Indicators.Add(indicator);
indicator.SetUp();

RMOlowerStraight[] tmp = new RMOlowerStraight[cacheRMOlowerStraight == null ? 1 : cacheRMOlowerStraight.Length + 1];
if (cacheRMOlowerStraight != null)
cacheRMOlowerStraight.CopyTo(tmp, 0);
tmp[tmp.Length - 1] = indicator;
cacheRMOlowerStraight = tmp;
return indicator;
}
}
}
}

// This namespace holds all market analyzer column definitions and is required. Do not change it.
namespace NinjaTrader.MarketAnalyzer
{
public partial class Column : ColumnBase
{
/// <summary>
/// RMO Indicator
/// </summary>
/// <returns></returns>
[Gui.Design.WizardCondition("Indicator")]
public Indicator.RMO RMO(int length, int rmoLength, bool showRMO, int swingTrdLen)
{
return _indicator.RMO(Input, length, rmoLength, showRMO, swingTrdLen);
}

/// <summary>
/// RMO Indicator
/// </summary>
/// <returns></returns>
public Indicator.RMO RMO(Data.IDataSeries input, int length, int rmoLength, bool showRMO, int swingTrdLen)
{
return _indicator.RMO(input, length, rmoLength, showRMO, swingTrdLen);
}

/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
[Gui.Design.WizardCondition("Indicator")]
public Indicator.RMOarrowColor RMOarrowColor(string alertSound, string emailFrom, string emailTo, int length, int rmoLength, int separation, int swingTrdLen)
{
return _indicator.RMOarrowColor(Input, alertSound, emailFrom, emailTo, length, rmoLength, separation, swingTrdLen);
}

/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
public Indicator.RMOarrowColor RMOarrowColor(Data.IDataSeries input, string alertSound, string emailFrom, string emailTo, int length, int rmoLength, int separation, int swingTrdLen)
{
return _indicator.RMOarrowColor(input, alertSound, emailFrom, emailTo, length, rmoLength, separation, swingTrdLen);
}

/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
[Gui.Design.WizardCondition("Indicator")]
public Indicator.RMOlowerStraight RMOlowerStraight(int length, int rmoLength, int separation, bool showLabel, int swingTrdLen)
{
return _indicator.RMOlowerStraight(Input, length, rmoLength, separation, showLabel, swingTrdLen);
}

/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
public Indicator.RMOlowerStraight RMOlowerStraight(Data.IDataSeries input, int length, int rmoLength, int separation, bool showLabel, int swingTrdLen)
{
return _indicator.RMOlowerStraight(input, length, rmoLength, separation, showLabel, swingTrdLen);
}
}
}

// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
public partial class Strategy : StrategyBase
{
/// <summary>
/// RMO Indicator
/// </summary>
/// <returns></returns>
[Gui.Design.WizardCondition("Indicator")]
public Indicator.RMO RMO(int length, int rmoLength, bool showRMO, int swingTrdLen)
{
return _indicator.RMO(Input, length, rmoLength, showRMO, swingTrdLen);
}

/// <summary>
/// RMO Indicator
/// </summary>
/// <returns></returns>
public Indicator.RMO RMO(Data.IDataSeries input, int length, int rmoLength, bool showRMO, int swingTrdLen)
{
if (InInitialize && input == null)
throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");

return _indicator.RMO(input, length, rmoLength, showRMO, swingTrdLen);
}

/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
[Gui.Design.WizardCondition("Indicator")]
public Indicator.RMOarrowColor RMOarrowColor(string alertSound, string emailFrom, string emailTo, int length, int rmoLength, int separation, int swingTrdLen)
{
return _indicator.RMOarrowColor(Input, alertSound, emailFrom, emailTo, length, rmoLength, separation, swingTrdLen);
}

/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
public Indicator.RMOarrowColor RMOarrowColor(Data.IDataSeries input, string alertSound, string emailFrom, string emailTo, int length, int rmoLength, int separation, int swingTrdLen)
{
if (InInitialize && input == null)
throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");

return _indicator.RMOarrowColor(input, alertSound, emailFrom, emailTo, length, rmoLength, separation, swingTrdLen);
}

/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
[Gui.Design.WizardCondition("Indicator")]
public Indicator.RMOlowerStraight RMOlowerStraight(int length, int rmoLength, int separation, bool showLabel, int swingTrdLen)
{
return _indicator.RMOlowerStraight(Input, length, rmoLength, separation, showLabel, swingTrdLen);
}

/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
public Indicator.RMOlowerStraight RMOlowerStraight(Data.IDataSeries input, int length, int rmoLength, int separation, bool showLabel, int swingTrdLen)
{
if (InInitialize && input == null)
throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");

return _indicator.RMOlowerStraight(input, length, rmoLength, separation, showLabel, swingTrdLen);
}
}
}
#endregion

Started this thread Reply With Quote

Journal Challenge February 2021 results:
Competing for $1500 in prizes from Topstep
looks_oneSBtrader82 's Trading Journalby SBtrader82
(173 thanks from 31 posts)
looks_twoJust BEING a Trader: Letting Go!!by iqgod
(120 thanks from 33 posts)
looks_3Wisdom is Emptinessby Mtype
(68 thanks from 25 posts)
looks_4Deetee’s DAX Trading Journal (time based)by Deetee
(35 thanks from 17 posts)
looks_5Journal for peanuts1956by peanuts1956
(23 thanks from 13 posts)
 
 
(login for full post details)
  #3 (permalink)
Gits (Hooglede) Belgium
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
 
rleplae's Avatar
 
Posts: 2,991 since Sep 2013
Thanks: 2,437 given, 5,801 received


What is the exact logic to fire the email ?

In big lines what you need to do :

1) you need to make sure your indicator is called not only on bar close, if you want the logic to be triggered more than once a bar (onbarclose = false)
2) you will have to keep track and see if a new bar was formed
3) upon trigger condition create email (sendmail) and put a flag (maildone =1)
4) reset the flag on a new bar (maildone =0)

hope this helps you

Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #4 (permalink)
Site Moderator
 
 
sam028's Avatar
 
Posts: 3,665 since Jun 2009
Thanks: 3,786 given, 4,494 received


Jorma View Post
this the program of my indicator and i want to receive 1 or 2 mails per bar, no more.
I asked in ninjatrader forum and they told me this:
...

The code provided seems to be the Ninja generated part, not the indicator itself: no Initialize(), no OnBarUpdate(), ...
We can't do anything without the source, the code provided here is useless.

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote


futures io Trading Community Platforms and Indicators NinjaTrader > limit e-mail alerts


Last Updated on March 3, 2016


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Call Option Buying: The New Pain Trade? w/Carley Garner

Elite only
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

New Challenge (TBD)

April
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts