Course on the MotiveWave's Java language

HalTrader

Active member
Joined
May 26, 2022
Posts
34
Likes
11
Hello,

I wonder whether it is possible for the MotiveWave team to find a competent programmer who could create an SDK course material for MotiveWave’s Java language. Ideally, the course could cover the following topics:

Regarding the algo trading, there are tons of course materials on Python, MetaTrader 4/5, and other platforms, but there seems to be nothing on MotiveWave's Java language.

- Introduction
- Variables
- Datatypes (Integer, Strings, Boolean, Enumerations, etc.)
- Operators
- Conditional loops (If else, for loop, switch, do while, break, continue, etc.)
- Functions
- Classes
- How to code custom indicators (moving averages and others)
- How to combine different indicators
- How to create an algorithmic trading system (market or limit buy/sell, pending buy/sell, SL, TP, breakeven, Trailing TP, pyramiding, martingale etc)


I do not have many programming skills and am not a big fan of algorithmic trading. Still, it is always helpful to combine different indicators and create alerts based on the combination of custom indicators that are either available on MotiveWave or user-provided. That makes trading less time-consuming and more user-friendly.

Thank you
 

sragone

Active member
Joined
May 23, 2019
Posts
38
Likes
25
I'm going through a Java course on Udemy right now that will cover the first seven of your requests:

The course covers up to Java 17.

I should be able to work with the SDK when I'm done and I've already got an MW project in mind that I'm going to develop.
 

HalTrader

Active member
Joined
May 26, 2022
Posts
34
Likes
11
Thanks. I also took a similar Java course on Udemy, but I guess the most important thing is to better use MotiveWave's built-in functions efficiently. For example, crossover/crossunder of different moving averages (buy/sell alerts, plotshapes or plots), how to code HH-HL-LH-LL (call the previous higher high), auto-Fibonacci tools, volume (order flow, others, etc.), and each of this in multi timeframe, combined with a risk/reward ratio (for example, 1/2.5), place a SL place on the below or above the previous LL/LH or HH/HL, pyramiding, partial take profit, trailing, breakeven, limit the daily drawdown to a certain level etc.

I am capable of doing some of these on TradingView, and I am looking forward to do that on MotiveWave as well, hopefully if there is an online Udemy course for MotiveWave, specifically. That would be incredibly helpful.
 

designer01

Member
Joined
Aug 19, 2019
Posts
12
Likes
6
A course on MW Java implementation would be great. I have taken a couple of private lessons on it with Daniel Sining. I mentioned to him back then it would be a great Idea if he makes a recording of lessons on the subject and post them up. He would if he had enough people interested on it. Please contact him if you are interested.

ds@tradingindicators.com
 

xtrremel

Member
Joined
Mar 12, 2021
Posts
7
Likes
5
This would be great!!! I'm no programmer, but I'm able to create my own indicators and strategies in Tradingview and TradeStation just following the education that they have available.
 

designer01

Member
Joined
Aug 19, 2019
Posts
12
Likes
6
Usually he charges per hour, not sure what his rates are like now, that was a few years ago. Please contact and ask him.
If you are not familiar with Java programming I would start with the UdeMy courses mentioned above. Also this is a great course...

 
Last edited:

q0paz

Active member
Joined
Aug 19, 2020
Posts
27
Likes
7
Hello,

I wonder whether it is possible for the MotiveWave team to find a competent programmer who could create an SDK course material for MotiveWave’s Java language. Ideally, the course could cover the following topics:

Regarding the algo trading, there are tons of course materials on Python, MetaTrader 4/5, and other platforms, but there seems to be nothing on MotiveWave's Java language.

- Introduction
- Variables
- Datatypes (Integer, Strings, Boolean, Enumerations, etc.)
- Operators
- Conditional loops (If else, for loop, switch, do while, break, continue, etc.)
- Functions
- Classes
- How to code custom indicators (moving averages and others)
- How to combine different indicators
- How to create an algorithmic trading system (market or limit buy/sell, pending buy/sell, SL, TP, breakeven, Trailing TP, pyramiding, martingale etc)


I do not have many programming skills and am not a big fan of algorithmic trading. Still, it is always helpful to combine different indicators and create alerts based on the combination of custom indicators that are either available on MotiveWave or user-provided. That makes trading less time-consuming and more user-friendly.

Thank you
If you can program MQL5 you can program MotiveWave. MQL5 is totally a subset of C++.
From any other language all you find yourself doing is $"how do you do {xyz} in java".

The MW API is another matter altogether, because that's "does the API allow me to do {xyz}", or "I just want to get {xyz} effect. What code from the API do I need to set to get this to happen".
 

HalTrader

Active member
Joined
May 26, 2022
Posts
34
Likes
11
Thanks. Yes, I purchased a couple of MQL5 courses on Udemy and am trying to learn as much as possible. Right now, I am able to code very simple indicators on MT5 such as buy or sell RSI or Stochastic overbought/oversold when it is above or below EMA50, EMA100, then manage the trade with trailing SL, breakeven, etc.

The only issue is that the Java interface is quite different than that of C++, but I also purchased another Udemy course to learn the Java language, which would take a certain time before acquiring enough knowledge.

After all, I hope that we can have a similar online course for the MotiveWave’s Java language. It would be much easier if a programmer can explain MotiveWave’s built-in functions, how and where to use that by giving examples on different price action setups, at least RSI, EMAs in MTF, trade management etc. Then the only thing you need to do is to adapt it based on your own strategy.
 

q0paz

Active member
Joined
Aug 19, 2020
Posts
27
Likes
7
Thanks. Yes, I purchased a couple of MQL5 courses on Udemy and am trying to learn as much as possible. Right now, I am able to code very simple indicators on MT5 such as buy or sell RSI or Stochastic overbought/oversold when it is above or below EMA50, EMA100, then manage the trade with trailing SL, breakeven, etc.

The only issue is that the Java interface is quite different than that of C++, but I also purchased another Udemy course to learn the Java language, which would take a certain time before acquiring enough knowledge.

After all, I hope that we can have a similar online course for the MotiveWave’s Java language. It would be much easier if a programmer can explain MotiveWave’s built-in functions, how and where to use that by giving examples on different price action setups, at least RSI, EMAs in MTF, trade management etc. Then the only thing you need to do is to adapt it based on your own strategy coming from C# and Visual Studio, a lot of details related to compiling and importing third party libraries are more complicated in Java.
For straightforward coding of strategies/studies etc, I found MQL5 easier. The development process is basically : write code => hit compile => run code. So it's easier to write simple stuff. For MotiveWave, it's more involved. Java has so many options for e.g. IDE and compilation process options, like ANT build- Maven-Gradle, that getting over that initial hump was quite a learning curve. I came from C# and Visual Studio, which is in the 'write code hit compile' bracket. I'm using IntelliJ which is nowhere near as good as Visual Studio and it's a new environment to learn, but now I've got the whole development process figured out and can pull in libraries from external repositories using Maven and then commit my code to github I'd say MotiveWave has some advantages. Using java you can interface with the universe of computing resources, from external databases and all sorts of other stuff, and whereas you could do this in MetaQuotes too, getting outside the MQ sandbox and doing anything multi-threaded or asynchronous, while doable, was a bit more tricky. The only downside now is Java as a language is so dated </flamewar>, coming from all the great stuff in C# I find it painful to write. Next step is to figure out if it's possible and or how to write code for MotiveWave in Kotlin.
 

Shtick Hustler

Well-known member
Joined
Oct 15, 2020
Posts
106
Likes
46
I'm using IntelliJ which is nowhere near as good as Visual Studio and it's a new environment to learn, but now I've got the whole development process figured out and can pull in libraries from external repositories using Maven and then commit my code to github
I concur with q0paz; Intellij Idea with gradle build tool is what I use. It's a bear to setup, but once set, makes dev really easy.

Next step is to figure out if it's possible and or how to write code for MotiveWave in Kotlin.
It is, and I have, and I highly reccomend it. I don't think you can do everything in Kotlin (need a main page in .java to setup your studies and strategies), but once you've got that set, virtually all your indicators, calculations, strategy logic can be done in Kotlin.

Kotlin is much less verbose than java; very concise and easy to work with. And you'll want to apply some simple functional programming concepts to map/sort/filter data collections, making these tasks a breeze.

Kotlin is the new Java ;)
 

Shtick Hustler

Well-known member
Joined
Oct 15, 2020
Posts
106
Likes
46
Here's a quick tutorial.

It uses your Ant targets as-is. I may post an update to write native gradle code to do the same tasks.
May also add section to enable Kotlin code (which is trivially simple).

Let me know how it works :unsure:
 

Attachments

  • Motivewave Studies, Eclipse-Ant to Idea-Gradle.pdf
    1.3 MB · Views: 78
Last edited:

xerol

Active member
Joined
Apr 6, 2022
Posts
28
Likes
7
Here's a quick tutorial.

It uses your Ant targets as-is. I may post an update to write native gradle code to do the same tasks.
May also add section to enable Kotlin code (which is trivially simple).

Let me know how it works :unsure:
That is great! Thank you very much! Please let us know if you have a working ANT replacement 🙏
 

xerol

Active member
Joined
Apr 6, 2022
Posts
28
Likes
7
It works like a charm and also much faster than the standard Eclipse?! :D Not sure if this is only subjective...

Do you maybe know how I can include external libraries that are added via build.gradle so that they also work during/after the build? I am guessing that I have to change some settings in the ANT build.xml file but I am not sure what exactly :unsure:

I have added some grpc libs under dependencies in the build.gradle file and it's downloading them without any problems. When I import these libraries in my custom studies then IntelliJ resolves them also nicely. But when I try to build the study I get the error that the package does not exist.

F.e.
Code:
error: package io.grpc does not exist
import io.grpc.Server;

Any ideas on how to fix that?
 

Shtick Hustler

Well-known member
Joined
Oct 15, 2020
Posts
106
Likes
46
Code:
error: package io.grpc does not exist
import io.grpc.Server;
Any ideas on how to fix that?

Haven't used it. Saw a tutorial where they added three packages:

dependencies { ... implementation group: 'io.grpc', name: 'grpc-protobuf', version: '1.56.0' implementation group: 'io.grpc', name: 'grpc-stub', version: '1.56.0' implementation group: 'io.grpc', name: 'grpc-netty', version: '1.56.0' }

Are you doing something like this?
You can try googling for grpc tutorials using Idea + gradle and see if you can integrate that into your project 🤷‍♂️
 

xerol

Active member
Joined
Apr 6, 2022
Posts
28
Likes
7
Yes exactly, I added those dependencies and they are working great in IntelliJ. I can import the libraries in my java files and they are resolving without a problem. The error occur when I try to deploy my java files. That is why I assume that I have to somehow add the "global" gradle libs path to the ANT build.xml file so that they are recognized during the build process 🤷‍♂️

And it is not only related to grpc libraries, I have also tried other libraries and they are also making problems :unsure:
 

xerol

Active member
Joined
Apr 6, 2022
Posts
28
Likes
7
Ok, I can confirm... I need to manually download all the jar files and the dependencies into the "lib" folder so that the deploy process finishes without an error. There needs to be some setting so that it would work with Gradle... :unsure:

But I still get an error when adding the compiled indicator to the chart, but this is not related to IntelliJ as I also had the error prior switching to Gradle.

I will probably post it in a separate post:
Code:
18:28:05 SEVERE Unable to load class: study_examples.greetingexample.GreetingServiceGrpc$GreetingServiceStub error: io/grpc/stub/AbstractAsyncStub
18:28:05 SEVERE Unable to load class: study_examples.greetingexample.GreetingServiceOuterClass$HelloRequestOrBuilder error: com/google/protobuf/MessageOrBuilder
18:28:05 SEVERE Unable to load class: study_examples.greetingexample.GreetingServiceImpl error: io/grpc/BindableService
18:28:05 SEVERE Unable to load class: study_examples.greetingexample.GreetingServiceOuterClass$HelloResponse error: com/google/protobuf/MessageOrBuilder
18:28:05 SEVERE Unable to load class: study_examples.greetingexample.GreetingServiceGrpc$1 error: io/grpc/stub/AbstractStub$StubFactory
18:28:05 SEVERE Unable to load class: study_examples.greetingexample.GreetingServiceGrpc$GreetingServiceFileDescriptorSupplier error: io/grpc/protobuf/ProtoFileDescriptorSupplier
18:28:05 SEVERE Unable to load class: study_examples.greetingexample.GreetingServiceGrpc$MethodHandlers error: io/grpc/stub/ServerCalls$UnaryMethod
18:28:05 SEVERE Unable to load class: study_examples.greetingexample.GreetingServiceGrpc$3 error: io/grpc/stub/AbstractStub$StubFactory
18:28:05 SEVERE Unable to load class: study_examples.greetingexample.GreetingServiceGrpc$GreetingServiceMethodDescriptorSupplier error: io/grpc/protobuf/ProtoMethodDescriptorSupplier
18:28:05 SEVERE Unable to load class: study_examples.greetingexample.GreetingServiceGrpc$GreetingServiceImplBase error: io/grpc/BindableService
18:28:05 SEVERE Unable to load class: study_examples.greetingexample.GreetingServiceGrpc$GreetingServiceBlockingStub error: io/grpc/stub/AbstractBlockingStub
18:28:05 SEVERE Unable to load class: study_examples.greetingexample.GreetingServiceOuterClass$HelloResponse$Builder error: com/google/protobuf/MessageOrBuilder
18:28:05 SEVERE Unable to load class: study_examples.greetingexample.GreetingServiceOuterClass$HelloRequest error: com/google/protobuf/MessageOrBuilder
18:28:05 SEVERE Unable to load class: study_examples.greetingexample.GreetingServiceGrpc$2 error: io/grpc/stub/AbstractStub$StubFactory
18:28:05 SEVERE Unable to load class: study_examples.greetingexample.GreetingServiceOuterClass$HelloRequest$Builder error: com/google/protobuf/MessageOrBuilder
18:28:05 SEVERE Unable to load class: study_examples.greetingexample.GreetingServiceOuterClass$HelloResponseOrBuilder error: com/google/protobuf/MessageOrBuilder
18:28:05 SEVERE Unable to load class: study_examples.greetingexample.GreetingServiceGrpc$GreetingServiceBaseDescriptorSupplier error: io/grpc/protobuf/ProtoFileDescriptorSupplier
 

Shtick Hustler

Well-known member
Joined
Oct 15, 2020
Posts
106
Likes
46
I'm a little rusty on libs and Java builds, but I think the problem here is that we're not building a complete Java app, but just java classes that plug into an existing app.

So, though you are able to compile with the libs accessible to Idea, the libs aren't embedded in the ouput. The solution, I think, is to place your needed libs in the MotiveWave Extensions/ext dir, while your studies live in the MotiveWave Extensions/dev dir.

I have a gradle task that can auto deploy these external libs, and will post it here at some point.
 
Top