Quantcast
Channel: Traderji.com
Viewing all articles
Browse latest Browse all 10287

Please fix this AFL, thank you very much

$
0
0
startIndex= SelectedValue(BarIndex());
endIndex = EndValue( BarIndex() );
if (startIndex != endIndex) {
highestHigh = 0.0;
lowestLow = 0.0;
ps1 = 0.0;
pa1 = 0.0;
reCalcSignal = True;
reCalcTime = 0;
highestHighReCalcSignal = True;
lowestLowReCalcSignal = True;
}

for (i = startIndex; i < endIndex + 1; i++ ) {

todayHigh_history_tmp = High;
todayLow_history_tmp = Low;
today_history_PreClose =Close;

if ( reCalcSignal AND TimeNum() > reCalcTime) {

if (highestHighReCalcSignal) {
lowestLow=99999999;
if (lowestLowReCalcSignal) {
highestHigh = -99999999;
}
highestHighReCalcSignal = False;
lowestLowReCalcSignal = False;
reCalcSignal = False;
}

if (todayHigh_history_tmp >= highestHigh) {
highestHigh = todayHigh_history_tmp;
highest_csbdl = (highestHigh +todayLow_history_tmp+today_history_PreClose)/3;
ps1= highestHigh+highest_csbdl*0.236;

}

if (todayLow_history_tmp <= lowestLow) {
lowestLow = todayLow_history_tmp;
lowest_csbdl = (highestHigh +todayLow_history_tmp+today_history_PreClose)/3;
pa1 = lowestLow+lowest_csbdl*0.236;

}

if ((todayLow_history_tmp < pa1) OR (todayHigh_history_tmp > ps1)) {
reCalcSignal = True;
reCalcTime = TimeNum();

if (todayHigh_history_tmp >ps1) {
highestHighReCalcSignal = True;
highestHigh = todayHigh_history_tmp;
highest_csbdl = (highestHigh +todayLow_history_tmp+today_history_PreClose)/3;
ps1= highestHigh+ highest_csbdl*0.236;

}
if (todayLow_history_tmp <pa1) {
lowestLowReCalcSignal = True;
lowestLow = todayLow_history_tmp;
lowest_csbdl = (highestHigh +todayLow_history_tmp+today_history_PreClose)/3;
pa1 = lowestLow+lowest_csbdl*0.236;

}
}


output1 = ps1;
output2 = pa1;

}


Plot( output1 , "",22,styleNoLine );
Plot( output2 , "",22,styleNoLine );

Viewing all articles
Browse latest Browse all 10287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>