RaptorUK:
Don't use Bars . . . it's not a reliable method, use time instead. You can use one variable for Buys, one for Sells.
Don't use Bars . . . it's not a reliable method, use time instead. You can use one variable for Buys, one for Sells.
How can i do it with time instead? thx
rozirozi:
How can i do it with time instead? thx
How do you THINK?How can i do it with time instead? thx
: static datetime Time0Buy; if (Time0Buy != Time[0]){ // Buy allowed ticket = OrderSend(OP_BUY...); if (ticket < 0) Alert("OrderSend failed: ", GetLastError()); else Time0Buy = Time[0]; // No more buys this bar. } :

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi, this is manual for trade (buy or sell) only once per 1 bar.
Up at the top where you declare your veriables put
static bool ITradedOnThisBar;
then where you send your order put
if(your critera && ITradedOnThisBar!=Bars)
{
ticket=OrderSend(Symbol(),OP_BUY,... );
ITradedOnThisBar = Bars;
}
But what i have to chance to open maximum 1 buy and 1 sell (2 trades) position per one bar? Thank you.