stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Peaky on Steroids
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5204
Page 6 of 97
Author:  Maximilian [ Tue Jun 27, 2017 7:21 am ]
Post subject:  Peaky on Steroids

I think the red dot is a reminiscene of Dotty. She feels probably neglected and a bit jelous. Therefore she sents some of her dots to remind you.
:party: :party: :party: :roll: :lol: :smile:
Author:  macush [ Tue Jun 27, 2017 7:47 am ]
Post subject:  Peaky on Steroids

Can we have a special thread for Steve's CLANGERS??
" Not even the merest beginnings of the slightest hint of the opening gambit of a clue what happened there."
" I am starting to lose the will to live "
Priceless !!!! :smile: :smile: :mrgreen: :mrgreen: :lol: :lol:
Author:  Zool [ Tue Jun 27, 2017 10:32 am ]
Post subject:  Peaky on Steroids

"AUDCHF Peaky on Steroids OP_SELLSTOP order send failed with error(130): invalid stops TF = M15: bid = 125.758 Price = 125.255"

Getting this error message. Then it changes to AUDCAD after some time. The price (125.75) is for the EURJPY pair, and I think PoS is trying to send recovery trades, since it moved away more than 100 pips from my sell order.
Author:  PJSantos100 [ Tue Jun 27, 2017 11:28 am ]
Post subject:  Peaky on Steroids

Zool » Tue Jun 27, 2017 2:32 pm wrote:"AUDCHF Peaky on Steroids OP_SELLSTOP order send failed with error(130): invalid stops TF = M15: bid = 125.758 Price = 125.255"

Getting this error message. Then it changes to AUDCAD after some time. The price (125.75) is for the EURJPY pair, and I think PoS is trying to send recovery trades, since it moved away more than 100 pips from my sell order.

Hi zool , same error here :)
Author:  tomele [ Tue Jun 27, 2017 12:47 pm ]
Post subject:  Peaky on Steroids

Hi.

AUDCAD and/or AUDCHF at 125-ish? This looks like a CHFJPY price. The EA seems to mix up the pairs. The order looks right, only the symbol looks wrong.
Author:  Zool [ Tue Jun 27, 2017 1:10 pm ]
Post subject:  Peaky on Steroids

tomele » Tue Jun 27, 2017 1:47 pm wrote:Hi.

AUDCAD and/or AUDCHF at 125-ish? This looks like a CHFJPY price. The EA seems to mix up the pairs. The order looks right, only the symbol looks wrong.
Yes the price is definitely a xxxJPY pair's price. I think there is some mixing up with the different arrays. I think somehow the index of the time frame array sare used to get the symbol name from the trade pair array. I have trades on the 1st 2 timeframes needing the FillGapsWithStopOrders orders, and the symbol name array's first 2 symbols are the ones that are coming up in the error messages.

I'm trying to track down this bug, but I'm a bit rusty with MQL4 and first I have to translate Steve's shell code to my brain :)
Author:  PJSantos100 [ Tue Jun 27, 2017 1:30 pm ]
Post subject:  Peaky on Steroids

Zool » Tue Jun 27, 2017 5:10 pm wrote:
tomele » Tue Jun 27, 2017 1:47 pm wrote:Hi.

AUDCAD and/or AUDCHF at 125-ish? This looks like a CHFJPY price. The EA seems to mix up the pairs. The order looks right, only the symbol looks wrong.
Yes the price is definitely a xxxJPY pair's price. I think there is some mixing up with the different arrays. I think somehow the index of the time frame array sare used to get the symbol name from the trade pair array. I have trades on the 1st 2 timeframes needing the FillGapsWithStopOrders orders, and the symbol name array's first 2 symbols are the ones that are coming up in the error messages.

I'm trying to track down this bug, but I'm a bit rusty with MQL4 and first I have to translate Steve's shell code to my brain :)
Hi Zool ,

If it helps... i disabled the 1st time frame and i'm just using the 2nd , 3rd and 4th but still i have the same error as you....

Sorry , the error cames from AUDJPY...

Also AUDJPY H4 raised more than 20 pending orders , because every time the EA tries to modify the
order it will open a new one :youknow:

Cheers
Author:  tomele [ Tue Jun 27, 2017 1:52 pm ]
Post subject:  Peaky on Steroids

Hi.

I might have found it. OrderSymbol() in FillGapsWithStopOrders gives back wrong symbol. The LatestTradeTicketNo for my orders belongs to other symbols than OrderSymbol() gives back.

A possible fix looks like this:

In line 2312, change the call to:

Code: Select all

FillGapsWithStopOrders(cc,symbol);
Replace FillGapsWithStopOrders with this one:

Code: Select all

void FillGapsWithStopOrders(int dd, string symbol)
{

   //Fill in the gaps between the market price and the most recent trade
   //when the market is above the PH or below the PL.
   
   bool result = true;
   double price = 0;
   double SendLots = Lot;
   double stop = 0, take = 0;
   
   //Sell stops
   if (LatestTradeTicketNo > -1)   
      if (BetterOrderSelect(LatestTradeTicketNo, SELECT_BY_TICKET, MODE_TRADES))
         if (OrderType() == OP_SELL || OrderType() == OP_SELLSTOP)
            if (bid - OrderOpenPrice() >= (MarketDistance / factor) )
            {
               price = NormalizeDouble(OrderOpenPrice() + (MarketDistance / factor) / 2, digits);
               take = OrderTakeProfit();//New stop orders have the same take profit as the oldest market trade
               if (!DoesStopOrderExist(symbol, OP_SELLSTOP, price, dd))
               {
                  stop = CalculateStopLoss(OP_SELL, price, dd);
                  
                  result = SendSingleTrade(symbol, OP_SELLSTOP, TradeComments[dd], SendLots, price, stop, take, MagicNumbers[dd]);
               }//if (!DoesStopOrderExist(OrderSymbol(), OP_SELLSTOP, price, dd))
               
            }//if (bid - OrderOpenPrice() >= (MarketDistance / factor) )

   //Buy stops
   if (LatestTradeTicketNo > -1)   
      if (BetterOrderSelect(LatestTradeTicketNo, SELECT_BY_TICKET, MODE_TRADES))
         if (OrderType() == OP_BUY|| OrderType() == OP_BUYSTOP)
            if (OrderOpenPrice() - bid >= (MarketDistance / factor) )
            {
               price = NormalizeDouble(OrderOpenPrice() - (MarketDistance / factor) / 2, digits);
               take = OrderTakeProfit();//New stop orders have the same take profit as the oldest market trade
               if (!DoesStopOrderExist(symbol, OP_BUYSTOP, price, dd))
               {
                  stop = CalculateStopLoss(OP_BUY, price, dd);
                  
                  result = SendSingleTrade(symbol, OP_BUYSTOP, TradeComments[dd], SendLots, price, stop, take, MagicNumbers[dd]);
               }//if (!DoesTradeExist(OP_BUYSTOP, price))
               
            }//if (OrderOpenPrice() - bid >= (MarketDistance / factor) )
      

}//End void FillGapWithStopOrders(int cc)
Author:  Zool [ Tue Jun 27, 2017 2:18 pm ]
Post subject:  Peaky on Steroids

tomele » Tue Jun 27, 2017 2:52 pm wrote:Hi.

I might have found it. OrderSymbol() in FillGapsWithStopOrders gives back wrong symbol. The LatestTradeTicketNo for my orders belongs to other symbols than OrderSymbol() gives back.
Thank you it seems like your mod solved the issue. The one thing I don't get that the OrderTakeProfit() and OrderOpenPrice() functions are giving the good values yet the OrderSymbol() gives back something completely different. This is a Empty4 feature, or I am missing something here?
Author:  taipan [ Tue Jun 27, 2017 2:33 pm ]
Post subject:  Peaky on Steroids

Is it this statement to be repalced:" LookForTradingOpportunities(symbol, cc);" with your code?
All times are UTC Page 6 of 97