Automation of Strategy for Unfinished Auction at high/low of bar like MACrossStrategy

ananthula

Member
Joined
Jan 19, 2025
Posts
5
Likes
0
Hi Everyone,

I would like to see a strategy for unfinished auction at high and low the bar(Automate of Strategy). I have a code but it not working because the SDK doesn't have few functions. Please help guys.

The strategy that would like to open a position(trade lots) at unfinished auction at low for long entry with stop loss and trail the stop loss and same for unfinished auction at high for short entry with stop loss and trail the stop loss.

Below I have attached 2 codes. Please check.

Issues:

I have also seen the current code for unfinished auction is taking the trades at each bar even though there is a finished auction. Why would I need that ? I only need the unfinished auction at high and low of the bar and traded according to that using the strategy

The errors you are encountering are due to the methods getAskVolume and getBidVolume not being available on the DataSeries class in the MotiveWave SDK. It seems like these methods do not exist or are not exposed directly for accessing bid/ask volume for a given index.

You can still perform volume-based checks in MotiveWave, but the SDK does not directly provide bid and ask volume per bar through the DataSeries class.

Since bid and ask volume are not directly accessible in the way I suggested,
I would like to access bid/ask volumes. I would like to to use you can use the getAskVolume() and getBidVolume() methods for each bar in the DataSeries.

I would like to also trade Imbalance strategy and it is not working as well. Atttached the code


Errors:

Buildfile: /Users/saikiranananthula/eclipse/MotiveWave_Studies_example/MotiveWave Studies/build/build.xml
clean:
[delete] Deleting directory /Users/saikiranananthula/eclipse/MotiveWave_Studies_example/MotiveWave Studies/build/classes
compile:
[mkdir] Created dir: /Users/saikiranananthula/eclipse/MotiveWave_Studies_example/MotiveWave Studies/build/classes
[javac] Compiling 12 source files to /Users/saikiranananthula/eclipse/MotiveWave_Studies_example/MotiveWave Studies/build/classes
[javac] /Users/saikiranananthula/eclipse/MotiveWave_Studies_example/MotiveWave Studies/src/study_examples/VolumeImbalanceStrategy.java:9: error: cannot find symbol
[javac] import com.motivewave.platform.sdk.common.MAMethod; // Correct import for MAMethod
[javac] ^
[javac] symbol: class MAMethod
[javac] location: package com.motivewave.platform.sdk.common
[javac] /Users/saikiranananthula/eclipse/MotiveWave_Studies_example/MotiveWave Studies/src/study_examples/VolumeImbalanceStrategy.java:57: error: cannot find symbol
[javac] double avgVolume = series.ma(MAMethod.SMA, index, period, Enums.BarInput.VOLUME); // Correct usage of MAMethod
[javac] ^
[javac] symbol: variable MAMethod
[javac] location: class VolumeImbalanceStrategy
[javac] /Users/saikiranananthula/eclipse/MotiveWave_Studies_example/MotiveWave Studies/src/study_examples/VolumeImbalanceStrategy.java:83: error: cannot find symbol
[javac] double avgVolume = series.ma(MAMethod.SMA, ind, getSettings().getInteger(PERIOD), Enums.BarInput.VOLUME);
[javac] ^
[javac] symbol: variable MAMethod
[javac] location: class VolumeImbalanceStrategy
[javac] 3 errors

BUILD FAILED
/Users/saikiranananthula/eclipse/MotiveWave_Studies_example/MotiveWave Studies/build/build.xml:46: Compile failed; see the compiler error output for details.

Total time: 669 milliseconds


Instead I take the trade manually when I see it, rather I can build a strategy around it to buy and sell.

All I need is to automate it like MA cross strategy and now I need unfinished auction strategy - wrote a code but some issues with dataseries libraries.
 

Attachments

  • Archive.zip
    Archive.zip
    6.8 KB · Views: 13
  • image.png
    image.png
    161.2 KB · Views: 32
Let me guess - you asked LLM to write the code and it generated the code with some imagined methods?
I might be wrong, but looks like you need to use Instrument.getTicks to build your own footprint for the bar and go from there.
Why would you want to go short if there is an unfinished auction at the high (and vice versa) to begin with?
 
Vlad, thank you for the response and your correct, I am not a java programmer and I have used LLM models to write this program. Can you please help to resolve the issue. Do you know where I can get the motivewave's SDK with all existing libraries to start going through it and develop more strategies.
As part of the strategy in one of my core strategy, these are magnets in a nutshell and exit at previous unfinished auction. I can also enter if this happens in my strategy as another confluence.
 
Let me guess - you asked LLM to write the code and it generated the code with some imagined methods?
I might be wrong, but looks like you need to use Instrument.getTicks to build your own footprint for the bar and go from there.
Why would you want to go short if there is an unfinished auction at the high (and vice versa) to begin with?
@Vlad @MrSharky Do you have code for VolumeImprint Study, I would like to build the strategy around it. I could not find the code for that. Need some libraries.
 
Top