MetaNeural SuperDash

dietcoke
Trader
Posts: 162
Joined: Tue Nov 15, 2011 9:59 pm

Re: MetaNeural SuperDash

Post by dietcoke »

effluvium wrote:
falsedave wrote:New update to 1.4

The errors are coming thick and fast today. 1.3 wasn't trading due to an error in finding already open trades.
.......
FalseDave,
Just a technical question about your code. You have put a serie of conditional IFs to detect the Daily and Hourly Bias, based on the different arrays with Open,High,Low,Close,.. values.
But in fact, if you have one condition which confirms you with a True answer that the Bias is UP/DN, is there a sense to test above all other conditions ? Is it optimal to do that ?
No its not. I'm looking at that function now and its a bit iffy. No slur on you dave, it's just a code dump from the original coder.

Give me 30 mins and I'll post a more efficient version
effluvium

Re: MetaNeural SuperDash

Post by effluvium »

dietcoke wrote:
effluvium wrote:
falsedave wrote:New update to 1.4

The errors are coming thick and fast today. 1.3 wasn't trading due to an error in finding already open trades.
.......
FalseDave,
Just a technical question about your code. You have put a serie of conditional IFs to detect the Daily and Hourly Bias, based on the different arrays with Open,High,Low,Close,.. values.
But in fact, if you have one condition which confirms you with a True answer that the Bias is UP/DN, is there a sense to test above all other conditions ? Is it optimal to do that ?
No its not. I'm looking at that function now and its a bit iffy. No slur on you dave, it's just a code dump from the original coder.

Give me 30 mins and I'll post a more efficient version
Thanks Dietcoke to confirm my initial impression.
I have another doubt, but I'm not sure. To Test "UP Daily Bias" Daily Volume was compared: is it Higher against previous day volume? And To Test "DOWN Daily Bias" the same test is used. I Thought we should test if Daily Volume is LOWER against previous day volume ? Am I correct ?
dietcoke
Trader
Posts: 162
Joined: Tue Nov 15, 2011 9:59 pm

Re: MetaNeural SuperDash

Post by dietcoke »

effluvium wrote:
dietcoke wrote:
effluvium wrote:
falsedave wrote:New update to 1.4

The errors are coming thick and fast today. 1.3 wasn't trading due to an error in finding already open trades.
.......
FalseDave,
Just a technical question about your code. You have put a serie of conditional IFs to detect the Daily and Hourly Bias, based on the different arrays with Open,High,Low,Close,.. values.
But in fact, if you have one condition which confirms you with a True answer that the Bias is UP/DN, is there a sense to test above all other conditions ? Is it optimal to do that ?
No its not. I'm looking at that function now and its a bit iffy. No slur on you dave, it's just a code dump from the original coder.

Give me 30 mins and I'll post a more efficient version
Thanks Dietcoke to confirm my initial impression.
I have another doubt, but I'm not sure. To Test "UP Daily Bias" Daily Volume was compared: is it Higher against previous day volume? And To Test "DOWN Daily Bias" the same test is used. I Thought we should test if Daily Volume is LOWER against previous day volume ? Am I correct ?

No. Volume is just a a confirmation that the direction(Bias) you see is confirmed.

The metaneural function is always looking for an increasing trend in volume on the daily bars. then, on the hourly timeframe, it is looking for signs that the price is moving with the daily bias after an intraday correction.
falsedave
Trader
Posts: 53
Joined: Sun Aug 26, 2012 5:00 pm

Re: MetaNeural SuperDash

Post by falsedave »

I did look over that, In all honesty it was just a direct copy paste from the original MetaNeural Dash. I decided to leave it as it was for the time being leave the trade logic unchanged. A quick scan over to check it worked but nothing else. Then review and optimize later.
Image
Image
effluvium

Re: MetaNeural SuperDash

Post by effluvium »

falsedave wrote:I did look over that, In all honesty it was just a direct copy paste from the original MetaNeural Dash. I decided to leave it as it was for the time being leave the trade logic unchanged. A quick scan over to check it worked but nothing else. Then review and optimize later.
OK falseDave, I'm deciding to optimize the core of the code which is intersting me, because of the reversal detection candle, which I intend to use in a future indicator I'd like to have in my charts.

To begin with, here is the exact optimizing code to obtain Daily Bias (which returns 3 possible values: UP, Down, NONE). I just put the code you have given in a procedure I called GiveDailyBias

Code: Select all

int GiveBiasDaily(string symb, int DailyShift)
{
  
   //--- daily variables 
   double DCloseNow = iClose(symb,PERIOD_D1, DailyShift );                 // previous day close
   double DClosePrv = iClose(symb,PERIOD_D1, DailyShift + 1);                // close for the day before the last day
   double DOpenNow =  iOpen(symb,PERIOD_D1, DailyShift);                  // open
   double DOpenPrv =  iOpen(symb,PERIOD_D1, DailyShift + 1);                 // open for the day before the last day
   double DHighNow =  iHigh(symb,PERIOD_D1, DailyShift);                  // high
   double DHighPrv =  iHigh(symb,PERIOD_D1,DailyShift + 1);                 // high for the day before the last day
   double DLowNow =    iLow(symb,PERIOD_D1,DailyShift);                   // low
   double DLowPrv =    iLow(symb,PERIOD_D1,DailyShift + 1);                  // low for the day before the last day
   double DVolumNow  = iVolume(symb,PERIOD_D1,DailyShift);                // volume
   double DVolumPrv = iVolume(symb,PERIOD_D1,DailyShift + 1);               // volume for the day before the last day
  
 double DRange = DHighNow - DLowNow;    // range
  
  if( DVolumNow > DVolumPrv )
   {
         //--- check for long bias of previous day

         // clear sign of upwards strength for the previous day
         if(DOpenNow <= DLowNow + 0.33*DRange && DCloseNow >= DLowNow + 0.66 * DRange )                 return(UP); // DailyBias = UP;
         
         // standard up bar failure
         if(DLowNow < DLowPrv && DCloseNow > DOpenNow && DCloseNow > DLowNow +0.625 * DRange)           return(UP); // DailyBias = UP;
         
         // up t failure
         if(( DCloseNow - DOpenNow) <= ( 5*iATR(symb,PERIOD_D1,14,0)/100 ) && DCloseNow > DOpenNow )  return(UP); // DailyBias = UP;
   
         // up wall failure 
         if(DLowNow < DLowPrv && DHighNow > DHighPrv && DCloseNow >= DHighPrv)                        return(UP); // DailyBias = UP;
   

      //--- check for short bias of previous day

      // clear sign of downwards strength for the previous day
         if(DCloseNow <= DLowNow + 0.33*DRange && DOpenNow >= DLowNow + 0.66*DRange )                 return(DOWN); //DailyBias = DOWN;
   
         // standard down bar failure
         if(DHighNow > DHighPrv && DCloseNow < DOpenNow && DCloseNow < DHighNow-0.625*DRange)         return(DOWN); //DailyBias = DOWN;
   
         // down t failure
         if(DOpenNow - DCloseNow <= ( 5*iATR(symb,PERIOD_D1,14,0)/100 ) && DCloseNow < DOpenNow )     return(DOWN); //DailyBias = DOWN;
   
         // down wall failure 
         if(DLowNow < DLowPrv && DHighNow > DHighPrv && DCloseNow <= DLowPrv )                        return(DOWN); //DailyBias = DOWN;
      }
      
            // reversal failure
      if( MathAbs(DCloseNow - DOpenPrv) <  iATR(symb,PERIOD_D1,14,0)/100 )  
         
         {  
            if( DOpenPrv > DClosePrv)  return(UP);   // DailyBias = UP;
            if( DOpenPrv < DClosePrv)  return(DOWN); //DailyBias = DOWN;
         }
  
  return(NONE);
}
To call this function from your metaNeural function just put in its beginning this assignment
DailyBias[index] = GiveBiasDaily(symb, 1)
(1 mean the shift of the Daily Bar which is 1 because you are calculating the Previous Daily Bar)

Give me a few moment and I will post the optimization code of Calculation Hourly stuff.
dietcoke
Trader
Posts: 162
Joined: Tue Nov 15, 2011 9:59 pm

Re: MetaNeural SuperDash

Post by dietcoke »

Dave,

Do you know how the criteria for reversals signals came about?

I'm a bit confused by the reversal failure signal

// reversal failure
if(MathAbs(dc[index] - do2[index]) < (dAtr * 0.02) && do2[index] > dc2[index])

Why does it not depend on increasing volume??
effluvium

Re: MetaNeural SuperDash

Post by effluvium »

dietcoke wrote:Dave,

Do you know how the criteria for reversals signals came about?

I'm a bit confused by the reversal failure signal

// reversal failure
if(MathAbs(dc[index] - do2[index]) < (dAtr * 0.02) && do2[index] > dc2[index])

Why does it not depend on increasing volume??
Yes, things were more simple with Daily Bias as it was just one parameter to identify.
It turns really confusing when it comes to discuss Hourly Bias, and all other stuff about UphighVol, UpLowVol etc... I tried to sort out the hourly complex conditional tests by grouping them, but I'm not convinced about their logical tests. Pfffffffffffff :x
dietcoke
Trader
Posts: 162
Joined: Tue Nov 15, 2011 9:59 pm

Re: MetaNeural SuperDash

Post by dietcoke »

effluvium wrote:
dietcoke wrote:Dave,

Do you know how the criteria for reversals signals came about?

I'm a bit confused by the reversal failure signal

// reversal failure
if(MathAbs(dc[index] - do2[index]) < (dAtr * 0.02) && do2[index] > dc2[index])

Why does it not depend on increasing volume??
Yes, things were more simple with Daily Bias as it was just one parameter to identify.
It turns really confusing when it comes to discuss Hourly Bias, and all other stuff about UphighVol, UpLowVol etc... I tried to sort out the hourly complex conditional tests by grouping them, but I'm not convinced about their logical tests. Pfffffffffffff :x

I've pm'd dave with some simplified code. Hopefully he will incorporate it later today
User avatar
snailbeard
Trader
Posts: 615
Joined: Mon Dec 24, 2012 10:54 am
Location: Just above water somewhere between Oxford & Cambridge

Re: MetaNeural SuperDash

Post by snailbeard »

I ran a quick back test OOTB over two months (GPDUSD,H1) and all the entries were shorts even during up trends,
therefore overall it was losing money. However, if long entries had occurred where the bias was up it could have been a nice little earner. I think it has plenty of potential and if I was not in the middle tweaking a variant of BBBE I would spend more time with it.

I would like to revisit this one later and get a better understanding of the logic!

Brian
effluvium

Re: MetaNeural SuperDash

Post by effluvium »

snailbeard wrote:I ran a quick back test OOTB over two months (GPDUSD,H1) and all the entries were shorts even during up trends,
therefore overall it was losing money. However, if long entries had occurred where the bias was up it could have been a nice little earner. I think it has plenty of potential and if I was not in the middle tweaking a variant of BBBE I would spend more time with it.

I would like to revisit this one later and get a better understanding of the logic!

Brian
I'm not surprised to hear that. I'd taken a look at the rest of the code, and what conditions are sending this or this message in the EA. Needless to say that it is a complete MESS .

I'm calling this code "The ROYAL Spaghetti ", and I failed even to understand the logic behind the construction of orders displayed in this EA.
So I resign and admit that I'm "knoked OUT" and I'm abandoning that (I had the plan to adapt some ideas about reversal to integrate them in a small indi), but Finally it doesn't worth to lose more time on it.
I wonder who is the first code author (I know he's not FalseDave). I can tell you He's the chef of the chef for Spaghetti meals.
Post Reply

Return to “Automated trading systems”