Max Lost per day

Viewing 3 posts - 16 through 18 (of 18 total)
  • Author
    Posts
  • #214187 quote
    robertogozzi
    Moderator
    Master

    It is simpler to say that it’s the first week of the year is when Jan1st is on Thursday or earlier, if it’s later then it belongs to the prior year.

    ZeroCafeine thanked this post
    #214189 quote
    ZeroCafeine
    Participant
    Senior

    Perfect @robertogozzi
    Thanks to the above link I’m going to get another headache 🤣, tks again 😊

    #214207 quote
    ZeroCafeine
    Participant
    Senior

    Let’s continue with the daily profit losses, my trading day starts at IntraDayBarIndex 98, So I have to measure the daily profit between 98 on Monday until 97 on Tuesday, and I initialize all my earnings on Sunday :

    However I have a small problem, if a position is opened on Monday and only closed on Tuesday, then Monday’s profits are not calculated as the position is not closed on Monday, but I will have unrealised gains or losses to calculate for Monday

    IF (DayOfWeek=1 AND IntraDayBarIndex>=98) OR (DayOfWeek=2 AND IntraDayBarIndex < 98) THEN
    MondayProfit    = DayProfitEuro
    
     ELSIF (DayOfWeek=2 AND IntraDayBarIndex>=98) OR (DayOfWeek=3 AND IntraDayBarIndex < 98)THEN
    TuesdayProfit   = DayProfitEuro
    
     ELSIF (DayOfWeek=3 AND IntraDayBarIndex>=98) OR (DayOfWeek=4 AND IntraDayBarIndex < 98)THEN
    WednesdayProfit = DayProfitEuro
    
     ELSIF (DayOfWeek=4 AND IntraDayBarIndex>=98) OR (DayOfWeek=5 AND IntraDayBarIndex < 98)THEN
    ThursdayProfit  = DayProfitEuro
    
     ELSIF DayOfWeek = 5 AND IntraDayBarIndex > 98 THEN
    FridayProfit    = DayProfitEuro
    
     ELSIF DayOfWeek = 0 THEN
    MondayProfit    = 0
    TuesdayProfit   = 0
    WednesdayProfit = 0
    ThursdayProfit  = 0
    FridayProfit    = 0
    ENDIF
Viewing 3 posts - 16 through 18 (of 18 total)
  • You must be logged in to reply to this topic.

Max Lost per day


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 17 replies,
has 5 voices, and was last updated by ZeroCafeine
2 years, 9 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 05/03/2023
Status: Active
Attachments: 2 files
Logo Logo
Loading...