• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 9:01am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 9:01am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Need Help: Array to get the Longest Green Bar Value of a Loop 20 replies

Simple Question about For Loops 14 replies

Help with EA (FOR LOOP Problem) 0 replies

Trouble with While Loops? 3 replies

Loops: while vs. for 7 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 13
Attachments: Need Help : Merge 2 Loops into 1 Loop
Exit Attachments
Tags: Need Help : Merge 2 Loops into 1 Loop
Cancel

Need Help : Merge 2 Loops into 1 Loop

  • Last Post
  •  
  • 1 Page 2 3
  • 1 Page 2 3
  •  
  • Post #21
  • Quote
  • Dec 3, 2021 8:59am Dec 3, 2021 8:59am
  •  Kafin
  • Joined Mar 2013 | Status: Member | 106 Posts
With my understanding, I wont code the second loop the way you are doing. A forward-looking logic (MA based on cn-1, cn-2 index) is not very practical

As you can see, the coders that tried to assist you are not very clear of what you are doing. If you cannot post your source code, at least describe what you want this module to achieve instead of forcing everyone to think along the original idea you had.

What are you trying to find and when do you want it to be displayed?
 
 
  • Post #22
  • Quote
  • Edited 9:45am Dec 3, 2021 9:29am | Edited 9:45am
  •  chimoong
  • | Joined May 2016 | Status: Member | 245 Posts
Quoting Kafin
Disliked
With my understanding, I wont code the second loop the way you are doing. A forward-looking logic (MA based on cn-1, cn-2 index) is not very practical As you can see, the coders that tried to assist you are not very clear of what you are doing. If you cannot post your source code, at least describe what you want this module to achieve instead of forcing everyone to think along the original idea you had. What are you trying to find and when do you want it to be displayed?
Ignored
Hi Kafin

FxAnalysis' source codes are here https://www.forexfactory.com/thread/...7#post13801247 ... in fact, FxAnalysis' codes have met my requirements but I need a little bit of further mod / fine tune ...

I'm the beginner without programming background, in learning stage. I have my ideas how to make use of the codes. Of course, if you have better ideas (not to use MA based on cn-1, cn-2 index), you're welcome to write down your codes and I will test it, thanks so much.
 
 
  • Post #23
  • Quote
  • Dec 3, 2021 9:44am Dec 3, 2021 9:44am
  •  Kafin
  • Joined Mar 2013 | Status: Member | 106 Posts
Quoting chimoong
Disliked
{quote} Hi Kafin FxAnalysis' source codes are here https://www.forexfactory.com/thread/...7#post13801247 ... in fact, FxAnalysis' codes have met my requirements but I need a little bit of further mod / fine tune ... I'm the beginner without programming background, in learning stage. I have my ideas how to make use of the codes. Of course, if you have better ideas, you may write down your codes and I will test it, thanks so much.
Ignored
That is your logic, I will bet that none of the coders that have responded clearly see what you need because you have not given much description, otherwise you should have a working solution by now.

You have two conditions and need to merge them together - I might be wrong, and that is why I asked you to describe what you want to achieve.

With an MA that uses cn-1, cn-2, cn-3 index, when (at which point) would you mark the conditions as being satisfied?
 
 
  • Post #24
  • Quote
  • Edited 10:02am Dec 3, 2021 9:52am | Edited 10:02am
  •  chimoong
  • | Joined May 2016 | Status: Member | 245 Posts
Quoting Kafin
Disliked
{quote} That is your logic, I will bet that none of the coders that have responded clearly see what you need because you have not given much description, otherwise you should have a working solution by now. You have two conditions and need to merge them together - I might be wrong, and that is why I asked you to describe what you want to achieve. With an MA that uses cn-1, cn-2, cn-3 index, when (at which point) would you mark the conditions as being satisfied?
Ignored
Hi Kafin, you're right, I have two conditions of loops that needed to merge for a bull trend :-
1) Start with 2 MA-drop and to the right, end with another 2 MA-drop.
2) In between the (1) above, there must be 4 minimum strong green bars Cs0-Op0>=ATR0, of course, it can be 4, 5, 6, 7 or more strong green bars.

What I want to get is the 2 bars' shifts (MAStartSf and MAEndSf) : https://www.forexfactory.com/attachm...7&d=1638529043
 
 
  • Post #25
  • Quote
  • Dec 3, 2021 10:05am Dec 3, 2021 10:05am
  •  skillz16
  • Joined Mar 2015 | Status: Member | 1,422 Posts
Is this based on some sort of indicator? A zig-zag perhaps? *Worth noting that a lot of those "repaint" the latest bar usually, and so are often garbage and not usable. *Or if you do/did use them, you always need to look a bar back in the past for the signal... IE on a chart they would look A TON better than they always are.

Is this based on an indicator though? If so, then you could look at those values that return from the indicator script to figure this out, rather than re-coding a lot of things.
 
 
  • Post #26
  • Quote
  • Edited 10:29am Dec 3, 2021 10:12am | Edited 10:29am
  •  chimoong
  • | Joined May 2016 | Status: Member | 245 Posts
Quoting skillz16
Disliked
Is this based on some sort of indicator? A zig-zag perhaps? *Worth noting that a lot of those "repaint" the latest bar usually, and so are often garbage and not usable. *Or if you do/did use them, you always need to look a bar back in the past for the signal... IE on a chart they would look A TON better than they always are. Is this based on an indicator though? If so, then you could look at those values that return from the indicator script to figure this out, rather than re-coding a lot of things.
Ignored
Hi skillz16, nothing to do with any indicators, the codes (2 sets of conditions of loops to be merged into one loop) are purely from my ideas / brain. It doesn't repaint as the 2 bars' shifts (MAStartSf and MAEndSf) are the past candles. I use the two shifts as my benchmark for decision making .... Zig-zag is in different direction / concept, not what I want, LOL.

In fact, the coder Fxanalysis had already given me the answers but it has its shortfall, needed to fine tune further, I really appreciate Fxanalysis' codes.
 
 
  • Post #27
  • Quote
  • Dec 3, 2021 10:13am Dec 3, 2021 10:13am
  •  Kafin
  • Joined Mar 2013 | Status: Member | 106 Posts
Quoting chimoong
Disliked
{quote} Hi Kafin, you're right, I have two conditions of loops that needed to merge for a bull trend :- 1) Start with 2 MA-drop and to the right, end with another 2 MA-drop. 2) In between the (1) above, there must be 4 minimum strong green bars Cs0-Op0>=ATR0, of course, it can be 4, 5, 6, 7 or more strong green bars. What I want to get is the 2 bars' shifts (MAStartSf and MAEndSf) : https://www.forexfactory.com/attachm...7&d=1638529043
Ignored
I would take the most-recent "2 MA-drop" as MAEndSf. Then search previous bars for the next "2 MA-drop" this is your MAStartSf
Search between them for the number of bullish bars

What information is this suppose to provide?
 
 
  • Post #28
  • Quote
  • Dec 3, 2021 10:15am Dec 3, 2021 10:15am
  •  chimoong
  • | Joined May 2016 | Status: Member | 245 Posts
Quoting Kafin
Disliked
{quote} I would take the most-recent "2 MA-drop" as MAEndSf. Then search previous bars for the next "2 MA-drop" this is your MAStartSf Search between them for the number of bullish bars What information is this suppose to provide?
Ignored
Hi Kafin, I cannot imagine how's your ideas, please go ahead to write down your codes and I'll test it, thank you.
 
 
  • Post #29
  • Quote
  • Dec 3, 2021 12:54pm Dec 3, 2021 12:54pm
  •  Kafin
  • Joined Mar 2013 | Status: Member | 106 Posts
Quoting chimoong
Disliked
{quote} Hi Kafin, I cannot imagine how's your ideas, please go ahead to write down your codes and I'll test it, thank you.
Ignored
You haven't my question -- What information is this suppose to provide?

I don't think I should spend hours writing code for you, and not get anything in return -- most especially when I believe that the code will eventually be thrown away.
 
 
  • Post #30
  • Quote
  • Dec 3, 2021 1:07pm Dec 3, 2021 1:07pm
  •  fxanalysis
  • Joined Jan 2017 | Status: fxa | 286 Posts
In the 2nd loop at the end of everything
add an if to check if search has reached last candle
if loop while condition is ;cn>=1;cn--)
then add an if like this

if(cn==1&&checkStart){
cnGrn=0; MA2Dp1UpSf=0;}
Know thyself
 
 
  • Post #31
  • Quote
  • Dec 3, 2021 1:19pm Dec 3, 2021 1:19pm
  •  fxanalysis
  • Joined Jan 2017 | Status: fxa | 286 Posts
Sorry forgot to add one thing - turn checkStart to false in if
if(cn==1&&checkStart){
checkStart=false; cnGrn=0; MA2Dp1UpSf=0;}
Know thyself
 
 
  • Post #32
  • Quote
  • Edited 2:20pm Dec 3, 2021 1:42pm | Edited 2:20pm
  •  chimoong
  • | Joined May 2016 | Status: Member | 245 Posts
Quoting fxanalysis
Disliked
Sorry forgot to add one thing - turn checkStart to false in if if(cn==1&&checkStart){ checkStart=false; cnGrn=0; MA2Dp1UpSf=0;}
Ignored
Hi Fxanalysis, thanks for your reply. I amended the codes as follows but with errors :-

1) I changed the name of MA2Dp1UpSf to "MAStrSf"

2) I added the following codes prior to "END OF TREND" text.

if(cn==1 && checkStart){
checkStart=false; cnGrn=0; MAStrSf=0;}

Inserted Code
   int minGrn=4;
   int MAStrSf=0;
   int cnGrn=0;
   bool checkStart=false;
   bool signalFound=false;
   for(int i=4; i<=600; i++) {
   double MA0=iMA(symbol,5,5,0,3,0,i), MA1=iMA(symbol,5,5,0,3,0,i+1);
   double MA2=iMA(symbol,5,5,0,3,0,i+2), MA3=iMA(symbol,5,5,0,3,0,i+3);
   if(!checkStart){
      if(MA0>MA1 && MA1<=MA2 && MA2<=MA3) {
         MAStrSf=i; // MA 2-drop 1-Up
         checkStart=true;
         }
      }
   else //check start=true
      for(int cn=i; cn>=1; cn--) {
      double Op0=iOpen(symbol,5,cn), Cs0=iClose(symbol,5,cn);
      double ATR0=iATR(symbol,5,5,cn), MAn1=iMA(symbol,5,5,0,3,0,cn-1);
      double MAn2=iMA(symbol,5,5,0,3,0,cn-2), MAn3=iMA(symbol,5,5,0,3,0,cn-3);
      if(MAn1<=MathMax(MAn2,MAn3)) {
         if(Cs0-Op0>=ATR0) {
            cnGrn++;
            }
 
      if(cn==1 && checkStart){
      checkStart=false; cnGrn=0; MAStrSf=0;}
 
         } else { // END OF TREND
         if(cnGrn>=minGrn) {
            signalFound=true;
            break;
            }
            else {
            checkStart=false;
            cnGrn=0;
            MAStrSf=0;
            }
         } // Count No. of Big Green bars and stops at next MA 2-drop
      }
   if(signalFound) break;
   }

How about as per my new request on "int MAEndSf=0;" to get the last bar's shift as per this pic https://www.forexfactory.com/attachm...7&d=1638529043 ?

Thanks
Attached Image (click to enlarge)
Click to Enlarge

Name: bbb.png
Size: 65 KB
 
 
  • Post #33
  • Quote
  • Dec 3, 2021 1:51pm Dec 3, 2021 1:51pm
  •  chimoong
  • | Joined May 2016 | Status: Member | 245 Posts
Quoting Kafin
Disliked
{quote} You haven't my question -- What information is this suppose to provide? I don't think I should spend hours writing code for you, and not get anything in return -- most especially when I believe that the code will eventually be thrown away.
Ignored
Thanks Kafin, sorry, I don't really understand your "What information is this suppose to provide?". My original request is at my 1st post : https://www.forexfactory.com/thread/...2-loops-into-1 and all the information are here ...
 
 
  • Post #34
  • Quote
  • Dec 3, 2021 2:05pm Dec 3, 2021 2:05pm
  •  Kafin
  • Joined Mar 2013 | Status: Member | 106 Posts
Quoting chimoong
Disliked
{quote} Thanks Kafin, sorry, I don't really understand your "What information is this suppose to provide?". My original request is at my 1st post : https://www.forexfactory.com/thread/...2-loops-into-1 and all the information are here ...
Ignored
Why are you interested in knowing (or getting notified) when this condition(s) are met, how does it help your trading decision(s)

People don't discuss the reasons behind their idea, they just want a code. But if we can combine few reasonable ideas, we can come up with a winning solution - I think
 
 
  • Post #35
  • Quote
  • Dec 3, 2021 2:16pm Dec 3, 2021 2:16pm
  •  chimoong
  • | Joined May 2016 | Status: Member | 245 Posts
Quoting Kafin
Disliked
{quote} Why are you interested in knowing (or getting notified) when this condition(s) are met, how does it help your trading decision(s) People don't discuss the reasons behind their idea, they just want a code. But if we can combine few reasonable ideas, we can come up with a winning solution - I think
Ignored
I use the two shifts (MAStartSf and MAEndSf) as my benchmark for trading decision making after confirmation of a strong bull trend ...
 
 
  • Post #36
  • Quote
  • Dec 3, 2021 2:59pm Dec 3, 2021 2:59pm
  •  fxanalysis
  • Joined Jan 2017 | Status: fxa | 286 Posts
Quoting chimoong
Disliked
{quote} Hi Fxanalysis, thanks for your reply. I amended the codes as follows but with errors :- 1) I changed the name of MA2Dp1UpSf to "MAStrSf" 2) I added the following codes prior to "END OF TREND" text. if(cn==1 && checkStart){ checkStart=false; cnGrn=0; MAStrSf=0;} int minGrn=4; int MAStrSf=0; int cnGrn=0; bool checkStart=false; bool signalFound=false; for(int i=4; i<=600; i++) { double MA0=iMA(symbol,5,5,0,3,0,i), MA1=iMA(symbol,5,5,0,3,0,i+1); double MA2=iMA(symbol,5,5,0,3,0,i+2), MA3=iMA(symbol,5,5,0,3,0,i+3); if(!checkStart){ if(MA0>MA1...
Ignored
You added the if in the wrong place..
What I meant was inside the loop after all the existing code.
And again there was problem with i>=1 and iMA(1-3 shift?)

Inserted Code
   int minGrn=4;
   int MAStrSf=0;
   int cnGrn=0;
   bool checkStart=false;
   bool signalFound=false;
   for(int i=4; i<=600; i++) {
   double MA0=iMA(symbol,5,5,0,3,0,i), MA1=iMA(symbol,5,5,0,3,0,i+1);
   double MA2=iMA(symbol,5,5,0,3,0,i+2), MA3=iMA(symbol,5,5,0,3,0,i+3);
   if(!checkStart){
      if(MA0>MA1 && MA1<=MA2 && MA2<=MA3) {
         MAStrSf=i; // MA 2-drop 1-Up
         checkStart=true;
         }
      }
   else //check start=true
      for(int cn=i; cn>=4; cn--) {
      double Op0=iOpen(symbol,5,cn), Cs0=iClose(symbol,5,cn);
      double ATR0=iATR(symbol,5,5,cn), MAn1=iMA(symbol,5,5,0,3,0,cn-1);
      double MAn2=iMA(symbol,5,5,0,3,0,cn-2), MAn3=iMA(symbol,5,5,0,3,0,cn-3);
      if(MAn1<=MathMax(MAn2,MAn3)) {
         if(Cs0-Op0>=ATR0) {
            cnGrn++;
            }
            } 
         else { // END OF TREND
         if(cnGrn>=minGrn) {
            signalFound=true;
            break;
            }
            else {
            checkStart=false;
            cnGrn=0;
            MAStrSf=0;
            }
         } // Count No. of Big Green bars and stops at next MA 2-drop
         
      if(cn==4 && checkStart){
      checkStart=false; cnGrn=0; MAStrSf=0;}
      }
   if(signalFound) break;
   }
Know thyself
 
 
  • Post #37
  • Quote
  • Edited 4:15pm Dec 3, 2021 3:43pm | Edited 4:15pm
  •  chimoong
  • | Joined May 2016 | Status: Member | 245 Posts
Quoting fxanalysis
Disliked
{quote} You added the if in the wrong place.. What I meant was inside the loop after all the existing code. And again there was problem with i>=1 and iMA(1-3 shift?) int minGrn=4; int MAStrSf=0; int cnGrn=0; bool checkStart=false; bool signalFound=false; for(int i=4; i<=600; i++) { double MA0=iMA(symbol,5,5,0,3,0,i), MA1=iMA(symbol,5,5,0,3,0,i+1); double MA2=iMA(symbol,5,5,0,3,0,i+2), MA3=iMA(symbol,5,5,0,3,0,i+3); if(!checkStart){ if(MA0>MA1 && MA1<=MA2 && MA2<=MA3) { MAStrSf=i; // MA 2-drop 1-Up checkStart=true; } } else //check start=true for(int...
Ignored
Hi Fxanalysis, I have changes to drop the signal conditions for my testing and observation purposes such as minGrn=3 and Cs0-Op0>=ATR0*0.8 (conditions are easily achievable).

Inserted Code
   int minGrn=3; // (changed)
   int MAStrSf=0;
   int cnGrn=0;
   bool checkStart=false;
   bool signalFound=false;
 
   for(int i=1; i<=600; i++) {
   double MA0=iMA(symbol,5,5,0,3,0,i), MA1=iMA(symbol,5,5,0,3,0,i+1);
   double MA2=iMA(symbol,5,5,0,3,0,i+2), MA3=iMA(symbol,5,5,0,3,0,i+3);
   if(!checkStart){
      if(MA0>MA1 && MA1<=MA2 && MA2<=MA3) {
         MAStrSf=i; // MA 2-drop 1-Up
         checkStart=true;
         }
      }
   else //check start=true
      for(int cn=i; cn>=4; cn--) {
      double Op0=iOpen(symbol,5,cn), Cs0=iClose(symbol,5,cn);
      double ATR0=iATR(symbol,5,5,cn), cMA0=iMA(symbol,5,5,0,3,0,cn); // (changed)
      double cMA1=iMA(symbol,5,5,0,3,0,cn+1), cMA2=iMA(symbol,5,5,0,3,0,cn+2); // (changed)
      if(!(cMA0<cMA1 && cMA1<=cMA2)) { // (changed)
         if(Cs0-Op0>=ATR0*0.8) { // (changed)
            cnGrn++;
            }
            }
         else { // END OF TREND
         if(cnGrn>=minGrn) {
            signalFound=true;
            break;
            }
            else {
            checkStart=false;
            cnGrn=0;
            MAStrSf=0;
            }
         } // Count No. of Big Green bars and stops at next MA 2-drop
        
      if(cn==4 && checkStart){
      checkStart=false; cnGrn=0; MAStrSf=0;}
      }
   if(signalFound) break;
   }

Kindly have a look at my pic, something is wrong ...

1) Since the required conditions are dropped, not supposedly have so many symbols (total 33 pairs) = 0 (the output), instead, if the recent bars have not met such conditions, the codes should carry on to the left to look for the complete formation of the conditions. I supposed all the 33 pairs should have a value of MAStrSf because I have set to look for 600 bars.

2) I notice that the shift of MAStrSf for many pairs are not correct.

3) when come to counting of minimum strong green bars, I set minGrn=3, but I noticed that some of the pairs only have 2 strong green bars.

4) Kindly do not forget about my new request on "int MAEndSf=0;, the last bar's shift of the trend, i.e the end of the Bull trend.

5) again, if the current bull trend is running and there is no 2 MA-drop, the codes yet indicate the MAStartSf for the current trend, kindly refer to this pic https://www.forexfactory.com/attachm...0&d=1638559234 for better understanding.

Kindly help to look into it, thanks.
Attached Image (click to enlarge)
Click to Enlarge

Name: aaa.png
Size: 51 KB
 
 
  • Post #38
  • Quote
  • Dec 4, 2021 5:41am Dec 4, 2021 5:41am
  •  chimoong
  • | Joined May 2016 | Status: Member | 245 Posts
Hi Fxanalysis,

Refer to point (1) above and as per pic above https://www.forexfactory.com/attachm...0&d=1638564226 , I eased the signal conditions (minGrn=3 and Cs0-Op0>=ATR0*0.8), therefore these conditions are easily achievable for any trade by setting the max bars to 600, in other words, definitely or 100% of each pair should have a MAStartSf value, but if the output is 0 or 600, definitely is wrong.

Let me illustrate with attached picture, thanks.
Attached Image (click to enlarge)
Click to Enlarge

Name: aaa.png
Size: 39 KB
 
 
  • Post #39
  • Quote
  • Dec 4, 2021 5:45am Dec 4, 2021 5:45am
  •  fxanalysis
  • Joined Jan 2017 | Status: fxa | 286 Posts
added end shift
Inserted Code
   int minGrn=3; // (changed)
   int MAStrSf=0;
   int MAEndSf = 0;
   int cnGrn=0;
   bool checkStart=false;
   bool signalFound=false;
 
   for(int i=1; i<=600; i++) {
   double MA0=iMA(symbol,5,5,0,3,0,i), MA1=iMA(symbol,5,5,0,3,0,i+1);
   double MA2=iMA(symbol,5,5,0,3,0,i+2), MA3=iMA(symbol,5,5,0,3,0,i+3);
   if(!checkStart){
      if(MA0>MA1 && MA1<=MA2 && MA2<=MA3) {
         MAStrSf=i; // MA 2-drop 1-Up
         checkStart=true;
         }
      }
   else //check start=true
      for(int cn=i; cn>=4; cn--) {
      double Op0=iOpen(symbol,5,cn), Cs0=iClose(symbol,5,cn);
      double ATR0=iATR(symbol,5,5,cn), cMA0=iMA(symbol,5,5,0,3,0,cn); // (changed)
      double cMA1=iMA(symbol,5,5,0,3,0,cn+1), cMA2=iMA(symbol,5,5,0,3,0,cn+2); // (changed)
      if(!(cMA0<cMA1 && cMA1<=cMA2)) { // (changed)
         if(Cs0-Op0>=ATR0*0.8) { // (changed)
            cnGrn++;
            }
            }
         else { // END OF TREND
         MAEndSf=cn;
         if(cnGrn>=minGrn) {
            signalFound=true;
            break;
            }
            else {
            checkStart=false;
            cnGrn=0;
            MAStrSf=0;
            MAEndSf=0;
            }
         } // Count No. of Big Green bars and stops at next MA 2-drop
        
      if(cn==4 && checkStart){
      checkStart=false; cnGrn=0; MAStrSf=0;MAEndSf=0;}
      }
   if(signalFound) break;
   }
Know thyself
 
 
  • Post #40
  • Quote
  • Dec 4, 2021 5:52am Dec 4, 2021 5:52am
  •  fxanalysis
  • Joined Jan 2017 | Status: fxa | 286 Posts
just added break; in one more place. Originally it was not needed there, as the code was made to be in one loop only, but now because there is a second loop it is needed to stop the second loop.


Inserted Code
   int minGrn=3; // (changed)
   int MAStrSf=0;
   int MAEndSf = 0;
   int cnGrn=0;
   bool checkStart=false;
   bool signalFound=false;
 
   for(int i=1; i<=600; i++) {
   double MA0=iMA(symbol,5,5,0,3,0,i), MA1=iMA(symbol,5,5,0,3,0,i+1);
   double MA2=iMA(symbol,5,5,0,3,0,i+2), MA3=iMA(symbol,5,5,0,3,0,i+3);
   if(!checkStart){
      if(MA0>MA1 && MA1<=MA2 && MA2<=MA3) {
         MAStrSf=i; // MA 2-drop 1-Up
         checkStart=true;
         }
      }
   else //check start=true
      for(int cn=i; cn>=4; cn--) {
      double Op0=iOpen(symbol,5,cn), Cs0=iClose(symbol,5,cn);
      double ATR0=iATR(symbol,5,5,cn), cMA0=iMA(symbol,5,5,0,3,0,cn); // (changed)
      double cMA1=iMA(symbol,5,5,0,3,0,cn+1), cMA2=iMA(symbol,5,5,0,3,0,cn+2); // (changed)
      if(!(cMA0<cMA1 && cMA1<=cMA2)) { // (changed)
         if(Cs0-Op0>=ATR0*0.8) { // (changed)
            cnGrn++;
            }
            }
         else { // END OF TREND
         MAEndSf=cn;
         if(cnGrn>=minGrn) {
            signalFound=true;
            break;
            }
            else {
            checkStart=false;
            cnGrn=0;
            MAStrSf=0;
            MAEndSf=0;
            break;
            }
         } // Count No. of Big Green bars and stops at next MA 2-drop
        
      if(cn==4 && checkStart){
      checkStart=false; cnGrn=0; MAStrSf=0;MAEndSf=0;}
      }
   if(signalFound) break;
   }
Know thyself
 
 
  • Platform Tech
  • /
  • Need Help : Merge 2 Loops into 1 Loop
  • Reply to Thread
    • 1 Page 2 3
    • 1 Page 2 3
0 traders viewing now
  • More
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023