keep my high and low (help please)
may be you can try to save them in a file
may be this might help you https://docs.mql4.com/files
Hi guys
Im trying to find high and low of the last 10 bars then keep the value and wait until the price cross it up or down, but I'm losing the value of the high or low, can someone suggest me something
please
Try this:
if(save_my_high_value) GlobalVariableSet("high_last_10", iHigh(Symbol(),PERIOD_H1,iHighest(Symbol(),PERIOD_H1,MODE_HIGH,10,0))); //... // later on, ... You can even shutdown the terminal. double the_highest_bar = GlobalVariableGet("high_last_10"); if(Ask>the_highest_bar) do_something_with_it();
You don't need global variables or statics (persistent storage)
im trying to find high and low of the last 10 bars then keep the value and wait until the price cross it up or down
int start(){ int iLL = Lowest(NULL,0, MODE_LOW, 10, 1), iHH = Highest(NULL,0, MODE_HIGH, 10, 1); double LL = Low[iLL], HH = High[iHH]; if (Bid > HH){ ... } else if (Bid < HH){ ... } // else return and wait. }
Hi guys
Im trying to find high and low of the last 10 bars then keep the value and wait until the price cross it up or down, but I'm losing the value of the high or low, can someone suggest me something
please