Manage lot size while stock split

 

Hi all,

I am new here and I have started coding my own strategy on stocks, already backtested ***. For the case of NVIDIA which had a 10:1 split back in June, how could I have increased my lot size automatically without stopping my strategy? (Assuming I have money etc...)
This is important because all prices after the split are 1/10, so any indicator active during the split day would have given a wrong value.

Thanks

 
Your topic has been moved to the section: Trading stocks, futures, options and other exchange instruments
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
 
Stefano: I am new here and I have started coding my own strategy on stocks, already backtested ***. For the case of NVIDIA which had a 10:1 split back in June, how could I have increased my lot size automatically without stopping my strategy? (Assuming I have money etc...). This is important because all prices after the split are 1/10, so any indicator active during the split day would have given a wrong value.

This forum is for MetaTrader, not other trading platforms.

Any kind of automation requires that you code a MQL program (e.g. EA or Script), to make the necessary adjustments according to your requirements.

MQL5 programming for traders - Book on MQL5.com
MQL5 programming for traders - Book on MQL5.com
  • www.mql5.com
Modern trading relies heavily on computer technology. Automation now extends beyond the boundaries of exchanges and brokerage offices, becoming...
 
Fernando Carreiro #:

This forum is for MetaTrader, not other trading platforms.

Any kind of automation requires that you code a MQL program (e.g. EA or Script), to make the necessary adjustments according to your requirements.

 Hi,

I started coding with MQL5, it was obvious to me. Anyway, the question is: what would happen if my strategy is active during a stock split? There's already an article here but no evidence of a clear answer. Is there any MQL5 command to receive any kind of information from the broker in realtime?

Thank you

 
Stefano #: I started coding with MQL5, it was obvious to me. Anyway, the question is: what would happen if my strategy is active during a stock split? There's already an article here but no evidence of a clear answer. Is there any MQL5 command to receive any kind of information from the broker in realtime?

There is no specific MQL5 function. You will probably need to read the contract specifications for the symbol to determine what to do.

However, I think it should be a manual human intervention and not a automated process. Each individual stocks don't split that often, and when they do, it often needs "human" thought to decide how one should proceed.

 
Stefano #:
 Hi,

I started coding with MQL5, it was obvious to me. Anyway, the question is: what would happen if my strategy is active during a stock split? There's already an article here but no evidence of a clear answer. Is there any MQL5 command to receive any kind of information from the broker in realtime?

Thank you

One way I can think of would be to monitor the "tick value" value of the asset. This usually should not change, but if it does, it should give you the ratio change, and that could be used to adjust your calculations.

It will be a complex process, and maybe it is not a perfect reliable solution, but that would require testing.

Other than that, I have no idea how else this could be achieved automatically. Fernando is right on this, it would most probably require human intervention.
 

"how could I have increased my lot size.."  this depends on how you want to increase it. How should it increase? by a positional risk percentage? by max lots and risk percentage of the account? by the free margin available? 

Free margin is what you should calculate the lots on after you make several deals because free margin is what you are available to trade with.

If you don't make an expert advisor, then you could make an excel file with formulas and fields to calculate what you want after you obtain the tick value, tick size and other information from the broker.