int time_candle=0;
int start()
{ //time_candle =GlobalVariableGet("time_candle");
if(time_candle!=iTime(Symbol(),PERIOD_D1,0) )
{
if(your_buying_condition) {
ordersend....
time_candle = iTime(Symbol(),PERIOD_D1,0)
//GlobalVariableSet("time_candle", time_candle);
}
if(your_selling_condition) {
ordersend....
time_candle = iTime(Symbol(),PERIOD_D1,0)
//GlobalVariableSet("time_candle", time_candle);
}
}
}
//this approach is ok if terminal does not crash, otherwise it can still submit another trade because time_candle is set to zero again a terminal power up. In order to always work, you should use global variables, which is the code at the comment chars "//"
int time_candle=0;
int start()
{ //time_candle =GlobalVariableGet("time_candle");
if(time_candle!=iTime(Symbol(),PERIOD_D1,0) )
{
if(your_buying_condition) {
ordersend....
time_candle = iTime(Symbol(),PERIOD_D1,0)
//GlobalVariableSet("time_candle", time_candle);
}
if(your_selling_condition) {
ordersend....
time_candle = iTime(Symbol(),PERIOD_D1,0)
//GlobalVariableSet("time_candle", time_candle);
}
}
}
//this approach is ok if terminal does not crash, otherwise it can still submit another trade because time_candle is set to zero again a terminal power up. In order to always work, you should use global variables, which is the code at the comment chars "//"
Many thanx Ill give it a try.
Many thanx Ill give it a try.
Thanx absract_mind, the code works a charm!
- 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 am having trouble making this EA take only 1 trade per daily bar.
I have used the code suggested by various posts here on the forum, but it continues to take multiple trades per daily bar.
Please help me make this ea trade once a day.
thanx