Maybe you missed only the // in this line?
Print("y ",y); PRINT ONLY FIRST THAT IS ABOVE X
Seems to me this is a 2 second answer from someone who knows and I think its a continue issue, maybe its not. How do I use the x from the first for inside the second for loop so that if y is greater to x it lists as correctly? Need it to print from 2 onward, and only once, correctly.
I dont want to just save to a variable and just use in the next for loop when it seems to be a continue thing however its been 4 hours, already checked official docs, didn't solve my issue, I just can't afford more time if its just a 2 second answer
THX
Maybe you missed only the // in this line?
For the future: please show exactly where the problem is (e.g. line number) e.g. by posting the leg entry as well.How do I do that I just copy from src hit CODE button and paste then click insert; checked out the top buttons where is the line numbers button? How'd you do it?
Anyway, issue is on the PRINT of the y value need it to be just a 2
//+------------------------------------------------------------------+ //| bla.mq4 | //| Copyright 2020, MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2020, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.00" #property strict //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--- for(int x=0; x<100; x++) { if(x==1) break; // HOW DO I USE CONTINUE TO HAVE IT GO FORWARD AND NO MORE X'S for(int y=0; y<100; y++) if(y>x) // DEAL WITH THE PREVIOUS DETERMINED X AND FINALLY Print("y ",y); // PRINT ONLY FIRST THAT IS ABOVE X break; //ONLY ONCE } } //+------------------------------------------------------------------+
use continue operator while x is less than equal 1 and create a condition inside x that will be updated by y iteration when the condition is met to break the x iteration
trying to figure this out thx
[SOLVED]
for(int x=0; x<100; x++) { if(x==1) for(int y=0; y<100; y++) if(y>x) { Print("y ",y); break; } }
[SOLVED]

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Seems to me this is a 2 second answer from someone who knows and I think its a continue issue, maybe its not. How do I use the x from the first for inside the second for loop so that if y is greater to x it lists as correctly? Need it to print from 2 onward, and only once, correctly.
I dont want to just save to a variable and just use in the next for loop when it seems to be a continue thing however its been 4 hours, already checked official docs, didn't solve my issue, I just can't afford more time if its just a 2 second answer
THX