Perky Ashi

 

Hi.


I'm attempting to modify one of FerruFX's indicators to use custom indicators. I've already gotten all the MAs to work correctly, but I'm not sure how to get the correct information for the other two indicators. I would ultimately like this to display the MTF data from the two indicators I've attached, PerkyAsctrend1 and HeikenAshi MTF. I'm using iCustom for both and I think I've used the correct commands to that extent.


I'm able to produce data (but not the correct data) for the PerkyAsctrend1. I thought I understood the logic to get it to display correctly, but I guess I don't. Ferru used MA, CCI, MACD, ADX, Bullspower and BearsPower in his indicator, but they're different kinds of indicators and unfortunately aren't very useful as a reference (to me) for PerkyAsctrend1 in this setting.


I thought the HeikenAshi MTF indicator would be easy enough to add to the indicator. Apparently I was wrong. The Heiken column is displaying "Label" inexplicably and they're all disappearing after the first tick.



Hopefully the code doesn't actually look as gross to you as it does to me. If anyone can help, I'd really appreciate it. I need a more experienced pair of eyes on this. I feel it will be quite beneficial when complete.


-


R


 

I've done my best to narrow it down so anyone nice enough to help doesn't have to sort through 1,000 lines of code. Here is the code from the two different indicators. Please let me know if you see anything blatantly out of place.
int RISK = 4;  

int AllBars = 250;   

int MaMethod = 1;

int MaPeriod = 20;





//...

// Pesky



//...

   
 string Pesky_Trend_1 //-- , Pesky_Trend_5,
Pesky_Trend_15, Pesky_Trend_30, Pesky_Trend_60, Pesky_Trend_240,
Pesky_Trend_1440, Pesky_Trend_10080;

   

   

   double Pesky_m_1=iCustom(NULL,PERIOD_M1, "PerkyAsctrend1", RISK, AllBars,0,shift_1);

   

   if ((Pesky_m_1 > 0)) { Pesky_Trend_1 = "UP"; x = 416; color_indic = Lime; UP_33 = 1; DOWN_33 = 0; }

   if ((Pesky_m_1 < 0)) { Pesky_Trend_1 = "DOWN"; x = 406; color_indic = Red; UP_33 = 0; DOWN_33 = 1; }



// ...



// Indicator (Heiken)



//...



   string HA_Trend_1  //-- , HA_Trend_5, HA_Trend_15, HA_Trend_30, HA_Trend_60, HA_Trend_240, HA_Trend_1440, HA_Trend_10080;

   

   double HA_1_1=iCustom(NULL,PERIOD_M1,"Heiken MTF",MaMethod,MaPeriod,shift_1);

   double HA_2_1=iCustom(NULL,PERIOD_M1,"Heiken MTF",MaMethod,MaPeriod,shift_1+1);

   

   if ((HA_1_1 > HA_2_1)) { HA_Trend_1 = "UP"; x = 466; color_indic = Lime; UP_41 = 1; DOWN_41 = 0; }

   if ((HA_1_1 < HA_2_1)) { HA_Trend_1 = "DOWN"; x = 456; color_indic = Lime; UP_41 = 0; DOWN_41 = 1; }



//...
			
		

I know the shift values are unorthodox but that's how the original author did it.

int start()
  {
  //...

// Shift calculation for indicators (tests only)

   double shift_1, shift_5, shift_15, shift_30, shift_60, shift_240, shift_1440, shift_10080;
   
   if( test == true )
   {
    shift_1=iBarShift(NULL,PERIOD_M1,look_time_shift,false);
    shift_5=iBarShift(NULL,PERIOD_M5,look_time_shift,false);
    shift_15=iBarShift(NULL,PERIOD_M15,look_time_shift,false);
    shift_30=iBarShift(NULL,PERIOD_M30,look_time_shift,false);
    shift_60=iBarShift(NULL,PERIOD_H1,look_time_shift,false);
    shift_240=iBarShift(NULL,PERIOD_H4,look_time_shift,false);
    shift_1440=iBarShift(NULL,PERIOD_D1,look_time_shift,false);
    shift_10080=iBarShift(NULL,PERIOD_W1,look_time_shift,false);
   }
   else
   {
    shift_1=shift_indicators;
    shift_5=shift_indicators;
    shift_15=shift_indicators;
    shift_30=shift_indicators;
    shift_60=shift_indicators;
    shift_240=shift_indicators;
    shift_1440=shift_indicators;
    shift_10080=shift_indicators;


Thanks again...


R

 
My head is going to explode. I can't get this.