Tag Archives: Java

MAMA Java Strategy code walkthrough for MotiveWave

This video is a crash course in how to set up and understand this coding. I would suggest you should be proficient in Java. I would recommend this book

https://www.oreilly.com/library/view/head-first-java/0596009208/

ALso, I would watch these video a requirement before understanding this source code walkthrough.

Here is the code walkthrough

Java email download walkthrough

Here is a source code walkthru on how to download email within Java


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Properties;
import java.util.Scanner;

import javax.mail.Folder;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.NoSuchProviderException;
import javax.mail.Session;

import com.sun.mail.pop3.POP3Store;

public class EmailReceiveTest {

	public static void main(String[] args) {

		String mailPop3Host = "";
		String mailStoreType = "pop3";
		String mailUser = "";
		String mailPassword = "";

		receiveEmail(mailPop3Host, mailStoreType, mailUser, mailPassword);
	}

	public static void receiveEmail(String pop3Host, String storeType, String user, String password) {

		try {
			Properties properties = new Properties();
			properties.put("mail.pop3.host", pop3Host);
			Session emailSession = Session.getDefaultInstance(properties);

			POP3Store emailStore = (POP3Store) emailSession.getStore(storeType);
			emailStore.connect(user, password);

			Folder emailFolder = emailStore.getFolder("INBOX");
			emailFolder.open(Folder.READ_ONLY);

			Message[] messages = emailFolder.getMessages();
			for (int i = 0; i < messages.length; i++) {
				Message message = messages[i];
				System.out.println("==============================");
				System.out.println("Email #" + (i + 1));
				System.out.println("Subject: " + message.getSubject());
				System.out.println("From: " + message.getFrom()[0]);
				System.out.println("Text: " + message.getContent().toString());
				System.out.print("press a key....");
				BufferedReader buffer=new BufferedReader(new InputStreamReader(System.in));
				String line=buffer.readLine();
			}

			emailFolder.close(false);
			emailStore.close();
		} catch (NoSuchProviderException e) {
			e.printStackTrace();
		} catch (MessagingException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}

	}

}

Interactive Brokers API Workshop Preview in Java

Interactive Brokers API Workshop Preview in Java

 

Note that all of you Quant Elite will be able attend for FREEĀ 

I have a survey running at
https://www.surveymonkey.com/r/B6KT7HM

CRUCIAL Survey on FUTURE Interactive Brokers workshop