Incorrect trading logic snippets in source code - Dont trade on weekends

I noticed a possible bug - SQ builder 135.868 puts incorrect trading logic snippets in source code for Tradestation, MultiCharts, for the function Dont trade on weekends

Instead of variable  FridayCloseTime it uses FridayExitTime


Variables:
DontTradeOnWeekends(true),
    FridayCloseTime(1300),
    SundayOpenTime(1000),   

Trading logic:
/ =================================================================
// TRADING OPTIONS LOGIC
// =================================================================
OpenOrdersAllowed = true;

// Dont trade on weekends
if DontTradeOnWeekends then begin
    if DayOfWeek(Date) = 5 then begin
        if FridayExitTime <> 0000 and Time >= FridayExitTime then begin
            OpenOrdersAllowed = False;
        end;    
    end
    else if DayOfWeek(Date) = 6 then begin
        OpenOrdersAllowed = False;
    end
    else if DayOfWeek(Date) = 0 and Time < SundayOpenTime then begin
        OpenOrdersAllowed = False;
    end; 
end;

The variable FridayCloseTime is not used at all and FridayExitTime is used in both Dont trade on weekends and Exit on Friday
Attachments
No attachments
  • Votes +1
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

TH
#1

Tomas Hruby

13.09.2022 10:21

Task created

TH
#2

Tomas Hruby

13.09.2022 15:24

Subject changed from chybna trading logic snippets v zdrojovom kode - Dont trade on weekends to Incorrect trading logic snippets in source code - Dont trade on weekends

Description changed:

I noticed a possible bug - SQ builder 135.868 puts incorrect trading logic snippets in source code for Tradestation, MultiCharts, for the function Dont trade on weekends


Instead of variable  FridayCloseTime it uses FridayExitTime


Variables:
DontTradeOnWeekends(true),
    FridayCloseTime(1300),
    SundayOpenTime(1000),   

Trading logic:
/ =================================================================
// TRADING OPTIONS LOGIC
// =================================================================
OpenOrdersAllowed = true;

// Dont trade on weekends
if DontTradeOnWeekends then begin
    if DayOfWeek(Date) = 5 then begin
        if FridayExitTime <> 0000 and Time >= FridayExitTime then begin
            OpenOrdersAllowed = False;
        end;    
    end
    else if DayOfWeek(Date) = 6 then begin
        OpenOrdersAllowed = False;
    end
    else if DayOfWeek(Date) = 0 and Time < SundayOpenTime then begin
        OpenOrdersAllowed = False;
    end; 
end;

The variable FridayCloseTime is not used at all and FridayExitTime is used in both Dont trade on weekends and Exit on Friday

E
#3

Emmanuel

14.09.2022 13:13
Voted for this task.

Votes: +1

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please