Technical problems running HGB'nG? Post here.

EA's inspired by nanningbob's work here, especially those based on his 240 Moving Average trend detection filter.
Post Reply
User avatar
Heraclees
Trader
Posts: 24
Joined: Thu Dec 24, 2015 3:06 am
Location: Vietnam

Technical problems running HGB'nG? Post here.

Post by Heraclees »

Dear Steve,
Could you spare few minutes to explain to me for more clear understanding about the condition CloseOnOppositeSignal.

Contrary to CloseTradesOnRelevantSemafor or CloseOnOppositeSignal where there are distinct parameters like SemStatus == highsemafor /SemStatus == lowsemafor or BuySignal/SellSignal.

There is only one condition for WaveStatus == Waverange (no waverange up or waverange down)

So my questionning is for this portion of code :

Code: Select all

if (CloseOnYellowRangeWave)
      {
         if (WaveStatus == Waverange)
         {
            tries = 0;
            //Close buys
            if (BuyOpen && (!OnlyCloseProfitablePositions || BuyPipsUpl > 0))
            {
               ForceTradeClosure = true;
               while(ForceTradeClosure)
               {
                  CloseAllTrades(OP_BUY);
                  if (BuyStopOpen)
                     CloseAllTrades(OP_BUYSTOP);
                  if (BuyLimitOpen)
                     CloseAllTrades(OP_BUYLIMIT);
                  if(GridType == Stop_Orders_Only && (DeleteAndReplaceWavyLosersGrid || !SellOpen))
                     CloseAllTrades(OP_SELLSTOP);
                  if (ForceTradeClosure)
                     Sleep(1000);  
                  tries++;
                  if (tries >= 100)
                  {
                     ForceTradeClosure = false;
                     break;
                  }//if (tries >= 100)
               }//while(ForceTradeClosure)
               
               //Replace the grids for the stop orders method
               if (GridType == Stop_Orders_Only)
               {
                  if (ReplaceWavyWinnersGrid)
                     if (SellOpen)//open sells means the cycle has not ended and we want new buy stop orders ready in case market resumes its upward move
                        SendBuyGrid(Symbol(), OP_BUYSTOP, NormalizeDouble(Ask + (DistanceBetweenTrades / factor), Digits), SendLots);
                     if (DeleteAndReplaceWavyLosersGrid)
                        if (SellOpen)//open sells means the cycle has not ended and we want new sell stop orders much closer to the market
                           SendSellGrid(Symbol(), OP_SELLSTOP, NormalizeDouble(Bid - (DistanceBetweenTrades / factor), Digits), SendLots);
               }//if (GridType == Stop_Orders_Only)
               
               return;//Nothing more for this function to do     
            }//if (BuyOpen)
     
            //Close sells
            if (SellOpen && (!OnlyCloseProfitablePositions || SellPipsUpl > 0))
            {
               ForceTradeClosure = true;
               while(ForceTradeClosure)
               {
                  ForceTradeClosure = false;
                  CloseAllTrades(OP_SELL);
                  if (SellStopOpen)
                     CloseAllTrades(OP_SELLSTOP);
                  if (SellLimitOpen)
                     CloseAllTrades(OP_SELLLIMIT);
                  if (GridType == Stop_Orders_Only && (DeleteAndReplaceWavyLosersGrid || !BuyOpen))
                     CloseAllTrades(OP_BUYSTOP);  
                  tries++;
                  if (tries >= 100)
                  {
                     ForceTradeClosure = false;
                     break;
                  }//if (tries >= 100)
               }//while(ForceTradeClosure)
            
               //Replace the grids for the stop orders method
               if (GridType == Stop_Orders_Only)
               {
                  if (ReplaceWavyWinnersGrid)
                     if (BuyOpen)//open buys means the cycle has not ended and we want new sell stop orders ready in case market resumes its downward move
                        SendSellGrid(Symbol(), OP_SELLSTOP, NormalizeDouble(Bid - (DistanceBetweenTrades / factor), Digits), SendLots);
                     if (DeleteAndReplaceWavyLosersGrid)
                        if (BuyOpen)//open buys means the cycle has not ended and we want new buy stop orders much closer to the market
                           SendBuyGrid(Symbol(), OP_BUYSTOP, NormalizeDouble(Ask + (DistanceBetweenTrades / factor), Digits), SendLots);
               }//if (GridType == Stop_Orders_Only)
   
               return;//Nothing more for this function to do
                     
            }//if (SellOpen)
         
         }// if (WaveStatus == Waverange)
If my parameters ReplaceWavyWinnersGrid = true and DeleteAndReplaceWavyLosersGrid = true. The condition where there are still BuyOpen and SellOpen will let AE triggers twice "send grids" right ?

Of course there is security parameter PostTradeAttemptWaitSeconds so no problems.
But what I want to ask : is there a possibility result return from HGI for Waverange where we can distinct the "waverange up" or "waverange down" ?
Because I would like to set like Close Trades on Semafor with ReplaceWinnersByLimitGrid and AddStopOrdersToLimitGrid.
I've noticed the odds on continuing the trend after the YellowRangeWave is evenly or more often than the odds on Semafor that why I would like to test it.

What I mod to meet this requirement like a "amateur" is using MA filters to determine the condition "TradeLong" and "TradeShort" to distinct with waverange.
But not sure It's a clean solution.


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

Technical problems running HGB'nG? Post here.

Post by SteveHopwood »

Heraclees » Fri Mar 25, 2016 3:17 am wrote:Dear Steve,
Could you spare few minutes to explain to me for more clear understanding about the condition CloseOnOppositeSignal.

Contrary to CloseTradesOnRelevantSemafor or CloseOnOppositeSignal where there are distinct parameters like SemStatus == highsemafor /SemStatus == lowsemafor or BuySignal/SellSignal.

There is only one condition for WaveStatus == Waverange (no waverange up or waverange down)

So my questionning is for this portion of code :

Code: Select all

if (CloseOnYellowRangeWave)
      {
         if (WaveStatus == Waverange)
         {
            tries = 0;
            //Close buys
            if (BuyOpen && (!OnlyCloseProfitablePositions || BuyPipsUpl > 0))
            {
               ForceTradeClosure = true;
               while(ForceTradeClosure)
               {
                  CloseAllTrades(OP_BUY);
                  if (BuyStopOpen)
                     CloseAllTrades(OP_BUYSTOP);
                  if (BuyLimitOpen)
                     CloseAllTrades(OP_BUYLIMIT);
                  if(GridType == Stop_Orders_Only && (DeleteAndReplaceWavyLosersGrid || !SellOpen))
                     CloseAllTrades(OP_SELLSTOP);
                  if (ForceTradeClosure)
                     Sleep(1000);  
                  tries++;
                  if (tries >= 100)
                  {
                     ForceTradeClosure = false;
                     break;
                  }//if (tries >= 100)
               }//while(ForceTradeClosure)
               
               //Replace the grids for the stop orders method
               if (GridType == Stop_Orders_Only)
               {
                  if (ReplaceWavyWinnersGrid)
                     if (SellOpen)//open sells means the cycle has not ended and we want new buy stop orders ready in case market resumes its upward move
                        SendBuyGrid(Symbol(), OP_BUYSTOP, NormalizeDouble(Ask + (DistanceBetweenTrades / factor), Digits), SendLots);
                     if (DeleteAndReplaceWavyLosersGrid)
                        if (SellOpen)//open sells means the cycle has not ended and we want new sell stop orders much closer to the market
                           SendSellGrid(Symbol(), OP_SELLSTOP, NormalizeDouble(Bid - (DistanceBetweenTrades / factor), Digits), SendLots);
               }//if (GridType == Stop_Orders_Only)
               
               return;//Nothing more for this function to do     
            }//if (BuyOpen)
     
            //Close sells
            if (SellOpen && (!OnlyCloseProfitablePositions || SellPipsUpl > 0))
            {
               ForceTradeClosure = true;
               while(ForceTradeClosure)
               {
                  ForceTradeClosure = false;
                  CloseAllTrades(OP_SELL);
                  if (SellStopOpen)
                     CloseAllTrades(OP_SELLSTOP);
                  if (SellLimitOpen)
                     CloseAllTrades(OP_SELLLIMIT);
                  if (GridType == Stop_Orders_Only && (DeleteAndReplaceWavyLosersGrid || !BuyOpen))
                     CloseAllTrades(OP_BUYSTOP);  
                  tries++;
                  if (tries >= 100)
                  {
                     ForceTradeClosure = false;
                     break;
                  }//if (tries >= 100)
               }//while(ForceTradeClosure)
            
               //Replace the grids for the stop orders method
               if (GridType == Stop_Orders_Only)
               {
                  if (ReplaceWavyWinnersGrid)
                     if (BuyOpen)//open buys means the cycle has not ended and we want new sell stop orders ready in case market resumes its downward move
                        SendSellGrid(Symbol(), OP_SELLSTOP, NormalizeDouble(Bid - (DistanceBetweenTrades / factor), Digits), SendLots);
                     if (DeleteAndReplaceWavyLosersGrid)
                        if (BuyOpen)//open buys means the cycle has not ended and we want new buy stop orders much closer to the market
                           SendBuyGrid(Symbol(), OP_BUYSTOP, NormalizeDouble(Ask + (DistanceBetweenTrades / factor), Digits), SendLots);
               }//if (GridType == Stop_Orders_Only)
   
               return;//Nothing more for this function to do
                     
            }//if (SellOpen)
         
         }// if (WaveStatus == Waverange)
If my parameters ReplaceWavyWinnersGrid = true and DeleteAndReplaceWavyLosersGrid = true. The condition where there are still BuyOpen and SellOpen will let AE triggers twice "send grids" right ?

Of course there is security parameter PostTradeAttemptWaitSeconds so no problems.
But what I want to ask : is there a possibility result return from HGI for Waverange where we can distinct the "waverange up" or "waverange down" ?
Because I would like to set like Close Trades on Semafor with ReplaceWinnersByLimitGrid and AddStopOrdersToLimitGrid.
I've noticed the odds on continuing the trend after the YellowRangeWave is evenly or more often than the odds on Semafor that why I would like to test it.

What I mod to meet this requirement like a "amateur" is using MA filters to determine the condition "TradeLong" and "TradeShort" to distinct with waverange.
But not sure It's a clean solution.


Hai
There are no range up or range down features in HGI. There are ways of trading the range using the HGI; these are not part of any of the HGB EA's. HGB trades the trends, and so stops trading/closes trades when the market enters a range as defined by HGI.

:xm:

: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. [email protected] 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.
smpcoe
Trader
Posts: 15
Joined: Wed Jan 13, 2016 8:13 am

Technical problems running HGB'nG? Post here.

Post by smpcoe »

Hi Steve: When I 'Send Full Grid' or 'Send Buy Stops' or 'Send Sell Stops' or the 'Limits'. they all set up & then are removed.
I've tried this on 2 different Crim's(Bully Pepperstone & Tallinex) on candles that were clear of any HGI signals- See Pics.
This is using version 1N right OOTB.

Hope this helps, Stan :?
You do not have the required permissions to view the files attached to this post.
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Technical problems running HGB'nG? Post here.

Post by SteveHopwood »

smpcoe » Mon Mar 28, 2016 11:25 pm wrote:Hi Steve: When I 'Send Full Grid' or 'Send Buy Stops' or 'Send Sell Stops' or the 'Limits'. they all set up & then are removed.
I've tried this on 2 different Crim's(Bully Bully Pepperstone & Tallinex) on candles that were clear of any HGI signals- See Pics.
This is using version 1N right OOTB.

Hope this helps, Stan :?
It helps if you know better what this ea does. For that read the UG and this thread with a bit more attention. Not much use sending trades that the bot will instantly delete because there is no HGI signal.

There is a saying: just because we can do something, this does not mean we should.

Best for you to learn about HGI and HGBnG before using either of them.

: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. [email protected] 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.
smpcoe
Trader
Posts: 15
Joined: Wed Jan 13, 2016 8:13 am

Technical problems running HGB'nG? Post here.

Post by smpcoe »

Ahh, I see now. That never occurred to me; I'll re-read the UG as I must have missed that.

Thank you, Steve :oops:
User avatar
keydcuk
Trader
Posts: 104
Joined: Tue Dec 04, 2012 8:01 pm

Technical problems running HGB'nG? Post here.

Post by keydcuk »

Has anybody had some strange trades on the CADJPY and NZDJPY.

The attached screenshot is HGBnG version H and it is running on a Global Prime Demo.

Not that one of the CADJPY pairs says I am over -£1000 in negative yet my trade balance does not reflect it. There is another large loss showing on a second CADJPY as well as a NZDJPY. It doesn't seem to be recording it in the trade balance though.... My head is itching here.

Cheers!

Daniel
You do not have the required permissions to view the files attached to this post.
User avatar
Gertje
Trader
Posts: 1936
Joined: Mon Dec 12, 2011 1:17 pm
Location: Middle of the Netherlands

Technical problems running HGB'nG? Post here.

Post by Gertje »

What is your "profit-notification"?
Rightmouse click on open orders field.
- points
- deposit currency
- term currency
User avatar
keydcuk
Trader
Posts: 104
Joined: Tue Dec 04, 2012 8:01 pm

Technical problems running HGB'nG? Post here.

Post by keydcuk »

Gertje » Wed Mar 30, 2016 10:07 am wrote:What is your "profit-notification"?
Rightmouse click on open orders field.
- points
- deposit currency
- term currency
Ahhh! You fixed my problem! :clap: It was set on term currency and not deposit currency!!! :)

Thanks :clap:

Daniel
User avatar
Gertje
Trader
Posts: 1936
Joined: Mon Dec 12, 2011 1:17 pm
Location: Middle of the Netherlands

Technical problems running HGB'nG? Post here.

Post by Gertje »

:hi: :jump:
User avatar
Heraclees
Trader
Posts: 24
Joined: Thu Dec 24, 2015 3:06 am
Location: Vietnam

Technical problems running HGB'nG? Post here.

Post by Heraclees »

Hi pals,
For guys who trepassing all secure warnings from Steve and still want to "cross the highway" blinded for feeling the pain and misery aiming to test all your dement strategies with this great tool. You can comment out the following code

Code: Select all

/*   if (LatestTradeTime >= iTime(Symbol(), TradingTimeFrame, 0) )
      if (HgiSignalStatus == hginosignal)
         if (!BuyOpen)
            if (!SellOpen)
            {
               tries = 0;
               ForceTradeClosure = true;
               while(ForceTradeClosure)
               {
                  ForceTradeClosure = false;
                  if (SellStopOpen)
                     CloseAllTrades(OP_SELLSTOP);
                  if (SellLimitOpen)
                     CloseAllTrades(OP_SELLLIMIT);
                  if (BuyStopOpen)
                     CloseAllTrades(OP_BUYSTOP);
                  if (BuyLimitOpen)
                     CloseAllTrades(OP_BUYLIMIT);  
                  tries++;
                  if (tries >= 100)
                  {
                     ForceTradeClosure = false;
                     break;
                  }//if (tries >= 100)
              }//while(ForceTradeClosure)
            }//if (!SellOpen)
    
   //All market trades have hit tp
   if (PendingTradesTotal < (GridSize * 2) )//There should be up to GridSize * 2
      if (MarketTradesTotal == 0)//And all the market trades have hit tp or sl
      {
         ForceTradeClosure = true;
         while(ForceTradeClosure)
         {
            tries = 0;
            ForceTradeClosure = false;
            if (SellStopOpen)
               CloseAllTrades(OP_SELLSTOP);
            if (SellLimitOpen)
               CloseAllTrades(OP_SELLLIMIT);
            if (BuyStopOpen)
               CloseAllTrades(OP_BUYSTOP);
            if (BuyLimitOpen)
               CloseAllTrades(OP_BUYLIMIT);  
                  tries++;
                  if (tries >= 100)
                  {
                     ForceTradeClosure = false;
                     break;
                  }//if (tries >= 100)
        }//while(ForceTradeClosure)
      }//if (MarketTradesTotal == 0)//And all the market trades have hit tp or sl
   */ 
So you can send full grid/stop/limite orders without the AE delete them at sight because you try to alter its "perfection".

Of course there are proper way to do but i'm not a coder, just amateur trying to learn by myself and testing what is generously offer without abusing.
Hence IMO the first test is deleting all pending orders if there is no hgi signal anymore and no trade filled. Not impacting much with keeping grid stop orders trading.
And the 2nd test is removing when all TP is react and only left 1 side order but for me it not impacting much as well as if all tp are hit then close on semafor function / close on yellow wave are nearby and will take care of it.
Voila have fun pals. I'm but at present it affect much my 9/5 job time... :jump:
Post Reply

Return to “Thingy Bob EA's”