rublizz Posted May 31, 2012 Report Posted May 31, 2012 Hello, Can you please help me to implement functionality where only one trade per day is allowed despite direction. I tried function EntriesToday(Date), but it always return 0 despite there were several trades today already. {code} if entriestoday(CurrentDate) < 1 then Buy/Sell But here in the picture you cann see that number of trades were generated anyway and later function returned zero. http://i49.tinypic.com/1zqfvx0.jpg How to restrict strategy to buy/sell only once a day and later day if conditions is met buy another contract despite previous is still open? Thanks guys.
NinjaMonitor Posted May 31, 2012 Report Posted May 31, 2012 Something like this should do it :) Vars: dateReset(0), MPO(0); MPO = marketposition; if date <> date[1] then begin dateReset = 0; end; if MPO <> MPO[1] then begin dateReset = 1; end; if //Conditions for entry // AND dateReset = 0 then begin // ENTRY end;
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now