Jump to content

Recommended Posts

Posted

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.

Posted

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;

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...