Alain you're right sorry.
This is my code:
bool checkBuySignal(){ if(active && (activeTrades <= maxPositions) && (SymbolInfoInteger(Symbol(), SYMBOL_SPREAD) <= maxSpread) && (TimeLocal() > TimeStampLastTrade+40)){ return true; } else { return false; } }
extern int maxSpread is 5
It returns true and prints current spread of 7
But you're right in the situation i posted above it works all right. Don't understand :(
Alain you're right sorry.
This is my code:
extern int maxSpread is 5
It returns true and prints current spread of 7
But you're right in the situation i posted above it works all right. Don't understand :(
I still can't help you as you don't post all the relevant code.
Are you sure maxSpread is 5 at the time this code is executed ?
thank you i found out what the problem is.
the spread changes between the statement and the ordersend (within 1 tick)
I have no idea why someone would delete my code?
Well, here it is again.
if( (MarketInfo(NULL,MODE_SPREAD) < 5)) { MarketInfo(NULL,MODE_TRADEALLOWED); return; };
I have no idea why someone would delete my code?
Well, here it is again.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi is it possible to only open a position when spread for example is less than 5?
I tried that with
and in buy() i do
and it shows me also values higher than 5
Does anyone know what is wrong?