Highly adaptable RSI Strategy

Strategies are published here.

Moderator: admin

Re: Highly adaptable RSI Strategy

Postby Apprentice » Fri Jan 03, 2014 3:28 pm

Your request is added to the development list.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 22931
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Highly adaptable RSI Strategy

Postby Paulo C » Fri Jan 03, 2014 7:14 pm

Apprentice wrote:Your request is added to the development list.


Is very important to me, thank you
Paulo C
 
Posts: 20
Joined: Tue Nov 26, 2013 11:55 pm

Re: Highly adaptable RSI Strategy

Postby moomoofx » Tue Jan 14, 2014 9:03 am

Hi everyone,

I have drastically refactored the code for this strategy and...
- Fixed a bug related to the handling of errors
- Fixed a bug such that Trade Alerts are provided even when Trading is disabled (Signal Only Mode)
- Added a parameter to control if trades should close on opposite signal. This functionality already existed but may not be desired so it is configurable. If this parameter is set to false then trades only close if there are levels configured with a CLOSE action.

Additionally, I met all your requests (hooray :o ). Specifically...

Request by bleming: Tue Feb 26, 2013 10:40 pm
> Could you add a "magic number" to this s it doesn't interfere with other strategies and open trades on the same pair.
There is now a "Custom Identifier" parameter that can be used. This ID comes up in the instance name as well.

Request by Nightmare21: Wed Mar 13, 2013 2:02 am
> I want to add also a trailing limit into three portion.
Your requirement can now be met by having multiple instances of the same strategy with different configurations and magic numbers. For example, three instances with...
- One with a Limit of 50, 33% of the Amount, and a unique CustomID.
- One with a Limit of 100, 33% of the Amount, and a unique CustomID.
- One with no Limit, 33% of the Amount, and a unique CustomID.
The rest of the configuration should be the same.

Request by amazon1a: Thu Aug 22, 2013 4:35 am
> Would it be possible to add a seventh pair of lines to the Selector block?
The 7th Level has been added.

> include an option to limit the number of multiple trades to take
There is now a new parameter "Open Position Limit" that can be used to control the number of open positions allowed PER DIRECTION. If this is set to 3, there can be a max of 3 LONG and 3 SHORT positions simultaneously. Set this to zero for unlimited.

Request by pips_r_us: Wed Sep 04, 2013 2:03 pm
> Add a Moving Average filter (e.g 200 MVA). If the price is above this MVA then only BUY side of trades are executed. If the price is below this MVA then only SELL trades are executed.
This has been implemented exactly as described, in addition the method used to calcuate the moving average has been exposed.

> Add a field to limit the multiple trades?
Already covered, as mentioned above.

Request by Paulo C: Thu Jan 02, 2014 2:02 pm
> The strategy is good, but I wonder if it is possible, instead of giving a market order, give an entry order to "X pips that amount"
There is a new parameter which allows you to configure entry orders or market orders. If you choose entry orders, you can specify the number of pips away to place the order and if the order should expire at the end of the day, or never.

.........

Ok that's it. I have done my best to test the functionality to make sure it still works but please let me know as soon as possible if there are any issues.

HighlyAdaptableRSI.png
Screenshot
Attachments
Highly adaptable RSI Strategy.lua
Updated Source
(25.91 KiB) Downloaded 517 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 RSI Strategy

Postby Paulo C » Tue Jan 14, 2014 4:48 pm

Thank you, you are the greatest, the strategy seems to be perfect, I'll try it now :D

moomoofx wrote:Hi everyone,

I have drastically refactored the code for this strategy and...
- Fixed a bug related to the handling of errors
- Fixed a bug such that Trade Alerts are provided even when Trading is disabled (Signal Only Mode)
- Added a parameter to control if trades should close on opposite signal. This functionality already existed but may not be desired so it is configurable. If this parameter is set to false then trades only close if there are levels configured with a CLOSE action.

Additionally, I met all your requests (hooray :o ). Specifically...

Request by bleming: Tue Feb 26, 2013 10:40 pm
> Could you add a "magic number" to this s it doesn't interfere with other strategies and open trades on the same pair.
There is now a "Custom Identifier" parameter that can be used. This ID comes up in the instance name as well.

Request by Nightmare21: Wed Mar 13, 2013 2:02 am
> I want to add also a trailing limit into three portion.
Your requirement can now be met by having multiple instances of the same strategy with different configurations and magic numbers. For example, three instances with...
- One with a Limit of 50, 33% of the Amount, and a unique CustomID.
- One with a Limit of 100, 33% of the Amount, and a unique CustomID.
- One with no Limit, 33% of the Amount, and a unique CustomID.
The rest of the configuration should be the same.

Request by amazon1a: Thu Aug 22, 2013 4:35 am
> Would it be possible to add a seventh pair of lines to the Selector block?
The 7th Level has been added.

> include an option to limit the number of multiple trades to take
There is now a new parameter "Open Position Limit" that can be used to control the number of open positions allowed PER DIRECTION. If this is set to 3, there can be a max of 3 LONG and 3 SHORT positions simultaneously. Set this to zero for unlimited.

Request by pips_r_us: Wed Sep 04, 2013 2:03 pm
> Add a Moving Average filter (e.g 200 MVA). If the price is above this MVA then only BUY side of trades are executed. If the price is below this MVA then only SELL trades are executed.
This has been implemented exactly as described, in addition the method used to calcuate the moving average has been exposed.

> Add a field to limit the multiple trades?
Already covered, as mentioned above.

Request by Paulo C: Thu Jan 02, 2014 2:02 pm
> The strategy is good, but I wonder if it is possible, instead of giving a market order, give an entry order to "X pips that amount"
There is a new parameter which allows you to configure entry orders or market orders. If you choose entry orders, you can specify the number of pips away to place the order and if the order should expire at the end of the day, or never.

.........

Ok that's it. I have done my best to test the functionality to make sure it still works but please let me know as soon as possible if there are any issues.

HighlyAdaptableRSI.png
Paulo C
 
Posts: 20
Joined: Tue Nov 26, 2013 11:55 pm

Re: Highly adaptable RSI Strategy

Postby amazon1a » Wed Jan 15, 2014 7:06 am

Many thanks for these updates. They come at the PERFECT time for me. I will try them out as soon as I return from my trip.

Amazon1a
User avatar
amazon1a
 
Posts: 83
Joined: Wed Oct 05, 2011 10:47 am

Re: Highly adaptable RSI Strategy

Postby Paulo C » Tue Jan 21, 2014 5:25 pm

USDJPY.png

Hello guys, I wonder if it is possible to further modification. One of the situations in which it is lost when the program gives an order to buy or sell through the signal, and the price continues to go up or down as shown. In this sense I wonder if it is possible a kind of "follow the order of entry" such as: USD-JPY price begins to fall at some point the progam gives an entry order (purchase) but the price continues to fall .. is so frustrating and you lose many pips. My idea is USD-JPY price falls and hits the 102, reaches the level of RSI for an entry order 20 pips to 102.20 of that amount. The price continues to drop reaches 101.80 at this point the order of entry is updated to 102.20 to 102, and so on until the order is executed.
I thank you and keep up the good work


moomoofx wrote:Hi everyone,

I have drastically refactored the code for this strategy and...
- Fixed a bug related to the handling of errors
- Fixed a bug such that Trade Alerts are provided even when Trading is disabled (Signal Only Mode)
- Added a parameter to control if trades should close on opposite signal. This functionality already existed but may not be desired so it is configurable. If this parameter is set to false then trades only close if there are levels configured with a CLOSE action.

Additionally, I met all your requests (hooray :o ). Specifically...

Request by bleming: Tue Feb 26, 2013 10:40 pm
> Could you add a "magic number" to this s it doesn't interfere with other strategies and open trades on the same pair.
There is now a "Custom Identifier" parameter that can be used. This ID comes up in the instance name as well.

Request by Nightmare21: Wed Mar 13, 2013 2:02 am
> I want to add also a trailing limit into three portion.
Your requirement can now be met by having multiple instances of the same strategy with different configurations and magic numbers. For example, three instances with...
- One with a Limit of 50, 33% of the Amount, and a unique CustomID.
- One with a Limit of 100, 33% of the Amount, and a unique CustomID.
- One with no Limit, 33% of the Amount, and a unique CustomID.
The rest of the configuration should be the same.

Request by amazon1a: Thu Aug 22, 2013 4:35 am
> Would it be possible to add a seventh pair of lines to the Selector block?
The 7th Level has been added.

> include an option to limit the number of multiple trades to take
There is now a new parameter "Open Position Limit" that can be used to control the number of open positions allowed PER DIRECTION. If this is set to 3, there can be a max of 3 LONG and 3 SHORT positions simultaneously. Set this to zero for unlimited.

Request by pips_r_us: Wed Sep 04, 2013 2:03 pm
> Add a Moving Average filter (e.g 200 MVA). If the price is above this MVA then only BUY side of trades are executed. If the price is below this MVA then only SELL trades are executed.
This has been implemented exactly as described, in addition the method used to calcuate the moving average has been exposed.

> Add a field to limit the multiple trades?
Already covered, as mentioned above.

Request by Paulo C: Thu Jan 02, 2014 2:02 pm
> The strategy is good, but I wonder if it is possible, instead of giving a market order, give an entry order to "X pips that amount"
There is a new parameter which allows you to configure entry orders or market orders. If you choose entry orders, you can specify the number of pips away to place the order and if the order should expire at the end of the day, or never.

.........

Ok that's it. I have done my best to test the functionality to make sure it still works but please let me know as soon as possible if there are any issues.

The attachment USDJPY.png is no longer available
Paulo C
 
Posts: 20
Joined: Tue Nov 26, 2013 11:55 pm

Re: Highly adaptable RSI Strategy

Postby moomoofx » Wed Jan 22, 2014 11:15 pm

Hi,

So, basically I'm seeing a modification such that if it is going to create a new Entry Order strategy, and an existing Entry Order is pending in the same direction, it should
- Cancel that order and issue the new one.
- Or just update the order price of the existing one (if that is possible).

Please confirm that this will probably meet your expectation?

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 RSI Strategy

Postby Paulo C » Thu Jan 23, 2014 12:37 pm

moomoofx wrote:Hi,

So, basically I'm seeing a modification such that if it is going to create a new Entry Order strategy, and an existing Entry Order is pending in the same direction, it should
- Cancel that order and issue the new one.
- Or just update the order price of the existing one (if that is possible).

Please confirm that this will probably meet your expectation?

Cheers,
MooMooFX



Hi MooMooFX,
You got it, or cancel the order and create a new one, or update the entry order
:)
Cheers,
Paulo C
Paulo C
 
Posts: 20
Joined: Tue Nov 26, 2013 11:55 pm

Re: Highly adaptable RSI Strategy

Postby moomoofx » Tue Jan 28, 2014 4:11 am

It turns out this functionality is natively supported by the trading system so an Entry Orders entry price can be "Trailed" in the same way a Stop Order can be.

Therefore there is now a new parameter called "EntryOrdersTrail"

If this value is zero, there is no trailing of the entry order price.
Any other value, specified in pips, trails the entry price of the order when the market moves away from the entry price. If the value is one, then this is "dynamic".

This should meet your requirement as the pending entry orders are automatically updated.

Enjoy. Watch out though, if you set a small EntryOrderTrail value (like 1) they will all trail and sync up. If then the market retraces just enough for them to all enter at the same time then you might find yourself in a bit of trouble.
Attachments
Highly adaptable RSI Strategy.lua
(27.64 KiB) Downloaded 437 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 RSI Strategy

Postby Paulo C » Tue Jan 28, 2014 5:04 am

moomoofx wrote:It turns out this functionality is natively supported by the trading system so an Entry Orders entry price can be "Trailed" in the same way a Stop Order can be.

Therefore there is now a new parameter called "EntryOrdersTrail"

If this value is zero, there is no trailing of the entry order price.
Any other value, specified in pips, trails the entry price of the order when the market moves away from the entry price. If the value is one, then this is "dynamic".

This should meet your requirement as the pending entry orders are automatically updated.

Enjoy. Watch out though, if you set a small EntryOrderTrail value (like 1) they will all trail and sync up. If then the market retraces just enough for them to all enter at the same time then you might find yourself in a bit of trouble.


MooMooFX Thanks, I'll try it now
Paulo C
 
Posts: 20
Joined: Tue Nov 26, 2013 11:55 pm

PreviousNext

Return to Custom Strategies

Who is online

Users browsing this forum: wuhuilin11 and 3 guests