Peaky

The place for Peaky and Peaky-related stuff.
Post Reply
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.

Peaky

Post by SteveHopwood »

V 1i is in post 1.

Zool pointed out this bug here http://www.stevehopwoodforex.com/phpBB3 ... 37#p154237

My quick and easy fix merely shifted the problem further down the line, so that >1 trades that should have the same take profit had instead my 100 pip tp individually.

This is a classic case of LUC calling for coffee. For those of you not around from the start of my career as a coder, LUC stands for the Law of Unintended Consequences i.e. a change in the code here necessitates a change there, which in turn demands a change there............

LUC threw some epic benders at my place in the early years and I recoded entire EA's rather than keep on doling out massive amounts of food and drink to LUC and all his friends and relatives, and their friends and relatives..........................

In a strange sort of a way, it is pleasant to know that he is still lurking in the background waiting to catch me out. :lol:

DIYers, undo the change you made a few hours ago (as in my post following Zool's). Zool pointed me in the right direction but did not quite have the full solution, so copy this over the top of the existing function:

Code: Select all

void CheckPricesAreStillValid()
{

   //Examine pending trades and adjust the price if the peak has moved by 1 pip or more.
   if (!BetterOrderSelect(LatestTradeTicketNo, SELECT_BY_TICKET, MODE_TRADES) )
      return;
   
   double price = 0, newPrice = 0;
   bool modify = false;
   double take = 0, stop = 0;
   
   
   //A buy stop will be above the lowest trade line
   if (OrderType() == OP_BUYSTOP)
   {
       price = ObjectGet(plTradeLineName, OBJPROP_PRICE1);
       if (OrderOpenPrice() - price > (1 / factor) )
       {
         modify = true;
         newPrice = price + (PendingTradeBuffer / factor);
         stop = CalculateStopLoss(OP_BUY, newPrice);
         take = CalculateTakeProfit(OP_BUY, newPrice);
       }//if (OrderOpenPrice() - price > (1 / factor) )
   }//if (OrderType() == OP_BUYSTOP)
         
   //A sell stop will be below the highest trade line
   if (OrderType() == OP_SELLSTOP)
   {
       price = ObjectGet(phTradeLineName, OBJPROP_PRICE1);
       if (price - OrderOpenPrice() > (1 / factor) )
       {
         modify = true;
         newPrice = price - (PendingTradeBuffer / factor);
         stop = CalculateStopLoss(OP_SELL, newPrice);
         take = CalculateTakeProfit(OP_SELL, newPrice);
       }//if (OrderOpenPrice() - price > (1 / factor) )
   }//if (OrderType() == OP_SELLSTOP)
         
   if (!modify)
      return;
      
   bool result = ModifyOrder(OrderTicket(), newPrice, stop, take, OrderExpiration(), clrNONE, __FUNCTION__, oop);
   
}//void CheckPricesAreStillValid()
As I trade this, my stop loss is always zero. I am not sure if attempting to update an existing OrderStopLoss() of zero with a zero value will produce an error. It just needs a few extra lines of code if so. We shall see.

Great to see lots of people getting in on the entertainment. A quick warning though. A couple of you have come close to getting into trouble by asking questions that showed clearly that you could not be arsed to read the user guide. That makes you a dimwit in my eyes.

I have been known to take a robust approach to dimwits. You were lucky today that I was in a good mood. The sun was shining. Do not count on this lasting indefinitely. It does rain from time to time here in the UK, so hard as I try not to, I do have the occasional slightly grumpy mood.

In doubt about whether you should ask your question? Stay quiet.

: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.

Peaky

Post by SteveHopwood »

DigitalCrypto » Mon Jun 19, 2017 8:11 pm wrote:Bang up job Steve. I'm still scratching my head on this EA cause it just works. :clap:

I had a question regarding alerts. Would it be a good idea to put the symbol name right behind the order ticket? I ask because it seems like it would be easier to see the alert ticket number and symbol then head straight to the chart with this type of EA where many charts/orders can be open.

If it's a terrible idea just say so. You know what you're doing.

Best,
David

P.S. This is a demo account so it's NOT a report that anything is out of the ordinary.
I only read this after posting my previous. It is one of those I-must-do-this-sometime, so I added it to 1i and just reuploaded.

It is no biggy folks but redownload if you want it and downloaded 1i before reading this post.

Easy DIY:

Code: Select all

void ReportError(string function, string message)
{
   //All purpose sl mod error reporter. Called when a sl mod fails
   
   int err=GetLastError();
   if (err == 1) return;//That bloody 'error but no error' report is a nuisance
   
      
   Alert(WindowExpertName(), " ", OrderTicket(), " ", Symbol(), " ", function, message, err,": ",ErrorDescription(err));
   Print(WindowExpertName(), " ", OrderTicket(), " ", Symbol(), " ", function, message, err,": ",ErrorDescription(err));
   
}//void ReportError()
: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
Dexonite
Trader
Posts: 18
Joined: Wed Sep 28, 2016 12:52 am
Location: South Africa

Peaky

Post by Dexonite »

Thanks Steve, been nervously checking in all day :D . Behaviour didn't match the manual hence the confusion about the tp's and basket close.

Happy testing/trading/evening all :good:
I'm as busy as a cat...
burying its poo...
on concrete...
User avatar
TraderJoeForex
Trader
Posts: 1157
Joined: Fri Mar 08, 2013 10:29 pm
Location: South London

Peaky

Post by TraderJoeForex »

Such awesome work going on in this thread...

Just to chip in with a slightly different approach and Inspired by some positive results last week testing HGBnDnSSnFB with ALR (here http://www.stevehopwoodforex.com/phpBB3 ... 2&start=10) I am also now testing Peaky with ALR (instead of using FollowAdverseMarketWithStoporders). I'll let you know how I get on :smile:
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.

Peaky

Post by SteveHopwood »

TraderJoeForex » Mon Jun 19, 2017 11:02 pm wrote:Such awesome work going on in this thread...

Just to chip in with a slightly different approach and Inspired by some positive results last week testing HGBnDnSSnFB with ALR (here http://www.stevehopwoodforex.com/phpBB3 ... 2&start=10) I am also now testing Peaky with ALR (instead of using FollowAdverseMarketWithStoporders). I'll let you know how I get on :smile:
Ok, but please stay quiet unless you have something concrete to offer that is clearly better than Peaky already offers. I am not interested in idle speculation and, "What if......"

I remind folks here that Peaky did not arise from my fevered imagination. Bugs apart, she is an accurate representation of how I have been trading manually, live and successfully since being introduced to DFC last January. Granted my method developed over time, but anybody expecting anything else is an idiot.

Any one else here thinks you can do better? Open a thread and prove it.
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.
Geges
Trader
Posts: 60
Joined: Thu Dec 15, 2011 5:33 pm

Peaky

Post by Geges »

:clap: :clap: :clap: :clap: :clap: :clap: :clap:
Ezzy
Trader
Posts: 35
Joined: Mon Aug 05, 2013 9:15 am

Peaky

Post by Ezzy »

Don't have much of a contribution here Steve, but that doesn't mean I am not grateful.

Many thanks Steve, Peaky is has been going great for me for the last 5-6 weeks.

I am considering going live into the new financial year.

Cheers
Ezzy
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.

Peaky

Post by SteveHopwood »

Ezzy » Tue Jun 20, 2017 9:20 am wrote:Don't have much of a contribution here Steve, but that doesn't mean I am not grateful.

Many thanks Steve, Peaky is has been going great for me for the last 5-6 weeks This has filled and is in profit so far.

I am considering going live into the new financial year.

Cheers
Ezzy
Enjoy yourself when you do.

-----------------------------

Peaky took over my manual trades seamlessly apart from mucking up some of the take profits. The latest fixes appear to have cured that.

She sent three of her own trades since I loaded her up on Saturday night:
  • UCad buy stop after the market moved the requisite 100 pips against the my manual buy.
  • A ChfJpy short.
  • A NzdJpy short. I made a bomb on the way up, albeit that it took a long time, so let's hope for some more green on the way down.
: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.
mcbusrider
Trader
Posts: 23
Joined: Sun Mar 15, 2015 4:37 pm

Peaky

Post by mcbusrider »

Thanks Steve, great system and exemplary coding :hi: .

Peaky running on demo with DFC Dashboard since start of last Asian session, OOTB except for 15 Min timeframe. WOW!!! Green pips all the way since LO with the exception of that bitch EN, who is late to the party :!!:

Won't be long before I'm live on this. Well done!
Berndt
Posts: 1
Joined: Wed Jun 14, 2017 2:15 pm

Peaky

Post by Berndt »

Hi guys.

First a very big thanks to Steve. I think this is it. :yahoo:

After some testing i took cad/jpy and Eu/cad live m15.



Steve, may i ask you a question? If the situation happens that there is massive drawdown with no signs of turning. Do you close the trade for loss, or let it run for ever hoping in future it will reach at last BE?


Thanks again!
Post Reply

Return to “Peaky forum”