Log in to see Cloud of Tags

Wealth-Lab Wiki

GetNextEarningsDate

RSS

Syntax

public static DateTime GetNextEarningsDate(string symbol) public static DateTime GetNextEarningsDate2(string symbol)

Parameter Description

symbol The symbol (ticker) of a U.S. stock

Description

Returns the next earnings date of a stock. The second function is used for backup: they request the data from two different web-based sources.

Example

using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators; using Community.Components; /*** Requires installation of Community.Components Extension from www.wealth-lab.com > Extensions ***/

namespace WealthLab.Strategies { public class GetNextEarningsDateDemo : WealthScript { protected override void Execute() { // Note: leave just one call uncommented DateTime nextDate = Utility.GetNextEarningsDate(Bars.Symbol); //DateTime nextDate2 = Utility.GetNextEarningsDate2(Bars.Symbol); for(int bar = GetTradingLoopStartBar(1); bar < Bars.Count; bar++) { if (IsLastPositionActive) { SellAtClose(bar + 1, LastPosition, "Exit 1 day later"); } else { if (Bars.Datebar != nextDate.Date) //if (Bars.Datebar != nextDate2.Date) if ( Closebar > 5 ) if ( SMA.Series( Volume, 90 )bar >= 50000 ) BuyAtLimit( bar + 1, Closebar * 0.93 ); } } } } }

Important Disclaimer: The information provided by Wealth-Lab is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security.  The owner of Wealth-Lab.com assumes no liability resulting from the use of the material contained herein for investment purposes. By using this web site, you agree to the terms of this disclaimer and our Terms of Use.


ScrewTurn Wiki. Some of the icons created by FamFamFam.