Focal Candle Light

Keeping the candle lit on a low burner.

A quick, 1-hour conversion of my routine Focal Candle Histogram’s main signals from ThinkOrSwim.

#property copyright   "2019, Macdulio"
#property link        ""
#property description "Focal Candle Light"
#property strict
extern double FSize=32;
double FMax = FSize*6/5;
#property indicator_separate_window
#property indicator_minimum    6
#property indicator_maximum    24
#property indicator_buffers    2
#property indicator_color1     Blue
#property indicator_color2     Red

extern int multi = 5;
double span = 0.003;
double zz_h[];  //iCustom (NULL,0,"ZigZag", 12,5,3, 1,0); 
double zz_l[]; //iCustom (NULL,0,"ZigZag", 12,5,3, 2,0);
bool c[], c2[];
double SLK[],SLKD[];
double NONE[],ONE[];
double dlin[],dl[];
double average[];
int register[], summation[];
//| Custom indicator initialization function                         |
int OnInit(void)
   string symbol = Symbol();
   SetIndexBuffer(0, ONE);

//| Stochastic oscillator                                            |
int start()
   int    i,j;
   string symbol = Symbol();
      ArrayResize(dl, 600);   
 ArrayInitialize(dl, EMPTY_VALUE); 
     ArrayResize(dlin, 600);   
 ArrayInitialize(dlin, 0); 
      ArrayResize(zz_h, 600);   
 ArrayInitialize(zz_h, 0); 
      ArrayResize(zz_l, 600);   
 ArrayInitialize(zz_l, 0);  
    ArrayResize(NONE, 600);   
 ArrayInitialize(NONE, EMPTY_VALUE);  
     ArrayResize(ONE, 600);   
 ArrayInitialize(ONE, EMPTY_VALUE); 
  ArrayResize(SLK, 600);   
 ArrayInitialize(SLK, EMPTY_VALUE);  
  ArrayResize(SLKD, 600);   
 ArrayInitialize(SLKD, EMPTY_VALUE);  
   ArrayResize(c, 600);   
 ArrayInitialize(c, false); 
   ArrayResize(c2, 600);   
 ArrayInitialize(c2, false);
   ArrayResize(summation, 600);   
 ArrayInitialize(summation,  0);  
   ArrayResize(register, 600);   
 ArrayInitialize(register,  0);  
    ArrayResize(average, 600);   
 ArrayInitialize(average,  0);  

   for(i=597; i>=0; i--){
         c[i] = (High[i+2]-Low[i+2])*multi<(High[i+1]-Low[i+1]);
         c2[i] = (High[i+3]-Low[i+3])*multi<(High[i+2]-Low[i+2]); 
         zz_h[i]=iCustom (NULL,0,"ZigZag", 12,5,3, 1,i); 
         zz_l[i]=iCustom (NULL,0,"ZigZag", 12,5,3, 2,0);
         if (zz_h[i]==0 && zz_h[i+1]>0) dlin[i]=iLow(symbol,0,iLowest(symbol,0,MODE_LOW,4,i+1));
         if (dlin[i]<.02) dl[i]=Low[i];
         else dl[i]=dlin[i];
         if (dl[i]>High[i]) register[i]=-1;  
         else register[i]=1;
         if (i<500) { for(j=i; j<=i+16; j++) summation[i] += register[j];}

///One (blue) None (red)

for(i=300; i>=0; i--){
   if (SLK[i]>80) ONE[i]=20;   
   if (ONE[i]!=20 && ONE[i+1]==20 && ONE[i+2]==20) {
   ObjectCreate("ONEx"+IntegerToString(i), OBJ_TEXT, 0, Time[i+8], iHigh(symbol,0,iHighest(symbol,0,MODE_HIGH,5,i))+55*Point);  
      ObjectSetText("ONEx"+IntegerToString(i), "Sell thrust into resistance "+NormalizeDouble(iHigh(symbol,0,iHighest(symbol,0,MODE_HIGH,5,i)),4), 18, "Arial Black",  clrBlue);
      ObjectCreate("ONE"+IntegerToString(i), OBJ_TEXT, 0, Time[i+8], iHigh(symbol,0,iHighest(symbol,0,MODE_HIGH,5,i))+55*Point);  
      ObjectSetText("ONE"+IntegerToString(i), " Sell thrust into resistance "+NormalizeDouble(iHigh(symbol,0,iHighest(symbol,0,MODE_HIGH,5,i)),4), 18, "Arial Black",  clrWhite);}
   if (summation[i]<0 && SLK[i]<20 && Low[i]<iMA(NULL,0,828,0,MODE_EMA, PRICE_LOW,i)-FMax*2.0*10*Point) NONE[i]=10;
   if (NONE[i]!=10 && NONE[i+1]==10 && NONE[i+2]==10) {
    ObjectCreate("NONEx"+IntegerToString(i), OBJ_TEXT, 0, Time[i+8], iLow(symbol,0,iLowest(symbol,0,MODE_LOW,5,i))-25*Point);  
      ObjectSetText("NONEx"+IntegerToString(i), "Buy thrust into support "+NormalizeDouble(iLow(symbol,0,iLowest(symbol,0,MODE_LOW,5,i)),4), 18, "Arial Black",  clrCrimson);
    ObjectCreate("NONE"+IntegerToString(i), OBJ_TEXT, 0, Time[i+8], iLow(symbol,0,iLowest(symbol,0,MODE_LOW,5,i))-25*Point);  
      ObjectSetText("NONE"+IntegerToString(i), " Buy thrust into support "+NormalizeDouble(iLow(symbol,0,iLowest(symbol,0,MODE_LOW,5,i)),4), 18, "Arial Black",  clrWhite);}
    void deletetxt1(string text){
   for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--){
      string   on = ObjectName(iObj);
      if(StringFind(on, text) == 0)  ObjectDelete(on);
}  }

Current support and resistance levels listed below

Playing it right could had yielded 200% gains on Friday, not the measly 22% that I made. At home, I had to eliminate the re-targeting for magic number 0 and I needed to figure out how to stay in the market (a routine was left in from auto trading that capped the progress 34 pip beyond the last 30-minute outside value, and so it set my targets to 1.1107). This indicator is my answer.

(I actually plugged in the 1.1164 and the 1.1158 as my targets for the longs I opened – but I did not know where the hell to get back in again once was out. Actually, not quite true, I managed to get back in again twice – for some chump change at the 1.1073 level – see the list of supports above.)

The 10.8% was an auto hedge short on the spike down (ratio hedge), the remainder of it was closed for some loss.

As for the how far you can go (on the given day) – these numbers were on the screen before even the two sell-off dips occurred>

1.11532 was in the ballpark, don’t you think?

For the person, who looked up today the 15-minute mean reversion article, this was a 30-minute mean reversion. All LEMAs would have them from time to time.