PureBytes Links
Trading Reference Links
|
A question was posted to to the Omega List:
> On a system running on a daily bar chart I like to make sure that the
> system takes just one trade a day. How do I do this?
It received the following answer:
> Var: OkToTrade(False);
>
> If whatever and OktoTrade = False then begin
> Buy("Yippee!") at open;
> OktoTrade = True;
> end;
>
> If whatever and OktoTrade = False then begin
> Sell("Yahoo!") at open;
> OktoTrade = True;
> end;
>
> If Date <> Date[1] then;
> OktoTrade = False;
Although this looks like it will work, it is a little confusing.
The variable OktoTrade takes on the opposite meaning than its name implies.
It would have read better:
Var: OkToTrade(True);
If whatever and OktoTrade then begin
Buy("Yippee!") at open;
OktoTrade = False;
end;
If whatever and OktoTrade then begin
Sell("Yahoo!") at open;
OktoTrade = False;
end;
OktoTrade = (Date <> Date[1]);
Another option would be to eliminate the variable OktoTrade
and use the following code:
If whatever and (EntryDate(1)<>Date) then Buy("Yippee!") at open;
If whatever and (EntryDate(1)<>Date) then Sell("Yahoo!") at open;
Chris Norrie
|