Macd Stochastic Fractal MA5/25 Daily Marylin
-
phil_trade
Re: Macd Stochastic Fractal MA5/25 Daily Marylin
Patience is the key in forex
after 3 weeks up/down...and some bigs news :
after 3 weeks up/down...and some bigs news :
You do not have the required permissions to view the files attached to this post.
- niepce
- Trader
- Posts: 152
- Joined: Wed Jul 04, 2012 11:00 pm
- Location: Grenoble, France
Re: Macd Stochastic Fractal MA5/25 Daily Marylin
aSushiRoll wrote:
Actually Philippe, first thanks for your wonderful EA. I've read the first few pages of this thread and skimmed trough the last few. This is a link to my Merilynn EA:
https://www.myfxbook.com/portfolio/1-mt ... mon/606234
Up +56% since June 12th DD 11%.
Sushi
Hi Sushi ! I tried to display your myfxbook's, but im getting a "private" error message, can you make it public ?
EDIT, my bad, here's http://www.myfxbook.com/members/Mautje/ ... mon/606234
-
Radar
- Trader
- Posts: 437
- Joined: Fri Mar 23, 2012 5:39 pm
- Location: Round the bend ;)
Re: Macd Stochastic Fractal MA5/25 Daily Marylin
Looking good, Phil 
Regarding the OrderModify errors... I haven't been able to pinpoint what causes them, but by having Marilyn tell me what order number she's trying to modify, I have seen that she eventually succeeds.
It's a pita, but it *is* working.
Have fun!
Radar =8^)
Regarding the OrderModify errors... I haven't been able to pinpoint what causes them, but by having Marilyn tell me what order number she's trying to modify, I have seen that she eventually succeeds.
It's a pita, but it *is* working.
Have fun!
Radar =8^)
Check out my new, (well, old now), manual trade & automatic scale-in manager,
StackManV2
StackManV2
- milanese
- TechAdmin
- Posts: 3293
- Joined: Wed Jan 09, 2013 9:02 am
- Location: btr rdx, r8 +
Re: Macd Stochastic Fractal MA5/25 Daily Marylin
Phil thanks for your update, yes patience is the key in forex trading
wish you all a nice weekend
Cheers,
Tommaso
wish you all a nice weekend
Cheers,
Tommaso
Global Prime is the official SHF broker 
Searching for Servers and Workstations with individual configuration?
Just PM
Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
Searching for Servers and Workstations with individual configuration?
Just PM
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
-
Radar
- Trader
- Posts: 437
- Joined: Fri Mar 23, 2012 5:39 pm
- Location: Round the bend ;)
Re: Macd Stochastic Fractal MA5/25 Daily Marylin
Greets peeps 
Found the cause of the OrderModify errors...
The multiple errors were caused by nested loops... On the first iteration of the outer loop + first iteration of the inner loop, OrderModify is successful, and control is returned to the outer loop... On all successive iterations of the outer and inner loops, we get Error1, (stop values haven't changed). Removing the outer loop fixed the multiple attempts.
To get rid of the multiple errors, change this...
...to this...
Retracements/ranging was the cause of the remaining errors, as StochOBOSToMoveSL would be reached, (along with DeltaPipsMoveSLOnStoch), and out SL is moved to BE (or BEP, if enabled)... If either value dropped below the required values for longs, (above for shorts), then returned, Marilyn would attempt to move the SL to BE or BEP again.
The fix...
Change form this...
...to this...
No more OrderModify errors 
Now I've off to find out why Marilyn is adding trades 50 pips apart when I've asked her to add them 16 pips apart...
Have fun!
Radar =8^)
Found the cause of the OrderModify errors...
The multiple errors were caused by nested loops... On the first iteration of the outer loop + first iteration of the inner loop, OrderModify is successful, and control is returned to the outer loop... On all successive iterations of the outer and inner loops, we get Error1, (stop values haven't changed). Removing the outer loop fixed the multiple attempts.
To get rid of the multiple errors, change this...
Code: Select all
void ModifyOrder(int ticket, double stop, double take)
{
//Modifies an order already sent if the crim is ECN.
if (stop == 0 && take == 0) return; //nothing to do
if (!OrderSelect(ticket, SELECT_BY_TICKET) ) return;//Trade does not exist, so no mod needed
//RetryCount is declared as 10 in the Trading variables section at the top of this file
for (int cc = 0; cc < RetryCount; cc++)
{
for (int d = 0; (d < RetryCount) && IsTradeContextBusy(); d++) Sleep(100);
if (take > 0 && stop > 0)
{
while(IsTradeContextBusy()) Sleep(100);
if (OrderModify(ticket, OrderOpenPrice(), stop, take, OrderExpiration(), CLR_NONE))
{
Alert("Modify Order Succeeded !");
Print("Modify Order Succeeded !");
return;
}
}//if (take > 0 && stop > 0)
if (take != 0 && stop == 0)
{
while(IsTradeContextBusy()) Sleep(100);
if (OrderModify(ticket, OrderOpenPrice(), OrderStopLoss(), take, OrderExpiration(), CLR_NONE))
{
Alert("Modify Order Succeeded !");
Print("Modify Order Succeeded !");
return;
}
}//if (take == 0 && stop != 0)
if (take == 0 && stop != 0)
{
while(IsTradeContextBusy()) Sleep(100);
if (OrderModify(ticket, OrderOpenPrice(), stop, OrderTakeProfit(), OrderExpiration(), CLR_NONE))
{
Alert("Modify Order Succeeded !");
Print("Modify Order Succeeded !");
return;
}
}//if (take == 0 && stop != 0)
}//for (int cc = 0; cc < RetryCount; cc++)
//Got this far, so the order modify failed
int err=GetLastError();
Print(Symbol(), " SL/TP order modify failed with error(",err,"): ",ErrorDescription(err));
Alert(Symbol(), " SL/TP order modify failed with error(",err,"): ",ErrorDescription(err));
}//void ModifyOrder(int ticket, double tp, double sl)
Code: Select all
void ModifyOrder(int ticket, double stop, double take)
{
//Modifies an order already sent if the crim is ECN.
if (stop == 0 && take == 0) return; //nothing to do
if (!OrderSelect(ticket, SELECT_BY_TICKET) ) return;//Trade does not exist, so no mod needed
//RetryCount is declared as 10 in the Trading variables section at the top of this file
for (int d = 0; (d < RetryCount) && IsTradeContextBusy(); d++) Sleep(100);
{
if (take > 0 && stop > 0)
{
while(IsTradeContextBusy()) Sleep(100);
if (OrderModify(ticket, OrderOpenPrice(), stop, take, OrderExpiration(), CLR_NONE))
{
Alert("Modify Order Succeeded !");
Print("Modify Order Succeeded !");
return;
}
}//if (take > 0 && stop > 0)
if (take != 0 && stop == 0)
{
while(IsTradeContextBusy()) Sleep(100);
if (OrderModify(ticket, OrderOpenPrice(), OrderStopLoss(), take, OrderExpiration(), CLR_NONE))
{
Alert("Modify Order Succeeded !");
Print("Modify Order Succeeded !");
return;
}
}//if (take == 0 && stop != 0)
if (take == 0 && stop != 0)
{
while(IsTradeContextBusy()) Sleep(100);
if (OrderModify(ticket, OrderOpenPrice(), stop, OrderTakeProfit(), OrderExpiration(), CLR_NONE))
{
Alert("Modify Order Succeeded !");
Print("Modify Order Succeeded !");
return;
}
}//if (take == 0 && stop != 0)
}//for (int d = 0; (d < RetryCount) && IsTradeContextBusy(); d++)
//Got this far, so the order modify failed
int err=GetLastError();
if (err > 0)
Print(OrderTicket()," ",Symbol(), " SL/TP order modify failed with error(",err,"): ",ErrorDescription(err));
Alert(OrderTicket()," ",Symbol(), " SL/TP order modify failed with error(",err,"): ",ErrorDescription(err));
}//void ModifyOrder(int ticket, double tp, double sl)
Retracements/ranging was the cause of the remaining errors, as StochOBOSToMoveSL would be reached, (along with DeltaPipsMoveSLOnStoch), and out SL is moved to BE (or BEP, if enabled)... If either value dropped below the required values for longs, (above for shorts), then returned, Marilyn would attempt to move the SL to BE or BEP again.
The fix...
Change form this...
Code: Select all
if((NewSL-Bid)>(DeltaPipsMoveSLOnStoch*Point))
{
NewSL=ReturnLowOpenPrice(strSymbol,MagicNumber,OrderTicket());
if( ((NewSL<OrderStopLoss())||(OrderStopLoss()<(1*Point))) && (NewSL!=9999) && (NewSL > Bid + (10*multiplier*Point)) )
{
//OrderModify(OrderTicket(),OrderOpenPrice(),NewSL,OrderTakeProfit(),0,CLR_NONE);
Alert("MoveSLOnStoch :Attempting to move SL of ",strSymbol," to ",NewSL);
Print("MoveSLOnStoch :Attempting to move SL of ",strSymbol," to ",NewSL);
ModifyOrder(OrderTicket(),NewSL,0);
}
}
Code: Select all
if((NewSL-Ask)>(DeltaPipsMoveSLOnStoch*Point))
{
if ((NormalizeDouble(OrderStopLoss(), Digits) != NormalizeDouble(NewSL, Digits))) // <== Added This
if( ((NewSL<OrderStopLoss())||(OrderStopLoss()<(1*Point))) && (NewSL!=9999) && (NewSL > Ask + (10*multiplier*Point)) )
{
//OrderModify(OrderTicket(),OrderOpenPrice(),NewSL,OrderTakeProfit(),0,CLR_NONE);
Alert("MoveSLOnStoch :Attempting to move SL of ",OrderTicket()," ",strSymbol," from ",OrderStopLoss()," to ",NewSL);
Print("MoveSLOnStoch :Attempting to move SL of ",OrderTicket()," ",strSymbol," from ",OrderStopLoss()," to ",NewSL);
ModifyOrder(OrderTicket(),NewSL,0);
}
}
Now I've off to find out why Marilyn is adding trades 50 pips apart when I've asked her to add them 16 pips apart...
Have fun!
Radar =8^)
Last edited by Radar on Sat Aug 03, 2013 9:01 am, edited 1 time in total.
Check out my new, (well, old now), manual trade & automatic scale-in manager,
StackManV2
StackManV2
-
AGT
- Trader
- Posts: 889
- Joined: Thu Nov 17, 2011 7:20 pm
- Location: Germany
Re: Macd Stochastic Fractal MA5/25 Daily Marylin
Hi Radar ! Bcz a lot of members here aren't coders: could you plz add the fixed version here in mq4 form ?
Thanks a lot !
Thanks a lot !
AGT's EA portfolio: http://www.stevehopwoodforex.com/phpBB3 ... =36&t=1374
-
phil_trade
Re: Macd Stochastic Fractal MA5/25 Daily Marylin
Hi allAGT wrote:Hi Radar ! Bcz a lot of members here aren't coders: could you plz add the fixed version here in mq4 form ?
Thanks a lot !
Could job Radar !
but, It will be safer that Niepce, who know well the strategy, look before at this modification (cut a loop), to ensure it's always good for Marilyn.
Philippe
-
Radar
- Trader
- Posts: 437
- Joined: Fri Mar 23, 2012 5:39 pm
- Location: Round the bend ;)
Re: Macd Stochastic Fractal MA5/25 Daily Marylin
Hey AGT,
I just hunt and peck, copy/paste/edit 
Any changes I make I'll post in here so that proper coders can ensure that I haven't broken any trade/management logic
Have fun!
Radar =8^)
I'm not really a coder myselfAGT wrote:Hi Radar ! Bcz a lot of members here aren't coders: could you plz add the fixed version here in mq4 form ?
Thanks a lot !
Any changes I make I'll post in here so that proper coders can ensure that I haven't broken any trade/management logic
Have fun!
Radar =8^)
Check out my new, (well, old now), manual trade & automatic scale-in manager,
StackManV2
StackManV2
-
Radar
- Trader
- Posts: 437
- Joined: Fri Mar 23, 2012 5:39 pm
- Location: Round the bend ;)
Re: Macd Stochastic Fractal MA5/25 Daily Marylin
Hey Phil,
It's brain-picking time...
For scale-in trades... Do you wait for another signal to scale-in, or do you just use price-action?
I'm thinking that if you have DeltaPipsInterMacdToClose = DistanceInterTrade = (DeltaPipsMoveSLOnStoch minus a few pips), you can add trades every DistanceInterTrade pips, regardless of the current Stoch, MACD, etc... I think it would only work if you were using RelativeStoch, and had UnprotectedTrades set to 1, though.
I'm going to attempt to break the code down into smaller modules, so that it will be easier for me to add bits to test without breaking the overall logic.
Have fun!
Radar =8^)
It's brain-picking time...
For scale-in trades... Do you wait for another signal to scale-in, or do you just use price-action?
I'm thinking that if you have DeltaPipsInterMacdToClose = DistanceInterTrade = (DeltaPipsMoveSLOnStoch minus a few pips), you can add trades every DistanceInterTrade pips, regardless of the current Stoch, MACD, etc... I think it would only work if you were using RelativeStoch, and had UnprotectedTrades set to 1, though.
I'm going to attempt to break the code down into smaller modules, so that it will be easier for me to add bits to test without breaking the overall logic.
Have fun!
Radar =8^)
Check out my new, (well, old now), manual trade & automatic scale-in manager,
StackManV2
StackManV2
- milanese
- TechAdmin
- Posts: 3293
- Joined: Wed Jan 09, 2013 9:02 am
- Location: btr rdx, r8 +
Re: Macd Stochastic Fractal MA5/25 Daily Marylin
Hi Radar,
finally you got it
nice work..
wish you a nice weekend
Cheers,
Tommaso
finally you got it
wish you a nice weekend
Cheers,
Tommaso
Global Prime is the official SHF broker 
Searching for Servers and Workstations with individual configuration?
Just PM
Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
Searching for Servers and Workstations with individual configuration?
Just PM
NOTE: Cookies and JavaScript are required for the using the board, with full functionality