(NEW) Introduce dMACD strategy (Divergence on MACD Signals)

Strategies are published here.

Moderator: admin

Re: Introduce dMACD strategy (Divergence on MACD Signals)

Postby vigird » Thu Sep 30, 2010 4:28 pm

Another position in the opposite direction won't close the current one if you have hedging enabled on your account.
vigird
 
Posts: 1
Joined: Thu Sep 30, 2010 4:25 pm

Re: Introduce dMACD strategy (Divergence on MACD Signals)

Postby Konstantin.Usanov » Fri Oct 01, 2010 3:31 am

Robin, you may also turn off the “Risk management” by switch the “Is need to perform risks management?” parameter to “No”. In this case only “true market order” will be created for opening a position at any currently available market rate.
This switching off will lead to open only one position at time as you desire.
Best regards,
Konstantin.
Konstantin.Usanov
FXCodeBase: Confirmed User
 
Posts: 47
Joined: Mon Aug 30, 2010 3:02 am
Location: Siberia, Omsk

Re: Introduce dMACD strategy (Divergence on MACD Signals)

Postby jdariux » Mon Oct 25, 2010 3:02 pm

Frist of all congratulate all the staff here in fxcodebase.com for your extraordinary work and the magnificent service you provide to all of us, really this team is amazing.
I would like to ask for a little change in this strategy adding the possibility to configure stop loss, Trailing Stop and take profit in the configuration panel. I was trying to do it by myself but it didn’t work well, I guess programming is not my strong, even though the change is not significant and not difficult to do it.
THANK YOU VERY MUCH FOR ALL YOUR HARD WORK.
JDARIUX
jdariux
 
Posts: 3
Joined: Mon Oct 25, 2010 2:30 pm

Re: Introduce dMACD strategy (Divergence on MACD Signals)

Postby jdariux » Mon Oct 25, 2010 3:29 pm

And also if you can add the step that before opening a trade should check if the margin is below X % of the account (configurable in the panel). If this condition is correct (Low margin) the position should not open. I guess is to introduce the latest signal of margin alert from Nikolai viewtopic.php?f=31&t=2442 in this strategy (but again I don’t know how to do it). I was thinking in that the other day and now you have the signal, what are the odds? You are the best!!!!.
regards
Jdariux
jdariux
 
Posts: 3
Joined: Mon Oct 25, 2010 2:30 pm

Re: Introduce dMACD strategy (Divergence on MACD Signals)

Postby Konstantin.Usanov » Tue Oct 26, 2010 7:08 am

Thanks a lot!

Please take a look at draft of new version of dMACD strategy.
dMACDext.lua
dMACD strategy (extended edition)
(10.43 KiB) Downloaded 1085 times

dMACDext_properties.JPG
dMACDext properties

Note, this extended edition is not requiring additional .RC file.
I hope all your desires are fulfilled. In any case, feel free to contact me.

Thanks.
Best regards,
Konstantin.
Konstantin.Usanov
FXCodeBase: Confirmed User
 
Posts: 47
Joined: Mon Aug 30, 2010 3:02 am
Location: Siberia, Omsk

Re: Introduce dMACD strategy (Divergence on MACD Signals)

Postby jdariux » Tue Oct 26, 2010 1:00 pm

Thank you Konstantin I will test it but it looks even better than I thought.
jdariux
 
Posts: 3
Joined: Mon Oct 25, 2010 2:30 pm

Re: Introduce dMACD strategy (Divergence on MACD Signals)

Postby Konstantin.Usanov » Thu Oct 28, 2010 2:37 am

I’d like to share improved version of dMACDext strategy.
dMACDext.lua
dMACD strategy (improved version)
(11.07 KiB) Downloaded 1143 times

The new parameter "Is need to perform strict care?" has been added to "Profit/Loss care" group.
new dMACDext properties.JPG
new dMACDext properties

If "Is need to perform strict care?" = YES then trade position will not opened when locking or limiting actions have been happen (it means that current value for Gross P/L of account overcomes established limits, "Max Profit" and "Min Loss" parameters), see lines 245…248:
Code: Select all
   local GrossPL = account.GrossPL;
   if GrossPL > instance.parameters.profit or GrossPL < instance.parameters.loss then
      return;
   end


If "Is need to perform strict care?" = NO then trade position will opened and later, if current value (recalculated automatically after open position) for Gross P/L of account overcomes established limits ("Max Profit" and "Min Loss" parameters) then True market close order will be created, see lines 279…283:
Code: Select all
   local GrossPL = account.GrossPL;
   if GrossPL > instance.parameters.profit or GrossPL < instance.parameters.loss then
     valuemap.OrderType = "CM"; -- True market close order closes a position…    
     terminal:execute(id, valuemap);
   end

Thanks.
Best regards,
Konstantin.
Konstantin.Usanov
FXCodeBase: Confirmed User
 
Posts: 47
Joined: Mon Aug 30, 2010 3:02 am
Location: Siberia, Omsk

Re: Introduce dMACD strategy (Divergence on MACD Signals)

Postby Konstantin.Usanov » Wed Nov 03, 2010 2:36 am

Hi!

I’d like to introduce modified version of dMACDext strategy.
(Thanks a lot to Jdariux for review and additional ideas!)

Changes:

1. True market order + limit order + stop order are create at once now.
(previous version created True market order at first and then tried (with some issues that was fixed) to create limit + stop orders via opened position)

2. Reports error (if happen) while orders are create.

3. Strict care for P/L is permanent now.
(without “strict” previous version was not profitable)

4. Margin care is dedicated now (for handy uses).

5. Limit and Stop values are separated now (for handy uses) with ability to switch off its using.

6. Commented context of parameters for better understanding.

modified dMACDext_properties.JPG
Properties of modified version dMACDext

dMACDext.lua
modified dMACDext strategy
(10.83 KiB) Downloaded 1048 times

Thanks.
Best regards,
Konstantin.
Konstantin.Usanov
FXCodeBase: Confirmed User
 
Posts: 47
Joined: Mon Aug 30, 2010 3:02 am
Location: Siberia, Omsk

Re: Introduce dMACD strategy (Divergence on MACD Signals)

Postby Viriato » Fri Nov 05, 2010 6:45 am

Hi everybody! This is my first post. Excuse me about my poor english!

Konstantin, thanks for all. You and your work is the main reason to writte here! I think your strategy is very good. It's very logic, powerful, has a lot of configurable parameters and promising results.

My problem (and I think it's the same problem for many users) is to optimizate this and other strategies. We have the BACKTEST indicator to simulate the results of our strategies, but we have to change manually the parameters to get results. My idea is to develop a indicator to apply to the dMACD strategy in the moment of maximal zoom out for one timeframe, and this indicator makes iterations with the main parameters of the dMACD strategy (short EMA periods, from 1 to 25; long EMA periods, from 1 to 50; and signal Periods, from 1 to 25, for example), and compare the equity results for these iterations and give us the parameters for the better equity result.

I try to develop a indicator derived from the BACKTEST indicator. I only eliminate the signals code (buys, sells and alerts) and I keep only the equity chart and the report. But my LUA level isn't good and I can't develop the next step.

Konstantin or everybody that reads this: What do you think about it? Do you use another systems to optimizate dMACD? Can everybody help with this work?

Thanks to everybody for your time and sorry for my poor english!

Viriato
Viriato
 
Posts: 2
Joined: Fri Nov 05, 2010 5:45 am

Re: Introduce dMACD strategy (Divergence on MACD Signals)

Postby a0007002 » Sun Nov 07, 2010 10:51 am

I couldn't find any info in the forum on this already so will ask here since it relates to all strategy backtesting. When performing a test of a strategy (dMACD in this case) my equity line never changes from 1,000,000. It is a straight line across from left to right no matter what time frame or how much data I zoom in or out on the chart. How do I get the backtest equity to show profit/loss? I contacted FXCM (micro email support) and they never answered me.
a0007002
 
Posts: 6
Joined: Sun Nov 07, 2010 10:35 am

PreviousNext

Return to Custom Strategies

Who is online

Users browsing this forum: Bing [Bot] and 28 guests