MT5 plus Python

Maverick

Master Trader
Apr 3, 2014
453
6
79
Bournemouth UK
In my quest to get LIVE data for my trading, I first looked at DDE then RTD now I have stumbled on Python ... possibly the Holy Grail

Time will tell ...

Watch This Space.png
 

Maverick

Master Trader
Apr 3, 2014
453
6
79
Bournemouth UK
Python has powerful libraries for analysing data and developing trading strategies, while MT5 supports automated trading with Expert Advisors and other tools. By combining the two, you can retrieve data, generate signals, and place orders automatically. This can save you time and improve your trading performance.
 

Maverick

Master Trader
Apr 3, 2014
453
6
79
Bournemouth UK
IMO ... Python looks easier to learn than mq5 ... Haven't got time to learn now whilst the US economy is on a roll

I listed my job on MQL5 and decided on a "Pythonista" ... NOT a developer to write my code

Python_1.png

40USD.png
Hopefully ready on Monday ... He wanted 2 days but I gave him extra to include comments in the code ... to help with MY learning curve and a day off (Sunday)

I am a LOT more confident than I have been with the MQL5 "Developers" in the past
 

Maverick

Master Trader
Apr 3, 2014
453
6
79
Bournemouth UK
Bit like figuring out your squares ... easy peasy when you are the creator

B2 (Bid) * L2 (Reqd Margin) = N2

J2 (Free Margin) / N2 = R2 (Bet Size)

FYI ...L1 (Required Margin) is Blue because it is a fixed #

All my Pythonista has to do is write that in Python then we are good to go
 
Last edited:

hayseed

Master Trader
Jul 27, 2010
1,046
262
149
usa
Bit like figuring out your squares ... easy peasy when you are the creator
//------

yep...... never dawned on me you were using excel cells.......

the high and low are based on what timeframe.......

how is final bet size, r2, figured...... is that rounded p2........

you might get to a point where maxlot , marketinfo(symbol,mode_maxlot) , per symbol and broker will have to be considered........h

//-------
spx500-m30-tf-global-markets-bet-size.png
 

Maverick

Master Trader
Apr 3, 2014
453
6
79
Bournemouth UK
the high and low are based on what timeframe.......
Good question ... not really sure to be honest ... I used them cos they were on DDE

Wait and see if my Pytonista asks the same question
Post automatically merged:

how is final bet size, r2, figured...... is that rounded p2........
I spreadbet and my minimum bet is 0.1 ... so yes P2 is rounded down
 
Last edited:

Maverick

Master Trader
Apr 3, 2014
453
6
79
Bournemouth UK
WELL ... I am so impressed with what I have seen so far I took the plunge and signed up on a Python Beginners Course
 
Last edited:

Maverick

Master Trader
Apr 3, 2014
453
6
79
Bournemouth UK
LearnBig.png

Link 2 Page ............ YouTube

Use my referral code... GIF4ES ... to get 100 credits off future courses

What's in it for me ... the same number of credits No Financial Gain

So you might be asking what is 40% discount ... its $17 (at the time of writing)

Shouldn't need a mathematician to figure out what a good price it is ... I was gob-smacked
 

Maverick

Master Trader
Apr 3, 2014
453
6
79
Bournemouth UK
Word of WARNING if you sign up for the course .. DO NOT allow Google to create and save your password ... it will be 15 digits long and will NOT be saved as Ritvick only requires a 6 digit password
 

Maverick

Master Trader
Apr 3, 2014
453
6
79
Bournemouth UK
Learning as I stumble along ... should have watched video 4 in its entirety BEFORE attempting the downloads ... can always replay ... C'est la vie
 

Maverick

Master Trader
Apr 3, 2014
453
6
79
Bournemouth UK
//------

yep...... never dawned on me you were using excel cells.......

the high and low are based on what timeframe.......

how is final bet size, r2, figured...... is that rounded p2........

you might get to a point where maxlot , marketinfo(symbol,mode_maxlot) , per symbol and broker will have to be considered........h

//-------
spx500-m30-tf-global-markets-bet-size.png

Checked your sums in my spreadsheet ... You are rounding UP ...

sums.png

Also, how confident would you be betting 355 / point ?

Remember a point in indices is 1.0

With my broker, the max I can bet is 100 (professional trader like [URL deleted] Tom Hougaard 200)**

FYI ... My above equation will NOT work with Forex

Just supposing A / (B * C) = 54.5965853366 and was rounded up to 54.6 my broker would reject it as "Not enough money"

Why I calculate to 10 decimal places and 5 for B * C
 
Last edited by a moderator:

hayseed

Master Trader
Jul 27, 2010
1,046
262
149
usa
Checked your sums in my spreadsheet ... You are rounding UP ...
//------

no, i rounded down....... actually wrote a post with a few other questions but then deleted it......

one of those questions is how are you determining j2, "FreeMar"....... not knowing, i just used my accounts free margin....... accountfreemargin()........

that's why i mentioned, you might get to a point where maxlot , marketinfo(symbol,mode_maxlot) , per symbol and broker will have to be considered......

can see where you might be having j2 value as a variable extern input or a set amount like 30....... but then i thought, maverick.......

heck, he's probably placing it all on 1 roll of the dice.......lol......h
Post automatically merged:

......h
//-----

spx500-m30-tf-global-markets-sp.png
 

Maverick

Master Trader
Apr 3, 2014
453
6
79
Bournemouth UK
can see where you might be having j2 value as a variable extern input or a set amount like 30
J2 (30) is the minimum free margin I need to place a 0.1 bet (with a margin) ... Once I place my main bet I watch the free margin till it reaches 30 then place another 0.1 bet ... as your balance increases you widen the gap ... wait for the free margin to reach 300 then add a 1.0 bet

Another reason to put it in the hands of a bot .... with a fast moving market it can be difficult to keep up ... in this instance, I had set my TP at a round number 5000

fast.png
 

Maverick

Master Trader
Apr 3, 2014
453
6
79
Bournemouth UK
The more I get into this course the more I realise I need a second monitor so I can follow on Python LIVE
Will make sure I have one for my second time around