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

Technical problems running HGB'nG? Post here.
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=4570
Page 11 of 15
Author:  Heraclees [ Fri Mar 25, 2016 3:17 am ]
Post subject:  Technical problems running HGB'nG? Post here.

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
Author:  SteveHopwood [ Fri Mar 25, 2016 9:40 am ]
Post subject:  Technical problems running HGB'nG? Post here.

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:
Author:  smpcoe [ Mon Mar 28, 2016 11:25 pm ]
Post subject:  Technical problems running HGB'nG? Post here.

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 :?
Author:  SteveHopwood [ Tue Mar 29, 2016 12:01 am ]
Post subject:  Technical problems running HGB'nG? Post here.

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:
Author:  smpcoe [ Tue Mar 29, 2016 12:52 am ]
Post subject:  Technical problems running HGB'nG? Post here.

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:
Author:  keydcuk [ Wed Mar 30, 2016 10:02 am ]
Post subject:  Technical problems running HGB'nG? Post here.

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
Author:  Gertje [ Wed Mar 30, 2016 10:07 am ]
Post subject:  Technical problems running HGB'nG? Post here.

What is your "profit-notification"?
Rightmouse click on open orders field.
- points
- deposit currency
- term currency
Author:  keydcuk [ Wed Mar 30, 2016 10:28 am ]
Post subject:  Technical problems running HGB'nG? Post here.

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
Author:  Gertje [ Wed Mar 30, 2016 11:04 am ]
Post subject:  Technical problems running HGB'nG? Post here.

:hi: :jump:
Author:  Heraclees [ Wed Mar 30, 2016 6:05 pm ]
Post subject:  Technical problems running HGB'nG? Post here.

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:
All times are UTC Page 11 of 15