Hi LMC,
in my opinion you can use the two reserved words PosTradeProfit and PosTradeEntryDateTime to accomplish that. You can check if the trade was done today and entered with a profit or loss.
Depending on your trade length you might want to use PosTradeExitDateTime, in case you are not only daytrading.
With these reserved words you can detect if the last two trades have been losers and in that case you activate a true/false switch that will block new trades. On a date change you simply reset the switch, so it would look something like this:
Code: Select all
if Date <> Date[1] then NewTradesAllowed = true; //NewTradesAllowed would be the switch here
//then the part were you check for the outcome of the last two trades
//you can actually only check for the most recent one and use a counter that
//you increment in case this trade was a loss and reset if it was a winner
if two consecutive losing trades detected then
NewTradesAllowed = false;
if NewTradesAllowed then
begin
//your entries should be in here
end;
This should get you going. In case you have any questions, post them with the code you have done so far and I am sure we can point you in the right direction.
Regards,
ABC