Margin level indicator on chart

 
I know this sounds dumb to some but - I need to work out where my margin will last to - lets say I opened short position, 1.3100 eurusd - the trade goes up instead of down, now I decide I would want to wait this one out, so i don't want to close my position. I need only display that with my current balance etc. etc. I have say 4000% margin and it will hold the position untill the trade lets say it tell me that the highest it is allowed to go with current balance is 1.3500 ... that way i can decide will it go there based on news etc etc or do i take loss and not wait it out.

i know the margin is calculated like this: Margin = StandardLot * quote * LotSize / Leverage

what i cant get is the margin changes all the time as price changes, how is that calculated is my question, i will write it myself if i can get some help please
 
what about AccountFreeMargin()
Reason: