Highly Adaptable Pivot Strategy

Strategies are published here.

Moderator: admin

Highly Adaptable Pivot Strategy

Postby moomoofx » Thu Feb 20, 2014 9:00 pm

As requested on
viewtopic.php?f=27&t=29596
and
viewtopic.php?f=27&t=60253

A highly flexible Pivot strategy where at each pivot +/- pips you can define a particular action to take place.

HighlyAdaptablePivot.png


The example above shows a simple Sell at R1, Buy at S1, Close at P.

Also has been enhanced to
- Support tick timeframes for execution.
- Has configuration to restrict the number of open positions in each direction to prevent too many positions.

Enjoy.
MooMooFX
Attachments
Highly Adaptable Pivot Strategy.lua
(22.43 KiB) Downloaded 1929 times
User avatar
moomoofx
FXCodeBase: Confirmed User
 
Posts: 193
Joined: Wed Oct 23, 2013 10:26 pm
Location: Okinawa, Japan. http://moomooforex.com

Re: Highly Adaptable Pivot Strategy

Postby moomoofx » Thu Feb 27, 2014 12:55 am

Please note that I have updated the source to address an issue to do with the open CustomID and Position Limit code.

The behavior between backtesting and demo/live accounts is different when it comes to the CustomID parameter which leads to the strategy opening more positions than the Position Limit/Multiple Limit allows.

This is discussed here: viewtopic.php?f=31&t=31552&start=40#p92899

If you do not wish to download the new code, a work-around is to ensure that there is a value in the CustomID parameter as a blank one does not work.

Cheers,
MooMooFX
User avatar
moomoofx
FXCodeBase: Confirmed User
 
Posts: 193
Joined: Wed Oct 23, 2013 10:26 pm
Location: Okinawa, Japan. http://moomooforex.com

Re: Highly Adaptable Pivot Strategy

Postby Paulo C » Tue Mar 04, 2014 6:50 pm

moomoofx wrote:As requested on
viewtopic.php?f=27&t=29596
and
viewtopic.php?f=27&t=60253

A highly flexible Pivot strategy where at each pivot +/- pips you can define a particular action to take place.

The attachment HighlyAdaptablePivot.png is no longer available


The example above shows a simple Sell at R1, Buy at S1, Close at P.

Also has been enhanced to
- Support tick timeframes for execution.
- Has configuration to restrict the number of open positions in each direction to prevent too many positions.

Enjoy.
MooMooFX


Moomoo Hello, I have been doing tests and the program is not working very well, for example, today did not open any position in AUD / JPY, but it is not the first time that really it happens, and not just this pair.
It is possible to ask to make changes to the program?
Paulo C
Attachments
aud jpy.png
Paulo C
 
Posts: 20
Joined: Tue Nov 26, 2013 11:55 pm

Re: Highly Adaptable Pivot Strategy

Postby moomoofx » Wed Mar 05, 2014 5:49 am

Hi,

It's hard to know what to change if I don't know what the problem is. Please send me the configuration you used and I'll try to reproduce on that AUDJPY chart.

Cheers,
MooMooFX
User avatar
moomoofx
FXCodeBase: Confirmed User
 
Posts: 193
Joined: Wed Oct 23, 2013 10:26 pm
Location: Okinawa, Japan. http://moomooforex.com

Re: Highly Adaptable Pivot Strategy

Postby Paulo C » Wed Mar 05, 2014 6:53 pm

moomoofx wrote:Hi,

It's hard to know what to change if I don't know what the problem is. Please send me the configuration you used and I'll try to reproduce on that AUDJPY chart.

Cheers,
MooMooFX


Hi moomoo,
Sorry, I know you are very good, but not divine thoughts ;) . The parameters I am using are as follows: Price: bid; strategy time frame: m5 ; pivot time frame: D1 ; calculation mode: classic pivot; actions: s1buy r1 sell; allow strategy to trade:true; allowed side: both; allow multiple: true; open position limit: 5; trade amount: 10 ; set limit: true (70); set stop: true(70); trailing stop: falso.
Today,without doing anything, and the computer always on, happened to open more positions than it should according to the chart
cheers Paul C
Attachments
aud jpy.png
Paulo C
 
Posts: 20
Joined: Tue Nov 26, 2013 11:55 pm

Re: Highly Adaptable Pivot Strategy

Postby moomoofx » Thu Mar 06, 2014 4:06 am

Hi Paul C,

Thanks for posting the screenshot and your configuration. I'm kind of confused though, you first say it didn't trade, now you are saying it traded too much?

Anyway, I'll try to use my divine thoughts to address everything I think you are trying to say.

"Traded too much"
Please see my post above yours where I updated the code to fix a bug related to Multiple Positions. You need to basically specify a value into the CustomID parameter.

"Open more positions than it should according to the chart"
Assume this problem isn't caused by the "traded too much" issue above, then the only other thing I can imagine is you are disputing if the signal was generated correctly. So, the question is, was the pivot value crossed when the trade signal was generated?

If you switch on History mode for the Pivot indicator so it draws lines through that date, you'll see that the trades occur exactly at the R1 level, as per your configuration. Here's a screenshot you can match to your screenshot. So, please tell me if you still think there is an issue.

Pivot2.png


"today did not open any position in AUD / JPY"
I ran the configuration you sent me in your latest post through the backtester and it should have traded early in the day as per this screenshot.

Pivot1.png


So, I'm guessing that since the strategy didn't trade at all, the Allow Trading was off perhaps? Otherwise, I noticed your screenshot is actually in m15 timeframe, not the m5 you sent me in the latest response, which leads me to believe perhaps the strategy was using a different config, so again, this is hard for me to debug. Obviously timing is a factor too, if you turned the strategy on AFTER the price has crossed the appropriate level...

Regardless, I'm not sure what the problem was, but I assume you fixed it since you it was trading in your next post.

Hope this helps.

Cheers,
MooMooFX
User avatar
moomoofx
FXCodeBase: Confirmed User
 
Posts: 193
Joined: Wed Oct 23, 2013 10:26 pm
Location: Okinawa, Japan. http://moomooforex.com

Re: Highly Adaptable Pivot Strategy

Postby Paulo C » Thu Mar 06, 2014 9:51 am

Thanks for posting the screenshot and your configuration. I'm kind of confused though, you first say it didn't trade, now you are saying it traded too much?

Anyway, I'll try to use my divine thoughts to address everything I think you are trying to say.

Hi moomoo,
First things first, 1st CustomID already changed the parameter field.
2nd I tried to test the program by changing the pivot frame field team to W1 and not open any position.
3rd'll attach 2 more gbp-jpy gbp-usd charts and where in the first case had 9 open positions and in the second case I have 9 open positions, when it should be at most 5. These situations occurred before changing the parameter customID field.
The time frame i use in the program is the m5, but what use in graphics is usually the m30, m15 or h1, depends, but I think it does not interfere with the program.
My computer is always on and the program too.
It's probably my fault, but I'm just trying to know what I did wrong, sorry.
Cheers Paulo C
Attachments
GBP JPY.png
gbp usd.png
Paulo C
 
Posts: 20
Joined: Tue Nov 26, 2013 11:55 pm

Re: Highly Adaptable Pivot Strategy

Postby moomoofx » Thu Mar 06, 2014 11:11 am

Hey,

No sweat, I want to get to the bottom of this too. Perhaps we need to start from a clean slate.

As I mentioned, the position limit had a bug unless CustomID parameter is specified, so no point discussing this unless the problem happened after that.

Other than that, what is the problem again?

Cheers,
MooMooFX
User avatar
moomoofx
FXCodeBase: Confirmed User
 
Posts: 193
Joined: Wed Oct 23, 2013 10:26 pm
Location: Okinawa, Japan. http://moomooforex.com

Re: Highly Adaptable Pivot Strategy

Postby Paulo C » Mon Mar 17, 2014 6:42 pm

Hi MooMoo, I wonder if it's possible a change, like having a limit on daily positions, ie contain a field for a maximum number of open positions, as is already happening, but also have another that limits the maximum number that program opens daily. Example, I want to have a maximum of 20 open positions but I also want the program to only open two new positions daily maximum.
Thanks in advance
Paulo C
Paulo C
 
Posts: 20
Joined: Tue Nov 26, 2013 11:55 pm

Re: Highly Adaptable Pivot Strategy

Postby moomoofx » Tue Mar 18, 2014 1:46 am

Hi Paulo,

That's possible.

Your request has been added to the development list.

Cheers,
MooMooFX
User avatar
moomoofx
FXCodeBase: Confirmed User
 
Posts: 193
Joined: Wed Oct 23, 2013 10:26 pm
Location: Okinawa, Japan. http://moomooforex.com

Next

Return to Custom Strategies

Who is online

Users browsing this forum: No registered users and 19 guests