While Loop not running
The following is while loop code that I have written for a project. No errors are popping up when and everything with the code appears to be fine but it never actually completes running. I am very stuck and would greatly appreciate some help. Here is my code:
i=3;
while i <= length(Datamatrix)
if isTwoInsideDays == true
L_entry_price = prevInsideDayHigh(i) + 0.0010;
L_stop_loss = prevInsideDayLow(i) – 0.0010; % Stop 10 pips below
L_take_profit = L_entry_price + 2 * (L_stop_loss – L_entry_price);
i=i+1;
while Close>L_entry_price==false;
i=i+1;
end
Signal(i)=1;
i=i+1;
while (Close(i) > L_take_profit || Close(i) < L_stop_loss) == false
i=i+1;
end
Signal(i)=-1;
end
endThe following is while loop code that I have written for a project. No errors are popping up when and everything with the code appears to be fine but it never actually completes running. I am very stuck and would greatly appreciate some help. Here is my code:
i=3;
while i <= length(Datamatrix)
if isTwoInsideDays == true
L_entry_price = prevInsideDayHigh(i) + 0.0010;
L_stop_loss = prevInsideDayLow(i) – 0.0010; % Stop 10 pips below
L_take_profit = L_entry_price + 2 * (L_stop_loss – L_entry_price);
i=i+1;
while Close>L_entry_price==false;
i=i+1;
end
Signal(i)=1;
i=i+1;
while (Close(i) > L_take_profit || Close(i) < L_stop_loss) == false
i=i+1;
end
Signal(i)=-1;
end
end The following is while loop code that I have written for a project. No errors are popping up when and everything with the code appears to be fine but it never actually completes running. I am very stuck and would greatly appreciate some help. Here is my code:
i=3;
while i <= length(Datamatrix)
if isTwoInsideDays == true
L_entry_price = prevInsideDayHigh(i) + 0.0010;
L_stop_loss = prevInsideDayLow(i) – 0.0010; % Stop 10 pips below
L_take_profit = L_entry_price + 2 * (L_stop_loss – L_entry_price);
i=i+1;
while Close>L_entry_price==false;
i=i+1;
end
Signal(i)=1;
i=i+1;
while (Close(i) > L_take_profit || Close(i) < L_stop_loss) == false
i=i+1;
end
Signal(i)=-1;
end
end while loop MATLAB Answers — New Questions