• Easy Language Programming Interface for Planetary Data

    The ephemeris data as it is basis for the planetary indicators can be accessed directly within any Easy Language code. The interface is the function named $pi_ephem. It is part of the planetaryindicators package and can be used for Indicators, Signals, or Strategies.

    $pi_ephem provides geocentric and heliocentric data for planetary longitude, latitude, declination (only geocentric) and distance.

    Syntax of the function is:

    $pi_ephem ( planet (numeric), date (numeric), time (numeric), type (numeric), heliocentric (truefalse), sidereal (truefalse), timeZone(string))

    Parameters:

    Planet is the number of the planet (or element) for which the data is requested. It is recommended to use following constants:

    vars: P_SUN(3),P_MOON(0),P_MERCURY(1),P_VENUS(2),P_EARTH(3),P_MARS(4),P_JUPITER(5),P_SATURN(6),P_URANUS(7),P_NEPTUNE(8),P_PLUTO(9),P_NNODE(10),P_SNODE(11);

    Date and Time are date and time (in normal EL format) of the requested data.

    Type is an integer that defines the type (planetary longitude, latitude, declination or distance) of the requested item. The following constants apply:

    Vars: D_LONGITUDE(0),D_LATITUDE(1),D_DECLINATION(2),D_DISTANCE(3);

    heliocentric has to be true if heliocentric data is required. For geocentric data the parameter has to be false

    sidereal has to be true if sidereal coordinates of the geocentric longitude are required.

    Timezone is a string that defines the timezone of the chart. It should be either the time zone in hours (e.g. “+5”, “-2”) of the market relative to Greenwich, or “auto” if market time and computer system time are the same. If “auto” is set the function will automatically use the time zone of the computer.

    Return:

    The requested value as floating point number. Based on the requested type the return value is:

    D_LONGITUDE: the position of the selected planet in degrees (0-360) as seen from Sun (heliocentric) or Earth (geocentric)

    D_LATITUDE: latitude of the selected planet degrees as seen from Sun (heliocentric) or Earth (geocentric)

    D_DECLINATION: declination of the selected planet in degrees to the Earth Equator

    D_DISTANCE: distance of the selected planet in AUs (astronomic unit) to Sun (heliocentric) or Earth (geocentric)

    Example:

    Plot geocentric longitude of Mars:

    Plot1 ($pi_ephem(P_MARS, d, t, D_LONGITUDE, false, false, “auto”));


    Plot Distance of Jupiter to the Sun:

    Plot2 ($pi_ephem(P_JUPITER, d, t, D_DISTANCE, true, false, “auto”));

    Please check the Indicator [PI] Sample (also part of the PI package) for a practical example.

    Categories: PlanetaryIndicators, TradeStation

    Leave a Reply

    Your email address will not be published.