How can I calutate the margin reguired for CFD GE30Dec20?

 

Hi staff, How can I calculate the margin required for CFD GE30Dec20?.   I make a script to write the “NormalizeDouble(MarketInfo(Symbol(),MODE_MARGINREQUIRED),2)” and  (MarketInfo(Symbol(),MODE_LOTSIZE)*ask/AccountInfoInteger(ACCOUNT_LEVERAGE)) in a file.

If I test my script on CFD GE30Dec20 chart I get this result, but there is a big difference on the results that I don’t know why? Can you help me to understand that?

this is the result of my test.

 
Tank you for all help.
Reason: