rublizz Posted May 31, 2012 Report Share 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. Quote Link to comment Share on other sites More sharing options...
NinjaMonitor Posted May 31, 2012 Report Share 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; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.