I need to program something and I just don't know how to do it... at the moment my system allows me to open only 1 trade at a time. I just have
total = OrdersTotal();
if(total < 1)
{
etc
What I want to do is to enable my program to open as many trades as it wishes but only let it open 1 trade per bar. I'm not certain as to what timeframe I want to use to determine whether a trade was opened during the current one (in which case no new ones can be opened)
this way I dont have to worry about having the fluctuations in the market open a heap of trades. I guess what is actually happeniening is theres a window where all the conditions are met and the system keeps opening positions whilst that window is open. I have the indicators shifted 1 time period but the system still opens a heap of transactions per bar as a result of that window. Any suggestions?
I've thought about timing lets say 900 seconds (15 mins) after the trade is entered but I'm not quite sure as to how to do even that, but I would really prefer to just say something along the lines of the following logic:
if(newtradesincurrentbar = 0)
{
tradeallowed = true
}
else
{
tradeallowed = false
}
and then something along the lines of
... conditions ....
and part of those conditions
if(...)
&& (tradeallowed == true)
{
Ordersend blah blah blah
}
total = OrdersTotal();
if(total < 1)
{
etc
What I want to do is to enable my program to open as many trades as it wishes but only let it open 1 trade per bar. I'm not certain as to what timeframe I want to use to determine whether a trade was opened during the current one (in which case no new ones can be opened)
this way I dont have to worry about having the fluctuations in the market open a heap of trades. I guess what is actually happeniening is theres a window where all the conditions are met and the system keeps opening positions whilst that window is open. I have the indicators shifted 1 time period but the system still opens a heap of transactions per bar as a result of that window. Any suggestions?
I've thought about timing lets say 900 seconds (15 mins) after the trade is entered but I'm not quite sure as to how to do even that, but I would really prefer to just say something along the lines of the following logic:
if(newtradesincurrentbar = 0)
{
tradeallowed = true
}
else
{
tradeallowed = false
}
and then something along the lines of
... conditions ....
and part of those conditions
if(...)
&& (tradeallowed == true)
{
Ordersend blah blah blah
}