Forum

script to close orders once and only when new bar detected

Hi, I am trying to create a simple script that closes all existing orders once and only when a new bar is detected. But my code below always get executed even when new bar is same as old bar. Thanks to help. static int old_bars = 0 ; // remember the amount of bars already known if (old_bars != Bars

Place order based on distance to current bar open and Max Spread with timer.

I'm a beginner with MQL4. Basically I would like to create a loop that monitor the Ask price for each tick on a chart and only trigger a BUY market order when 1. The price distance to the current Open bar(Ask) is less than 2 pips AND 2. The current spread is less more than 2 pips. Also I want to

Help with repainting ex4 inicators

Hi, I have this 2 indicators that I have found on the net, they are very good but they repaint, I was wondering if someone could convert them to mql4 and to improve the repainting. I have tried to use decompilers but without success. Thanks