Page 1 of 1

Fractal Gains

PostPosted: Wed Feb 15, 2012 8:58 am
by sho-me-pips
FIFO Compliant

Manual back testing produced over 1000 pips in approx 3 months

~~If D_Oscillator Buff1<Buff2 place sell entry order on low fractal or if D_Oscillator Buff1>Buff2 place buy entry order on high fractal. Stop will be opposing fractal.~~

Code: Select all
function Init() --The strategy profile initialization
strategy:name("Fractal Gain Strategy");
strategy:description("Fractal Gain Strategy ");

strategy.parameters:addGroup("D oscillator parameters");
strategy.parameters:addString("TF", "Time Frame", "", "H4"); --D-Oscillator trend time frame--
strategy.parameters:addInteger("RSI_Period", "RSI_Period", "", 21);
strategy.parameters:addInteger("D_Period", "D_Period", "", 15);
strategy.parameters:addInteger("CCI_Period", "CCI_Period", "", 21);
strategy.parameters:addDouble("CCI_Coeff", "CCI_Coeff", "", 0.4);
strategy.parameters:addInteger("Smooth", "Smooth", "", 20);

strategy.parameters:addGroup("Margin Requirements");
strategy.parameters:addBoolean("UseMargin", "Use Margin To Control Trades", "", true);
strategy.parameters:addInteger("StopMargin", "Percentage to stop adding new trades", "", 90, 1, 100)

strategy.parameters:addGroup("Trading Parameters");
strategy.parameters:addBoolean("AllowTrade", "Allow strategy to trade", "", false);
strategy.parameters:addString("Period", "Chart Time Frame", "", "H2"); --Time frame for trade excution--
strategy.parameters:addString("Account", "Account to trade on", "", "");
strategy.parameters:setFlag("Account", core.FLAG_ACCOUNT);
strategy.parameters:addString("TradeType", "Use Balance or Fixed Lot", "", "Bal");
strategy.parameters:addStringAlternative("TradeType", " FixedLot ", "", "FL");
strategy.parameters:addStringAlternative("TradeType", "Balance", "", "Bal");
strategy.parameters:addInteger("Amount", "Trade Amount in Lots", "", 1, 1, 1000);
strategy.parameters:addInteger("DividedBy", "Amount Of Account To Use", "", 3%, .1%, 50%);
~~Bal Formula =ROUNDDOWN((Balance*DividedBy)/MMR,0,.01))(Example: Balance is $50000.00 you wish to use 5% of balance= $2500.00 divide by MMR of EUR $30.00=83.333 mirco lots rounded down to 83)~~

strategy.parameters:addBoolean("SetLimit", "Set Limit Orders", "", false);
strategy.parameters:addInteger("Limit", "Limit Order in pips", "", 30, 1, 10000);
strategy.parameters:addGroup("Fractal Parameters");
strategy.parameters:addInteger("Frame", "Number of bars for fractals (Odd)", "", 5, 3, 99);
strategy.parameters:addGroup("Stop Parameters");
strategy.parameters:addInteger("Indent", "Indent from fractal", "", 0, 0, 1000);
strategy.parameters:addBoolean("MoveBack", "Move stop back", "", false);
strategy.parameters:addString("Type", "Price type", "", "Auto");
strategy.parameters:addStringAlternative("Type", "Bid", "", "Bid");
strategy.parameters:addStringAlternative("Type", "Ask", "", "Ask");
strategy.parameters:addStringAlternative("Type", "Auto", "", "Auto");~~buy=bid sell=ask~~
strategy.parameters:addString("FPeriod", "Timeframe", "", "m15"); --Fractal time frame--
strategy.parameters:addInteger("Timeout", "How often to check stop (in seconds)", "", 60, 1, 60);--Check for stop; if no stop set stop on fractal--

strategy.parameters:addBoolean("ShowAlert", "Show Alert", "", false);
strategy.parameters:addBoolean("PlaySound", "Play Sound", "", false);
strategy.parameters:addBoolean("RecurSound", "Recurrent Sound", "", false);
strategy.parameters:addString("SoundFile", "Sound File", "", "");
strategy.parameters:setFlag("SoundFile", core.FLAG_SOUND);
strategy.parameters:addBoolean("SendEmail", "Send Email", "", false);
strategy.parameters:addString("Email", "Email", "", "");
strategy.parameters:setFlag("Email", core.FLAG_EMAIL);

Re: Fractal Gains

PostPosted: Thu Feb 16, 2012 2:27 am
by Apprentice
I'm not sure What is the purpose of your post.
The request to write strategy.
Or share your desire with our community.

If first, can you give us a link for D oscillator.

Re: Fractal Gains

PostPosted: Thu Feb 16, 2012 7:12 am
by sho-me-pips

Re: Fractal Gains

PostPosted: Fri Feb 17, 2012 2:54 am
by Apprentice
Your request is added to the development list.

Re: Fractal Gains

PostPosted: Wed May 30, 2012 6:34 pm
by sho-me-pips
Do you have a status on this strategy? How far down the list is this one?

Re: Fractal Gains

PostPosted: Mon Apr 22, 2019 9:46 pm
by Alexander.Gettinger
Please try this strategy:
Fractal Gains Strategy.lua
(13.77 KiB) Downloaded 62 times

Re: Fractal Gains

PostPosted: Fri Sep 13, 2019 5:39 am
by yolerap
Hello Apprentice,

Could you add the option for the fractal gains strategy :

1) Maximum of number open position in any directions
2) Maximum of number open position in one direction
3) Allow side

I don't know what is weird and how the strategy running because when the parameters are adjust :
Account balance : 2000 euros
Lot size : 1K
The benefits are +3600euros

However, when the parameters are adjust like this :
Account balance : 20000euros
Lot size : 1K
The benefits are +500 euros...

There is a big difference while the strategy parameters are the same..

Thank you for your works

Re: Fractal Gains

PostPosted: Fri Sep 13, 2019 6:25 am
by Apprentice
Your request is added to the development list.
Development reference 88.

Re: Fractal Gains

PostPosted: Mon Sep 16, 2019 3:59 am
by Apprentice