2014-01-21

MQL4 - Lesson 8 - Notes

You can access Jim Dandy's MQL4 youtube course here for free. He also has a website with videos here and here. These are my notes of lesson 8:

Message box -> function 
  • function checks which button was pushed and opens message box
  • does not has to send any info back -> void
  • void message (int message) (…)
  • int m is not the same as function message -> rename: int number
  • call message function: message (number); message box ("End of Start Function");
  • message box: tool to see what changed programming makes

Function can call another function 
  • function: run when someone pushed button 3
  • button 3, 4 and 5 function: button3 (number); ….
    • if (number ==3)… else button4 (number)
    • if (number ==4)… else button5 (number)
    • if (number ==5) ->way becomes clear
  • when print is used everything is done instantly
  • another operator than if/else -> switch
    • void testswitch (int number) (switch (number)( 
      • case 3: MessageBox ("You pushed abort!!!");print("End of testswitch function");break;
      • case 4: ...
      • case 5: …)
  • default: MessageBox ("I do not…"); Print("End of…");break;) -> default runs when no case is met

Special MA that adjusts to timeframe
  • int MyMA;
  • void MAAdjuster (int number) (switch (number) (
    • case 5:...
    • case 15:...
    • case 30:...
    • case 60:MyMa=80;break;
    • case 240:MyMa=20;break;

No comments:

Post a Comment