Peaky on Steroids

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 on Steroids

Post by SteveHopwood »

V 1c is in post 1. Never mind how, but Thomas set me looking for the possible cause of some of the invalid stop errors. I did a search for Symbol(), which should normally be replaced by symbol, just as ask replaces Ask, bid replaces Bid and so on.

We can ignore the instances of Symbol() in void CalculateLotAsAmountPerCashDollops(). So far as I know, MODE_LOTSTEP is a platform wide thingy, not pair specific.

I found one that does matter. Line 1924:
result = SendSingleTrade(Symbol(), OP_BUYSTOP, TradeComments[dd], SendLots, price, stop, take, MagicNumbers[dd]);

should be:
result = SendSingleTrade(OrderSymbol(), OP_BUYSTOP, TradeComments[dd], SendLots, price, stop, take, MagicNumbers[dd]);

Also DIYers, copy this from Thomas over the top of the existing void CheckPricesAreStillValid(int cc) function:

Code: Select all

void CheckPricesAreStillValid(int cc)
{

   //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 stop = 0, take = 0;
      
   //A buy stop will be above the lowest trade line
   if (OrderType() == OP_BUYSTOP)
   {
       price = PeakLowTradingLines[cc];
       if (OrderOpenPrice() - price > (1 / factor) )
         if (bid < price + (TradeBuffers[cc] / factor) )
         {
            modify = true;
            newPrice = price + (TradeBuffers[cc] / factor);
            stop = CalculateStopLoss(OP_BUY, newPrice, cc);
            take = CalculateTakeProfit(OP_BUY, newPrice, cc);
         }//if (bid < price + (TradeBuffers[cc] / factor) )
   }//if (OrderType() == OP_BUYSTOP)
         
   //A sell stop will be below the highest trade line
   if (OrderType() == OP_SELLSTOP)
   {
       price = PeakHighTradingLines[cc];
       if (price - OrderOpenPrice() > (1 / factor) )
         if (bid > price - (TradeBuffers[cc] / factor) )
         {
            modify = true;
            newPrice = price - (TradeBuffers[cc] / factor);
            stop = CalculateStopLoss(OP_SELL, newPrice, cc);
            take = CalculateTakeProfit(OP_SELL, newPrice, cc);
         }//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(int cc)
: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 on Steroids

Post by SteveHopwood »

renexxxx » Mon Jun 26, 2017 8:07 pm wrote: As a possible improvement for version 1c (or later), it would be good to include a (timeframe-specific) swap filter: since we expect particularly the longer timeframes to be in a drawdown for an extended period, before the market turns back, we might only want to open trades in their positive swap direction.

But I'm sure this has already been considered.
It is on my horizon along with tf specific lot sizes to help our US friends. From what I have read, FIFO only affects trades with equivalent lot sizes, so a positive swap only filter allied with tf specific lot sizes will make PoS much more available to US traders.

: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 on Steroids

Post by Dexonite »

Might it be that some of the invalid stops are caused by using the sixth as tp. I mean on a smaller time frame the sixths sometimes are really small and if you add buffer pips to that you might already be over the tp sixth line or does it just use the next, I guess that would be the middle, sixth line for tp?
I'm as busy as a cat...
burying its poo...
on concrete...
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 on Steroids

Post by SteveHopwood »

The weirdest thing has happened to V 1c, so I have removed it from post 1.

The OnInit() function has vanished.

To save me reconstructing it by hand, can one of you post it, please?

: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
Zool
Trader
Posts: 50
Joined: Wed May 09, 2012 8:39 pm
Location: Komárom, Hungary

Peaky on Steroids

Post by Zool »

SteveHopwood » Mon Jun 26, 2017 11:07 pm wrote:The weirdest thing has happened to V 1c, so I have removed it from post 1.

The OnInit() function has vanished.

To save me reconstructing it by hand, can one of you post it, please?

:xm:
Here you go:

Code: Select all

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
{

   //User message
   Comment("                              INITIALISING. PLEASE WAIT.");
   
   //Set up the doubles variables that replace the unser integer inputs
   Trade1TakeProfit = Trade1TakeProfitPips;
   Trade1StopLoss = Trade1StopLossPips;
   Trade1Buffer = Trade1BufferPips;
   Trade2TakeProfit = Trade2TakeProfitPips;
   Trade2StopLoss = Trade2StopLossPips;
   Trade2Buffer = Trade2BufferPips;
   Trade3TakeProfit = Trade3TakeProfitPips;
   Trade3StopLoss = Trade3StopLossPips;
   Trade3Buffer = Trade3BufferPips;
   Trade4TakeProfit = Trade4TakeProfitPips;
   Trade4StopLoss = Trade4StopLossPips;
   Trade4Buffer = Trade4BufferPips;   
   MarketDistance = MarketDistancePips;
   
   
   
//--- create timer
   EventSetTimer(EventTimerIntervalSeconds);
   
   //Extract the pairs traded by the user
   ExtractPairs();
   //Populate all the arrays
   PopulateTheArrays();

   Gap="";
   if (DisplayGapSize > 0)
      StringInit(Gap, DisplayGapSize, ' ');
   
//---
   return(INIT_SUCCEEDED);
}
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 on Steroids

Post by SteveHopwood »

This is really weird. Scrolling down through the code to replace Zool's OnInit I came across this:
int OnInit(), with all the code in place but masked by the red dot.

And that dot really is red.

Not even the merest beginnings of the slightest hint of the opening gambit of a clue what happened there.

1c is back in post 1. You do not need it if your V1c is running fine - must have been something strange happening on my machine.

Probably the more criminally inclined of the crims trying to derail us. :lol:

: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
tomele
Administrator
Posts: 1208
Joined: Tue May 17, 2016 3:40 pm
Location: Germany, Forest of Odes, Defending the Limes

Peaky on Steroids

Post by tomele »

SteveHopwood » 26 Jun 2017, 23:21 wrote:This is really weird. Scrolling down through the code to replace Zool's OnInit I came across this:
int OnInit(), with all the code in place but masked by the red dot.

And that dot really is red.

Not even the merest beginnings of the slightest hint of the opening gambit of a clue what happened there.

1c is back in post 1. You do not need it if your V1c is running fine - must have been something strange happening on my machine.

Probably the more criminally inclined of the crims trying to derail us. :lol:

:xm:
OnInit() still not working. No EA feedback on the screen. Delete this red dot in the source code like a character and it works.

Cheers
Happy pippin, Thomas :-BD

It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so.
(Mark Twain)

Keep the coder going: Donate
User avatar
goodo
Trader
Posts: 38
Joined: Thu Mar 23, 2017 10:31 pm

Peaky on Steroids

Post by goodo »

tomele » Mon Jun 26, 2017 10:34 pm wrote:
OnInit() still not working. No EA feedback on the screen. Delete this red dot in the source code like a character and it works.

Cheers
Fantastic.
Demo working now.
User avatar
tomele
Administrator
Posts: 1208
Joined: Tue May 17, 2016 3:40 pm
Location: Germany, Forest of Odes, Defending the Limes

Peaky on Steroids

Post by tomele »

baddo » 26 Jun 2017, 23:48 wrote:
tomele » Mon Jun 26, 2017 10:34 pm wrote:
OnInit() still not working. No EA feedback on the screen. Delete this red dot in the source code like a character and it works.

Cheers
Fantastic.
Demo working now.
And way in the green today. Another brilliant work of master Steve. Presumably the masterpiece. Until now.

:clap: :clap: :clap:
Happy pippin, Thomas :-BD

It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so.
(Mark Twain)

Keep the coder going: Donate
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 on Steroids

Post by SteveHopwood »

tomele » Mon Jun 26, 2017 10:34 pm wrote:
SteveHopwood » 26 Jun 2017, 23:21 wrote:This is really weird. Scrolling down through the code to replace Zool's OnInit I came across this:
int OnInit(), with all the code in place but masked by the red dot.

And that dot really is red.

Not even the merest beginnings of the slightest hint of the opening gambit of a clue what happened there.

1c is back in post 1. You do not need it if your V1c is running fine - must have been something strange happening on my machine.

Probably the more criminally inclined of the crims trying to derail us. :lol:

:xm:
OnInit() still not working. No EA feedback on the screen. Delete this red dot in the source code like a character and it works.

Cheers
O for fucks sake, what does it take?

I have uploaded 1c yet again to post 1. I am starting to lose the will to live.

If you have no feedback on your chart then the bot is not working because of that fucking red dot. Do some learning for once folks, load the blasted source code into your bloody code editor, find the fucking red dot, delete it and recompile.

And if you do not know how to do the above, then bloody well learn how to. It is about fucking time you did. Only a cretin does battle with Empty4 without learning the basics of coding.

And do not even bother to have bad dreams about my reaction to you bleating, "But I am too busy."

Old stagers here might be sensing a certain level of irritation here. Hey ho.

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

Return to “Peaky forum”