Tag Archives: coding

MotiveWave SDK Java no 3rd party coding problems so far

Here they are as there are few 3rd party examples

BIG UPDATE BELOW which means I got this partially working!!

I tested to add a Redis NOSQL (3rd party) using simple Jedis Jar. This was done fairly easily with another Mac OS based proprietary platform like Dukascopy JForex. I could see the Redis update when running the strategy or study within MotiveWave. This builds fine. but there does not seem debugging log capabilities for a strategy but there is for studies. Also, when making changes in the Java in Eclipse, the MotiveWave platform does not seem to pick up the latest changes  in a dynamically changed class.  The only way for this to be picked up is by reseting the platform.

My opinion but it is looking good but …

I think there needs to a be lot more samples from MotiveWave instead of just 3 simple studies and 1 strategy. I could only find one other 3rd party providing further examples. Unfortunately, I am not  in the business of spinning my wheels to figure this out as compared to other brokers/platform who provide flawless coding experiences. I think I need to see a demo or better examples.

Until then, I am may just use MotiveWave for charting or connecting with IQFeed only. I can do that with the entry level MotionWave edition. This platform is very exciting indeed but I need to get to see improvements in the above area before I get serious with it from a coding point for view.

BIG UPDATE on getting Java coding! (Nov 29)

See the video to see what is working including text writing and CSV reading files

Here is working Java code as hinted in the video

package study_examples;

import com.motivewave.platform.sdk.common.Coordinate;

import com.motivewave.platform.sdk.common.DataContext;

import com.motivewave.platform.sdk.common.DataSeries;

import com.motivewave.platform.sdk.common.Defaults;

import com.motivewave.platform.sdk.common.Enums;

import com.motivewave.platform.sdk.common.Inputs;

import com.motivewave.platform.sdk.common.MarkerInfo;

import com.motivewave.platform.sdk.common.desc.InputDescriptor;

import com.motivewave.platform.sdk.common.desc.IntegerDescriptor;

import com.motivewave.platform.sdk.common.desc.MAMethodDescriptor;

import com.motivewave.platform.sdk.common.desc.MarkerDescriptor;

import com.motivewave.platform.sdk.common.desc.PathDescriptor;

import com.motivewave.platform.sdk.common.desc.SettingGroup;

import com.motivewave.platform.sdk.common.desc.SettingTab;

import com.motivewave.platform.sdk.common.desc.SettingsDescriptor;

import com.motivewave.platform.sdk.common.desc.ValueDescriptor;

import com.motivewave.platform.sdk.draw.Marker;

import com.motivewave.platform.sdk.study.RuntimeDescriptor;

import com.motivewave.platform.sdk.study.Study;

import com.motivewave.platform.sdk.study.StudyHeader;

import java.io.File;

import java.io.FileWriter;

import java.io.IOException;

import redis.clients.jedis.Jedis;

import java.io.BufferedReader;

import java.io.FileNotFoundException;

import java.io.FileReader;

import java.io.IOException;

/** Moving Average Cross. This study consists of two moving averages: 

    Fast MA (shorter period), Slow MA. Signals are generated when the 

    Fast MA moves above or below the Slow MA. Markers are also displayed 

    where these crosses occur. */

@StudyHeader(

  namespace=”com.mycompany”, 

  id=”MACROSS”, 

  name=”Sample Moving Average Cross”,

  label=”MA Cross”,

  desc=”Displays a signal arrow when two moving averages (fast and slow) cross.”,

  menu=”Examples”,

  overlay=true,

  signals=true)

public class SampleMACross extends Study

{

  enum Values { FAST_MA, SLOW_MA };

  enum Signals { CROSS_ABOVE, CROSS_BELOW };

  @Override

  public void initialize(Defaults defaults)

  {

try {

File file = new File(“/Users/quantlabsnet/atestfile1.txt”);

FileWriter fileWriter = new FileWriter(file);

fileWriter.write(“This is “);

fileWriter.write(“a test”);

fileWriter.flush();

fileWriter.close();

} catch (IOException e) {

this.debug(e.toString());

e.printStackTrace();

}

//https://www.mkyong.com/java/how-to-read-and-parse-csv-file-in-java/

String csvFile = “/Users/quantlabsnet/country.csv”;

    BufferedReader br = null;

    String line = “”;

    String cvsSplitBy = “,”;

    try {

        br = new BufferedReader(new FileReader(csvFile));

        while ((line = br.readLine()) != null) {

            // use comma as separator

            String[] country = line.split(cvsSplitBy);

            this.debug(“Country [code= ” + country[4] + ” , name=” + country[5] + “]”);

        }

    } catch (FileNotFoundException e) {

        e.printStackTrace();

        this.debug(e.toString());

    } catch (IOException e) {

        e.printStackTrace();

        this.debug(e.toString());

    } finally {

        if (br != null) {

            try {

                br.close();

            } catch (IOException e) {

                e.printStackTrace();

                this.debug(e.toString());

            }

        }

    }

// Jedis jedis = new Jedis(“localhost”); 

//    this.debug(“Connection to server sucessfully”); 

//    //check whether server is running or not 

//    this.debug(“Server is running: “+jedis.ping()); 

 

this.debug(“hello debug from SampleMACross()”);

 

    // User Settings

    SettingsDescriptor sd=new SettingsDescriptor();

    setSettingsDescriptor(sd);

    SettingTab tab=new SettingTab(“General”);

    sd.addTab(tab);

    // Fast MA (shorter period)

    SettingGroup ma1=new SettingGroup(“Fast MA”);

    tab.addGroup(ma1);

    ma1.addRow(new InputDescriptor(Inputs.INPUT, “Fast Input”, Enums.BarInput.CLOSE));

    ma1.addRow(new MAMethodDescriptor(Inputs.METHOD, “Fast Method”, Enums.MAMethod.EMA));

    ma1.addRow(new IntegerDescriptor(Inputs.PERIOD, “Fast Period”, 10, 1, 9999, 1));

    // Slow MA (shorter period)

    SettingGroup ma2=new SettingGroup(“Slow MA”);

    tab.addGroup(ma2);

    ma2.addRow(new InputDescriptor(Inputs.INPUT2, “Slow Input”, Enums.BarInput.CLOSE));

    ma2.addRow(new MAMethodDescriptor(Inputs.METHOD2, “Slow Method”, Enums.MAMethod.EMA));

    ma2.addRow(new IntegerDescriptor(Inputs.PERIOD2, “Slow Period”, 20, 1, 9999, 1));

    tab=new SettingTab(“Display”);

    sd.addTab(tab);

    SettingGroup lines=new SettingGroup(“Lines”);

    tab.addGroup(lines);

    lines.addRow(new PathDescriptor(Inputs.PATH, “Fast MA”, defaults.getGreenLine(), 1.0f, null, true, false, false));

    lines.addRow(new PathDescriptor(Inputs.PATH2, “Slow MA”, defaults.getBlueLine(), 1.0f, null, true, false, false));

    SettingGroup markers=new SettingGroup(“Markers”);

    tab.addGroup(markers);

    markers.addRow(new MarkerDescriptor(Inputs.UP_MARKER, “Up Marker”, Enums.MarkerType.TRIANGLE, Enums.Size.SMALL, defaults.getGreen(), defaults.getLineColor(), true, true));

    markers.addRow(new MarkerDescriptor(Inputs.DOWN_MARKER, “Down Marker”, Enums.MarkerType.TRIANGLE, Enums.Size.SMALL, defaults.getRed(), defaults.getLineColor(), true, true));

    // Runtime Settings

    RuntimeDescriptor desc=new RuntimeDescriptor();

    setRuntimeDescriptor(desc);

    desc.setLabelSettings(Inputs.INPUT, Inputs.METHOD, Inputs.PERIOD, Inputs.INPUT2, Inputs.METHOD2, Inputs.PERIOD2);

    desc.exportValue(new ValueDescriptor(Values.FAST_MA, “Fast MA”, new String[] { Inputs.INPUT, Inputs.METHOD, Inputs.PERIOD }));

    desc.exportValue(new ValueDescriptor(Values.SLOW_MA, “Slow MA”, new String[] { Inputs.INPUT2, Inputs.METHOD2, Inputs.PERIOD2 }));

    desc.exportValue(new ValueDescriptor(Signals.CROSS_ABOVE, Enums.ValueType.BOOLEAN, “Cross Above”, null));

    desc.exportValue(new ValueDescriptor(Signals.CROSS_BELOW, Enums.ValueType.BOOLEAN, “Cross Below”, null));

    desc.declarePath(Values.FAST_MA, Inputs.PATH);

    desc.declarePath(Values.SLOW_MA, Inputs.PATH2);

    // Signals

    desc.declareSignal(Signals.CROSS_ABOVE, “Fast MA Cross Above”);

    desc.declareSignal(Signals.CROSS_BELOW, “Fast MA Cross Below”);

    desc.setRangeKeys(Values.FAST_MA, Values.SLOW_MA);

  }

  @Override

  protected void calculate(int index, DataContext ctx)

  {

    int fastPeriod=getSettings().getInteger(Inputs.PERIOD);

    int slowPeriod=getSettings().getInteger(Inputs.PERIOD2);

    if (index < Math.max(fastPeriod, slowPeriod)) return; // not enough data

    DataSeries series=ctx.getDataSeries();

    // Calculate and store the fast and slow MAs

    Double fastMA=series.ma(getSettings().getMAMethod(Inputs.METHOD), index, fastPeriod, getSettings().getInput(Inputs.INPUT));

    Double slowMA=series.ma(getSettings().getMAMethod(Inputs.METHOD2), index, slowPeriod, getSettings().getInput(Inputs.INPUT2));

    if (fastMA == null || slowMA == null) return;

    series.setDouble(index, Values.FAST_MA, fastMA);

    series.setDouble(index, Values.SLOW_MA, slowMA);

    if (!series.isBarComplete(index)) return;

    // Check to see if a cross occurred and raise signal.

    Coordinate c=new Coordinate(series.getStartTime(index), slowMA);

    if (crossedAbove(series, index, Values.FAST_MA, Values.SLOW_MA)) {

      MarkerInfo marker=getSettings().getMarker(Inputs.UP_MARKER);

      if (marker.isEnabled()) addFigure(new Marker(c, Enums.Position.BOTTOM, marker));

      ctx.signal(index, Signals.CROSS_ABOVE, “Fast MA Crossed Above!”, series.getClose(index));

    }

    else if (crossedBelow(series, index, Values.FAST_MA, Values.SLOW_MA)) {

      MarkerInfo marker=getSettings().getMarker(Inputs.DOWN_MARKER);

      if (marker.isEnabled()) addFigure(new Marker(c, Enums.Position.TOP, marker));

      ctx.signal(index, Signals.CROSS_BELOW, “Fast MA Crossed Below!”, series.getClose(index));

    }

    series.setComplete(index);

  }

}

 

 

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Python becoming the world’s most popular coding language

It seems even the influential Economist magazine claims that Python is the most popular programming language. Here is the headline:

Python is becoming the world’s most popular coding language

Here are some highlights:

In the past 12 months Americans have searched for Python on Google more often than for Kim Kardashian, a reality-TV star. The number of queries has trebled since 2010, while those for other major programming languages have been flat or declining. 

are its simplicity and flexibility…

This versatility means that the Central Intelligence Agency has used it for hacking, Google for crawling webpages,….

Some of the most popular packages harness “machine learning”, by crunching large quantities of data to pick out patterns that would otherwise be imperceptible.

rendering all other competitors obsolete…

Here is that article:

https://www.economist.com/graphic-detail/2018/07/26/python-is-becoming-the-worlds-most-popular-coding-language

Do I really need to continue stress this point about taking the above offer. Either that comes down to the last 48 hours to decide.

Thanks

Bryan

 

New course!! Building Python algo trading system with Bitcoin an crypto currency focus

 

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Let’s start coding the entire forex trading strategy in Dukascopy Jforex Java today

Let’s start coding the entire forex trading strategy in Dukascopy Jforex Java today

I will be combining all the items I have talked about over the last few weeks.

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

What I’ve learned after coding HFT Low Latency Systems

As you know, I have been studying high-frequency trading for a very long time. I even read one article where one person invested $10,000 into thousand five and got a return of over $1 billion in the last year. This is all due to HFT. I will not lie to you that this is complicated programming but is very beneficial for anyone interested. Just always think of Renaissance Technology as the lead influence. I posted a variety of CppCon videos that are beneficial for those interested within my Facebook programming group.

 

There is one article found on LinkedIn

 

There’s another article with those helpful videos

 

As I reported earlier, I found ways to get the most volatile currency pairs for Algo/Automated trading. Could you imagine if you were able to weight all the potential positions for optimal return? Would it not be great if you could measure expected average return or even expected trading ratios? This would be great to set up your next trading session. With the magic of quant, I found a Python script that enables you to do this on a very frequent intraday level. If you ask me, you could set up all your trading positions with weighting and potential sizing all trading sessions in an automated way.

 

Let me show you the benefits of this through this video

 

Imagine if I was to able to walk you through the source code, it would be a huge benefit as part of your automated trading tools. Very few retail traders ever think of these important steps which keep you not only in the game but also optimizes your trading potential.

 

As another benefit for all my Quant Analytics members, I will be providing this exclusive ‘sneak peek’ of the source code in Python. It will only be up for 24 hours in the next few days. Keep your eyes peeled for that as this will be the only time I’ll ever show this. Again, this will be part of my secret sauce tools that I plan to use when I launch my live automated trading. Once again, I will never ever show this ever again to nobody.

 

If you’re serious about your automated trading, you will not want to miss out on this exclusive video preview.

 

I will be also offering a one time live ‘question and answer’ session live this Monday Oct 23 at 7pm. This will not be recorded either and again will only be available for all my Quant Analytics members. As a result, there will be no playback for this as it is purely for questions you may have after this video shows up early in the week.

 

These are two private events that I plan to hold for my members who take their trading very seriously. If this all works out, I would even say could change your life as it could with mine.

 

How many more times do I have to tell you you may want to join this exclusive Quant Analytic membership.

 

Here are all the benefits

 

Join now for immediate benefit

 

From my Quant Analytic Lite members, here is the latest news that I posted.

 

You can also register here for my daily analysis for free

 

Thanks for reading

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

What I’ve learned after coding HFT and Low Latency Systems

What I’ve learned after coding HFT and Low Latency Systems

This is an older article I posted but I find it critical for success in this area

https://www.linkedin.com/pulse/what-ive-learned-after-coding-hft-low-latency-systems-ariel/

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Python do it yourself coding vs 3rd party trading platforms

Python do it yourself coding vs 3rd party trading platforms like Multicharts

Questions from someone via my help desk:

Here is the exact question which is found here 

Hope all is well. I am at a crossroads right now when it comes to choosing a platform, and coding the proper language for some strategies.  Im not interested in wasting too much time, for now. I do have interest down in the road when my time frees up to go through libraries of videos. I have accounts at Interacrive Brokers, and was planning on using Multicharts to execute trades to IB but have come across the open source you were posting about with tradelink. Does this seem like the route to be taking? Coding language for tradelink? I read about guys bashing people for not wanting to pay the $1500/lifetime but for what Ive paid for a lot of programming to get done Id be penny pinching these days just like anyone else and asking questions. Hindsight is 20/20 and I dont want to waste much more time and or money. Im looking to just begin trading and trying to open up avenues for business grow when that happens. Thanks for the time.

Python do it yourself coding vs 3rd party trading platforms like Multicharts
This is only execlusive through my new broadcast email which you can access here

Mobile friendly sign up (corrected)

Introducing my New entry level Quant Analytics Lite version

This is only execlusive through my new broadcast email which you can access here

Mobile friendly sign up (corrected)

Check out my the details payment URLs here 

This will be a limited time offer to get into a grandfatheredmembership if you want to start out watching my automated trading system. As you know, I will be adding many new daily postings which include my portfolio analysis, position handling, price action, asset watchlist which will be part of my full analytics service. 

If you are interested in this new introductory entry level membership, please get it here

Buy Now via Paypal
I am also testing out a newer payment merchant called Stripe. Would you be interested in paying that way?
NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Python do it yourself coding vs 3rd party trading platforms like Multicharts

Python do it yourself coding vs 3rd party trading platforms like Multicharts

Questions from someone via my help desk:

Hope all is well. I am at a crossroads right now when it comes to choosing a platform, and coding the proper language for some strategies.  Im not interested in wasting too much time, for now. I do have interest down in the road when my time frees up to go through libraries of videos. I have accounts at Interacrive Brokers, and was planning on using Multicharts to execute trades to IB but have come across the open source you were posting about with tradelink. Does this seem like the route to be taking? Coding language for tradelink? I read about guys bashing people for not wanting to pay the $1500/lifetime but for what Ive paid for a lot of programming to get done Id be penny pinching these days just like anyone else and asking questions. Hindsight is 20/20 and I dont want to waste much more time and or money. Im looking to just begin trading and trying to open up avenues for business grow when that happens. Thanks for the time.

Get more info on this Python Algo Course here 

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Algoriz builds a trading algo with no coding required

Algoriz builds your trading algo with no coding required

This is just a lazy way to algo trade. Imagine you have true push button technology that will change your life overnight? Does that exist? Right….for a little while anyhow. You really need to understand the ‘under the hood’ philosophy to trade (so see below). When the market turns, and oh they will, you will be left with a panicked market environment who lose money. Remember those fund days in 2008 when many lost their retirement funds? Glory days indeed but they will be coming back at some point.

Here is that push button technology that will NOT change your life

But I got this as an alternative:

So if you want to learn the foundation and technical skills, you know where to come:

Welcome and Choose A Course Below to Proceed

Here is the main product page to link you the following courses.

Algo Trading Components in Python

High level components for algorithmic trading systems. Source code walk-through and videos included.

Futures Options Strategy Overview

Fundamental analysis for all commodities, metal, financial, and currencies in futures and options asset classes.

Interactive Brokers API Workshop

Interactive Brokers API workshop with C++, Java, and Python demos. Source code included.

Pick one to learn!

Thanks Bryan

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Software coding bootcamp will get NOT you a job

Software coding bootcamp will get NOT you a job

There are so many suckers who think they are expert

Coding boot camps are everywhere these days, promising to arm you with the most highly sought skill in the modern economy: computer programming. While many programs charge thousands of dollars for just a few months of instruction, one school, started in Paris by the French billionaire Xavier Niel, offers a three-year curriculum for free. This week Bloomberg Technology’s Sarah McBride and Marie Mawad report on Ecole 42’s newly-opened Silicon Valley branch, which is hoping to repeat the Paris school’s success in training underprivileged youth. But things haven’t quite turned out the way administrators were expecting.

To read the entire article, go to http://bloom.bg/2gyvV7O

 

It was a calamitous job interview two years ago that prompted Jose Contreras to demand his money back from the coding school he attended. His interviewer, the chief technology officer of a startup, watched as Contreras struggled with basics on JavaScript, a coding language he was supposed to be learning during his courses. “Given you can’t answer this question,” Contreras, now 27, recalls the interviewer saying, “You should ask for a refund.” A few months later, jobless and out $14,400 in tuition and fees, Contreras followed his advice.

To read the entire article, go to http://bloom.bg/2g4Vj3W

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Java or C++: Which is better for speed coding?

bry,

C++ or Java: Which is better for speed coding?

Sometimes I send out programming tips which will help automated traders maximize their potential. One of the big takeaways recently is the amount of data that is constantly being processed. For instance, my central bank analysis set of drivers total over 25 different data sources. This is just one type of analysis that I used to help gauge market direction in my upcoming automated trading system. In this video below, you will see a high-speed development coding test for both C++ and Java.
Check it out here:

 
This is what my one of my Facebook group members said:

 

even though its fast forwarded, the proficiency is mind blowning

 

C++ Linux programming tricks

 
As we move into lower latency requirements for accessing multiple data sets in parallel, you’ll quickly realize how advanced programming will be needed to maintain your trading edge. It will no longer be about understanding scripting/interpreted languages like Python or R anymore. Sholom B was kind enough to send over a book about programming tricks in C++ and Linux.

Check that out here

I really hope this helps you out and getting a solid understanding of the importance of programming skills in the new era of modern trading over the next generation.
Thanks for reading

Bryan

P.S. I just posted the webinar Meetup on Sholom B’s favourite set of quant finance and trading books here

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!