How to set a weekly profit?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #141700 quote
    Fran55
    Participant
    Veteran

    How to set a weekly profit and no operate until Next week?

     

    Thanks!

    #141701 quote
    robertogozzi
    Moderator
    Master
    1. Firstly reset your profit at the beginning of each weeek (the first bar whose OpenDayOfWeek = 1) and re-enable trading
    2. Secondly monitor when STRATEGYPROFIT exceeds your weekly Gains and, if so, disable further trading using a variable named TRADEON

    There you go:

    ONCE MyProfit = 0               //Use this variable to tell when your profit exceeds X
    ONCE TradeON  = 1               //1=trading enabled, 0=trading disabled
    ONCE X        = 500             //500 € max weekly profit
    IF OpenDayOfWeek = 1 AND OpenDayOfWeek[1] <> 1 THEN   //at week start
       MyProfit   = StrategyProfit  //save the total profit at the start of the week
       TradeON    = 1               //re-enable trading
    ENDIF
    IF (StrategyProfit - MyProfit) >= X THEN
       TradeON    = 0               //disable trading after X € gained
    ENDIF
    IF MyLongConditions AND Not OnMarket ANd TradeON THEN //add TradeON as an additional condition to enter a tarde
       BUY 1 Contract AT Market
    ENDIF
    #141709 quote
    Fran55
    Participant
    Veteran

    % of profit please???…

    No money profit.

    #141711 quote
    robertogozzi
    Moderator
    Master

    At line 3 use a percentage (1, 2, 3.5, etc…) instead of money.

    Replace line 8 with:

    IF (StrategyProfit - MyProfit) >= abs(MyProfit * X / 100) THEN
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

How to set a weekly profit?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Fran55 @fran55 Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by robertogozzi
5 years, 6 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 08/15/2020
Status: Active
Attachments: No files
Logo Logo
Loading...