StrategyProfit e sizing Code

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #100320 quote
    Gianluca
    Participant
    Master

    Ciao è da un pò che uso questo codice per aumentare le size dei TS automatici,  preso dal TS di pathfinder, ha sempre funzionato a dovere, ultimamente ho riscontrato che non mi funziona a dovere e anche oggi con dei backtest non sembra aumentare a dovere le size.

    Potreste dirmi se vi risulta qualche problema a riguardo o se il codice scritto qui sotto è sbagliato?

    // dynamic scaling of the chance/risk profile depending on account size
    ONCE startRisk                     = 1  // start risk level e.g 0.25 - 25%, 0.5 - 50%, 0.75 - 75%, 1 - 100% and so on
    ONCE maxRisk                       = 100     // max risk level e.g  1.5 - 150%
    ONCE increaseRiskLevel             = 150  // amount of profit from which the risk is to be increased
    ONCE increaseRiskStep              = 0.25  // step by which the risk should be increased
    
    // size calculation: size = positionSize * trendMultiplier * saisonalPatternMultiplier * scaleFactor
    ONCE positionSize                  = 1     // default start size
    ONCE maxPositionSizePerTrade       = 5     // maximum size per trade
    
    
    // calculate the scaling factor based on the parameter
    scaleFactor = MIN(maxRisk, MAX(startRisk, ROUND(StrategyProfit / increaseRiskLevel) * increaseRiskStep))
    
    numberContracts = MAX(1, MIN(maxPositionSizePerTrade, positionSize) * scaleFactor)
    
    #100373 quote
    robertogozzi
    Moderator
    Master

    Io non lo uso mai, per cui non so dirti a prima vista.

    Posta un codice funzionante in modo da poterlo provare.

    Hai usato GRAPH e/o GRAPHONPRICE per fare il debugging delle variabili che t’interessano candela per candela?

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

StrategyProfit e sizing Code


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Gianluca @altares Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
6 years, 8 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 06/10/2019
Status: Active
Attachments: No files
Logo Logo
Loading...