Money management indicator

Category: Indicators By: Maburivi Created: November 3, 2021, 11:29 AM
November 3, 2021, 11:29 AM
Indicators
3 Comments

This indicator allows you to measure your risk when you take a trade, according to the configured stop loss, the gain / risk ratio and the risk you want to take in relation to your capital.

It also allows the ATR to be taken into account.

// Variables :
// Capital, entier, défault 10000
// Risque : decimal, défault 1
// In : decimal
// Ratio : entier, défault 2
// Stoploss : decimal
// Atr : boolean, défault false

if Atr then
LeR = In - (stoploss - AverageTrueRange[14](close))
slAtr = stoploss - AverageTrueRange[14](close)
else
LeR=In-stoploss
slAtr = 0
endif

NiveauRatio=In+LeR*ratio
sl = LeR/In
slEnPourcent = sl*100

nbactions = round(((risque/100)/sl*capital)/In)
risqueEnEuros = risque/100*capital
taillepose = (round(nbactions*In))
objectifGain = round(NiveauRatio*nbactions-nbactions*In)

indexSl = In*1.01
indexGain = In*1.03
indexObj = In*1.05
indexRisque = In*1.07
indexNbaction = In*1.09
indextaillePos = In*1.11
indexPrixAchat = In*1.13

if islastbarupdate then
DRAWSEGMENT(barindex-10, In, barindex+1, In) coloured(0,0,255) style(line,3)
DRAWSEGMENT(barindex-10, NiveauRatio, barindex+1, NiveauRatio) coloured(0,155,0) style(line,3)
if Atr then
DRAWSEGMENT(barindex-10, slAtr, barindex+1, slAtr) coloured(255,0,0) style(dottedline,2)
DRAWTEXT("stop - ATR", barindex+4, slAtr)
DRAWTEXT("SL - ATR : #slAtr# soit #slEnPourcent# %", barindex+25, indexSl)
else
DRAWSEGMENT(barindex-10, stoploss, barindex+1, stoploss) coloured(255,0,0) style(line,3)
DRAWTEXT("SL : #stoploss# € soit #slEnPourcent# %", barindex+25, indexSl)
DRAWTEXT("Stop", barindex+3, stoploss)
endif

DRAWTEXT("Entrée", barindex+4, In)
DRAWTEXT("R #ratio#/1", barindex+4, NiveauRatio) coloured(0,155,0)
DRAWTEXT("Prix d'achat : #In# €", barindex+25, indexPrixAchat)
DRAWTEXT("Taille position : #taillepose# €", barindex+25, indextaillePos)
DRAWTEXT("Nombre d'actions : #nbactions#", barindex+25, indexNbaction)
DRAWTEXT("Risque : #risqueEnEuros# €", barindex+25, indexRisque)
DRAWTEXT("Objectif de cours : #NiveauRatio# €", barindex+25, indexObj)
DRAWTEXT("Objectif de gain de : #objectifGain# €", barindex+25, indexGain)

endif

return

Download
Filename: Money-management-indicator.itf
Downloads: 430
Maburivi Junior
Operating in the shadows, I hack problems one by one. My bio is currently encrypted by a complex algorithm. Decryption underway...
Author’s Profile

Comments

Logo Logo
Loading...