Fractalated Bob

EA's inspired by nanningbob's work here, especially those based on his 240 Moving Average trend detection filter.
Post Reply
jlcgarcia

Fractalated Bob

Post by jlcgarcia »

Hi,

for those of you who want to use the RiskPercent as the way to calculate the lot size, perhaps this modification will be useful:

Code: Select all

double CalculateLotSize(double price1, double price2)
{
   //Calculate the lot size by risk. Code kindly supplied by jmw1970. Nice one jmw.
   
//   if (price1 == 0 || price2 == 0) return(Lot);//Just in case
   
   double FreeMargin = AccountFreeMargin();
//   double TickValue = MarketInfo(Symbol(),MODE_TICKVALUE) ;
//   double LotStep = MarketInfo(Symbol(),MODE_LOTSTEP);


//   double SLPts = MathAbs(price1 - price2);
//   SLPts/= Point;//No idea why *= factor does not work here, but it doesn't
   
//   double Exposure = SLPts * TickValue; // Exposure based on 1 full lot

//   double AllowedExposure = (FreeMargin * RiskPercent) / 100;
   
//   int TotalSteps = ((AllowedExposure / Exposure) / LotStep);
//   double LotSize = TotalSteps * LotStep;


   double lotstep = MarketInfo(Symbol(), MODE_LOTSTEP);
   int lotPrecision;
   if (lotstep >= 1) lotPrecision = 0;
   else if (lotstep >= 0.1) lotPrecision = 1;
   else if (lotstep >= 0.01) lotPrecision = 2;
   else lotPrecision = 3;
   
   double LotSize = NormalizeDouble(FreeMargin / 10000 * RiskPercent, lotPrecision);
   

   double MinLots = MarketInfo(Symbol(), MODE_MINLOT);
   double MaxLots = MarketInfo(Symbol(), MODE_MAXLOT);
   
   if (LotSize < MinLots) LotSize = MinLots;
   if (LotSize > MaxLots) LotSize = MaxLots;
   return(LotSize);

}//double CalculateLotSize(double price1, double price1)

Regards


José Luis
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Fractalated Bob

Post by SteveHopwood »

SpiderX » Mon Sep 22, 2014 12:48 am wrote:Hi,

Would just like to mention...if you are looking at this...you would need to consider that the signal candle is 2 candles AFTER the last fractal of the sequence.
My recommendation is to set the pending based on this candle at either the high or the low with a bit of filter, or even at the next 00 level.
Currently, i have a modified version of Fbob running with pending and expiry set as 1 hour.
Will see what happens.

Cheers
Great, spi. Yhanks. I will do nothing until you come to some conclusions.

:xm:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Fractalated Bob

Post by SteveHopwood »

jlcgarcia » Mon Sep 22, 2014 5:52 am wrote:Hi,

for those of you who want to use the RiskPercent as the way to calculate the lot size, perhaps this modification will be useful:

Code: Select all

double CalculateLotSize(double price1, double price2)
{
   //Calculate the lot size by risk. Code kindly supplied by jmw1970. Nice one jmw.
   
//   if (price1 == 0 || price2 == 0) return(Lot);//Just in case
   
   double FreeMargin = AccountFreeMargin();
//   double TickValue = MarketInfo(Symbol(),MODE_TICKVALUE) ;
//   double LotStep = MarketInfo(Symbol(),MODE_LOTSTEP);


//   double SLPts = MathAbs(price1 - price2);
//   SLPts/= Point;//No idea why *= factor does not work here, but it doesn't
   
//   double Exposure = SLPts * TickValue; // Exposure based on 1 full lot

//   double AllowedExposure = (FreeMargin * RiskPercent) / 100;
   
//   int TotalSteps = ((AllowedExposure / Exposure) / LotStep);
//   double LotSize = TotalSteps * LotStep;


   double lotstep = MarketInfo(Symbol(), MODE_LOTSTEP);
   int lotPrecision;
   if (lotstep >= 1) lotPrecision = 0;
   else if (lotstep >= 0.1) lotPrecision = 1;
   else if (lotstep >= 0.01) lotPrecision = 2;
   else lotPrecision = 3;
   
   double LotSize = NormalizeDouble(FreeMargin / 10000 * RiskPercent, lotPrecision);
   

   double MinLots = MarketInfo(Symbol(), MODE_MINLOT);
   double MaxLots = MarketInfo(Symbol(), MODE_MAXLOT);
   
   if (LotSize < MinLots) LotSize = MinLots;
   if (LotSize > MaxLots) LotSize = MaxLots;
   return(LotSize);

}//double CalculateLotSize(double price1, double price1)

Regards


José Luis
Many thanks José Luis - much appreciated. Much clearer than the original. I shall include this in the next update. Nothing for non-coders to bother about here guys - you will not notice any difference.

:xm:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
AnotherBrian

Fractalated Bob

Post by AnotherBrian »

jlcgarcia » Mon Sep 22, 2014 12:52 am wrote:Hi,

for those of you who want to use the RiskPercent as the way to calculate the lot size, perhaps this modification will be useful:

Code: Select all

double CalculateLotSize(double price1, double price2)
{
   //Calculate the lot size by risk. Code kindly supplied by jmw1970. Nice one jmw.
   
//   if (price1 == 0 || price2 == 0) return(Lot);//Just in case
   
   double FreeMargin = AccountFreeMargin();
//   double TickValue = MarketInfo(Symbol(),MODE_TICKVALUE) ;
//   double LotStep = MarketInfo(Symbol(),MODE_LOTSTEP);


//   double SLPts = MathAbs(price1 - price2);
//   SLPts/= Point;//No idea why *= factor does not work here, but it doesn't
   
//   double Exposure = SLPts * TickValue; // Exposure based on 1 full lot

//   double AllowedExposure = (FreeMargin * RiskPercent) / 100;
   
//   int TotalSteps = ((AllowedExposure / Exposure) / LotStep);
//   double LotSize = TotalSteps * LotStep;


   double lotstep = MarketInfo(Symbol(), MODE_LOTSTEP);
   int lotPrecision;
   if (lotstep >= 1) lotPrecision = 0;
   else if (lotstep >= 0.1) lotPrecision = 1;
   else if (lotstep >= 0.01) lotPrecision = 2;
   else lotPrecision = 3;
   
   double LotSize = NormalizeDouble(FreeMargin / 10000 * RiskPercent, lotPrecision);
   

   double MinLots = MarketInfo(Symbol(), MODE_MINLOT);
   double MaxLots = MarketInfo(Symbol(), MODE_MAXLOT);
   
   if (LotSize < MinLots) LotSize = MinLots;
   if (LotSize > MaxLots) LotSize = MaxLots;
   return(LotSize);

}//double CalculateLotSize(double price1, double price1)

Regards


José Luis
The formulas doesn't use "tickvalue" (it's commented out), so does that mean we will get the same lot size for all pairs, which means some will actually carry more (or Less) risk than intended?
vadlapatis

Fractalated Bob

Post by vadlapatis »

Hi all

after long time im back to FX

let try this Stunning BOT

10nq u Steve for fantastic FBOB
User avatar
patmontes
Trader
Posts: 367
Joined: Wed Apr 23, 2014 10:42 pm

Fractalated Bob

Post by patmontes »

I'm also have this running on one pair USDCHF on a very small account trying how much can it make it profit...
The answer? Excellent!!! See my signature :hi:
excalibre30
Trader
Posts: 68
Joined: Sat Mar 08, 2014 7:45 am

Fractalated Bob

Post by excalibre30 »

patmontes » Thu Sep 25, 2014 9:22 pm wrote:I'm also have this running on one pair USDCHF on a very small account trying how much can it make it profit...
The answer? Excellent!!! See my signature :hi:
Hi Pat,

What's the tf of the usdchf pair and setting for profit taking and sl?
User avatar
patmontes
Trader
Posts: 367
Joined: Wed Apr 23, 2014 10:42 pm

Fractalated Bob

Post by patmontes »

excalibre30 » Thu Sep 25, 2014 1:42 pm wrote:
patmontes » Thu Sep 25, 2014 9:22 pm wrote:I'm also have this running on one pair USDCHF on a very small account trying how much can it make it profit...
The answer? Excellent!!! See my signature :hi:
Hi Pat,

What's the tf of the usdchf pair and setting for profit taking and sl?
15min TF 20 pip distance from sma 10/20 pip distance from profit/loss trades. Close at 1.3 cash profit I think.
User avatar
patmontes
Trader
Posts: 367
Joined: Wed Apr 23, 2014 10:42 pm

Fractalated Bob

Post by patmontes »

My JPY pairs crashed... small balance of 300 can't hold much for 7pair trading...good thing it's demo.. and lesson learned in knowing how much can a small account handle. :smile:
User avatar
boldtrader
Trader
Posts: 158
Joined: Fri Jun 29, 2012 10:05 pm
Location: Somewhere in the Northeast Kingdom.

Fractalated Bob

Post by boldtrader »

FB doing well here..

+2.6% in 7 trading days on 26 pairs.

Thank Bob and Steve.
"Make Your 20, Bank Your Money... WFY II"
My Mission: Help families grow income, protect assets, erase debt, and gain financial independence.[/b]
Post Reply

Return to “Thingy Bob EA's”