Help with code? Miro?
-
Hi
If someone could help me with code for this it would be great. Ive included the code that Miro helped me with earlier.
The concept is that this indicator is going to adjust to price fluctuations and in turn control other indicators.
The idea is to:
- Divide High Price by Low Price -> (HL)
- Have the numbers from 1 (HL) with a set of different moving averages. All adjustable -> (HLMA)
- Divide that by an adjustable number. Take that to an adjustable PowerTo -> XXX/((HLMA)^XXX)
- Plot in separate window
If anything is unclear. Please feel free to ask
Many, many thanks /danerius
//---
int i;
for(i=barsToCalculate();i>=0;i--)
{
double priceHigh = iHigh(Symbol(), Period(), i);
double priceLow = iLow(Symbol(), Period(), i);
double lowHigh;if(priceHigh != 0) { lowHigh = priceLow / priceHigh; Buffer0[i] = MathPow(lowHigh, 100); } else { Buffer0[i] = 0; }}
for(i=barsToCalculate2();i>=0;i--)
{
Buffer1[i] = iMAOnArray(Buffer0, 0, maPeriod, 0, (ENUM_MA_METHOD)maMode, i);
}//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+ -
0_1529870748734_miro1360_test_1.2.mq4
maybe there can be error
try few excel calculations or something similiar for compare results to find potentially bug 
-
Hello Miro and many thanks

I think there might be an error. Ive pre-tested this idea on XAGUSD in Excel and it behaves differently. Ive included a screendump where the values are ”200 / HighLowValue ^ 3500.
Theses numbers are gonna vary between FX Pairs and Time Frames. But this could be a good start
I can send you the Excel fille if it helps?
Best regards /danerius

-
this is what we have:

now calculation in details:



so check, if there is not some error in provided formula, or if there is not something missing

-
Hello Miro
Awesome
I'll look into the math ASAPBest regards /danerius
-
Hi
A little update...
For some reason it worked fine on the second try without me modding anything. Not sure why. Might be that I adjusted the parameters in a different order. Or just Metatrader acting up
Best regards /Bo