28. 12. 2021

5 1

What If: Profit Factor Trading Moving Average Money Management Simulation

What if snippet  Profit Factor MA Trading  calculates the profit factor of the strategy and when profit factor is lower than threshold  you have set, the strategy changes trade size. Snippet still calculates the profit factor of the strategy even if the current profit factor is below the threshold. At the moment when the profit factor gets above the threshold we have chosen, the strategy changes positions size again.

Parameters:
  • PFPeriod – Period of Profit Factor Calculation
  • PFTreshold – Treshold of Profit Factor
  • LotsIfNoMM – Position size when Profit Factor is below Treshold
  • LotsIfMM –Position size when Profit Factor is above Treshold

 

There are two modes you can use

  • PFPeriod= 0 :  The first one is that you calculate the profit factor of the strategy from 2 trades and compare the performance of the strategy with the value you set
  • PFPeriod> 0 :  The second mod calculates the average current profit factor for the last x trades.

 

How to import custom snippets to SQX: https://strategyquant.com/doc/programming-for-sq/import-export-custom-indicators-and-other-snippets/

 

 

Subscribe
Notify of
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Emmanuel
5. 1. 2022 12:00 pm

Very interesting and helpful !!!! Thank you Clonex !!!!!!!!!!!!!!!!!!!!!!!!!!!!!