Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save snehitgajjar/16515275dfccc83963adddf4d4583831 to your computer and use it in GitHub Desktop.
Save snehitgajjar/16515275dfccc83963adddf4d4583831 to your computer and use it in GitHub Desktop.
Fib Retracement
public float[] fibRetracement(float startPrice, float endPrice){
float[] fibPercents = {23.6, 38.2, 61.8, 78.6};
float[] result = new float[fibPercents.length];
for(int i=0; i<fibPercent.length ; i++){
float supportLineDiff = startPrice - endPrice;
result[i] = endPrice + (supportLineDiff * fibPercents)/100;
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment