Express code: DayTimeFlat

Post Reply
WHS BE-NL
Posts: 517
Joined: 26 Nov 2012 12:45

Express code: DayTimeFlat

Post by WHS BE-NL »

daytimeflat.png
This Express code closes a position at a certain time at a specific day .

Usefull for the trader who wants his position to be closed on Thursday at 14:00 before the US Unemployment data or the trader who wants no open positions before the weekend.

Credit: Timo
You do not have the required permissions to view the files attached to this post.
gunnar.s
Posts: 9
Joined: 10 Dec 2015 14:09

Re: Express code: DayTimeFlat

Post by gunnar.s »

Can you not cut it to:

[...]
begin
if ($WeekDay = DayOfWeek(date)) then
if (timeOpen >= NumericToTime($FlatTimeStart)) and (timeOpen <= NumericToTime($FlatTimeEnd)) then
Sentiment = Senti_Flat;
end

?
User avatar
WHS Support
Posts: 2443
Joined: 14 Feb 2013 10:27

Re: Express code: DayTimeFlat

Post by WHS Support »

Hi Gunnar,

yes, you can.
Thanks for the tip.

Kind regards,
WHS LUX
Post Reply

Return to “WHS NANOTRADER - EXPRESS PROGRAMMING”