if (Volume[0]>1) return(0);
For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart,) volume is unreliable (miss ticks,) Price is unreliable (duplicate prices and The == operand. - MQL4 and MetaTrader 4 - MQL4 programming forum.) Always use time.
I disagree with making a new bar function, because it can only be called once per tick. A variable can be tested multiple times.
New candle - MQL4 and MetaTrader 4 - MQL4 programming forumticket=OrderSend(Symbol(),OP_BUY,LotSize*addLot,Ask,2,0,0,"Nothing",MagicNumber,0,Blue); OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
Check your return codes for errors, and report them including GLE/LE. Don't look at it unless you have an error. Don't just silence the compiler, it is trying to help you.
What are Function return values ? How do I use them ? - MQL4 and MetaTrader 4 - MQL4 programming forum
Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
Only those functions that return a value (e.g. iClose, MarketInfo, etc.) must you call ResetLastError before in order to check after.
-
For a new bar test, Bars is unreliable (a refresh/reconnect can change
number of bars on chart,) volume is unreliable (miss ticks,) Price is unreliable
(duplicate prices and The == operand. -
MQL4 and MetaTrader 4 - MQL4 programming forum.)
Always use time.
I disagree with making a new bar function, because it can only be called once per tick. A variable can be tested multiple times.
New candle - MQL4 and MetaTrader 4 - MQL4 programming forum -
Check your return codes for errors, and report them including GLE/LE.
Don't look at it unless you have an error.
Don't just silence the compiler, it is trying to help you.
What are Function return values ? How do I use them ? - MQL4 and MetaTrader 4 - MQL4 programming forum
Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
Only those functions that return a value (e.g. iClose, MarketInfo, etc.) must you call ResetLastError before in order to check after.
Thanks whroeder1.
My problem has been resolved.
I replaced the code below and deleted the code ((( if (voulme[0]>1) ))).
datetime Time0 = 0; void start() { if (Time0 != Time[0] && iRSI(NULL,0,4,PRICE_CLOSE,2)<30 && iRSI(NULL,0,4,PRICE_CLOSE,1)>30 ) { ticket=OrderSend(Symbol(),OP_BUY,LotSize*addLot,Ask,2,0,0,"Nothing",MagicNumber,0,Blue); Time0 = Time[0]; }
Can you tell me that code:
modify stoploss :
every buy and sell orders open , when market goes up buy order stoploss will go up distance pips to distance pips
and when every open sell order market goes down stoploss will go down distance to distance pips every signal order.
Can you tell me that code:
modify stoploss :
every buy and sell orders open , when market goes up buy order stoploss will go up distance pips to distance pips
and when every open sell order market goes down stoploss will go down distance to distance pips every signal order.
I don't have stoploss.
my profit is small and I think I do not need it.I use martingle.
- 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
I wrote a program that works well in the tester strategy.
When the price falls below the order open price, buy again.
Can you guide me?
Thanks.