Humour while learning MQ4

 

Hi guys, I am fairly new to the forum and still learning MQ4 (thanks for the support with that too ;) )

I couldn't resist writing a post for something completely different, please forgive me if it is too cheesy!!!

(It can slip down the list unanswered or moderators are welcome to delete if nobody else finds it amusing anyway...)


However while I am learning MQ4, I can't stop thinking about MQ4!!!!

I was in the shower the other day.... and I even started fitting my own behaviour into a section of code!:


extern int NumberofWorries = 10
extern bool ArguingwithWifeUnfortunately = false (hopefully)


void EveningBehaviour()
{
   
    double ForexBalance = AccountBalance();
    int NumberofWorries = OrdersTotal();                                //count number of worries
    for (int i = 0; i < orderstotal; i++)                               //rotate forwards through worries
    {
       if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
          {
          if (OrderType() == OP_SELL && OrderSymbol() == Symbol() && OrderMagicNumber() == 01 && NumberofWorries == 10 && ArguingwithWifeUnfortunately == false && ForexBalance == 0)
              { 
              Relaxing();  
              Comment ("All is Normal")
              Print ("relax and enjoy evening");
              } 
          }
        if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
          {
          if (OrderType() == OP_SELL && OrderSymbol() == Symbol() && OrderMagicNumber() == 01 && NumberofWorries > 10 && ArguingwithWifeUnfortunately == true && ForexBalance < 0) 
              { 
              HavingaDrink();
              Comment ("remember only 2 glasses, and no live trading!!!") 
              Print ("relax and have a drink shhh");
              } 
          }
        if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
          {
          if (OrderType() == OP_SELL && OrderSymbol() == Symbol() && OrderMagicNumber() == 01 && NumberofWorries > 10 && ArguingwithWifeUnfortunately == true && ForexBalance > 10000) 
              { 
              BookaHoliday();
              Comment ("Ignore Wife, book a holiday, and bring laptop!!!") 
              Print ("quickly, haha");
              } 
          }
      }
    
}

void Relaxing()
      {
      }

void HavingaDrink()
      {
      }

void BookaHoliday()
      {
      }


Forgive me, it is a very silly post.... It comes after hours of staring at the one block of code... only you guys could relate, so thought I would share the laugh.

It helps me with my learning to put a bit of humour into it.

Cheers ;)

 

The 2nd and 3rd OrderSelect are not needed . .

Comment ("All is Normal") needs a ;

Comment ("remember only 2 glasses, and no live trading!!!") needs a ;

Comment ("Ignore Wife, book a holiday, and bring laptop!!!") needs a ;

I think you are missing a conditional check in all your ifs . . .

add . . . . && CodeCompleteEAMakingMoney . . . then Relaxing() HavingaDrink() BookaHoliday() can all be executed . . .

 
Lol... This is a nice piece of post for giggles. About a year and half ago when I toke up forex & mql4 I had a similar experience. It too happened in the shower. I found myself trying to justify grid systems using the tiles on the bath-tub walls. Thats where I give-up on grid-hedging/locking as some form of arbitrage. Boy I tell ya, I almost lost it.........%:)
 
Funky:

Hi guys, I am fairly new to the forum and still learning MQ4 (thanks for the support with that too ;) )

I couldn't resist writing a post for something completely different, please forgive me if it is too cheesy!!!

(It can slip down the list unanswered or moderators are welcome to delete if nobody else finds it amusing anyway...)


However while I am learning MQ4, I can't stop thinking about MQ4!!!!

I was in the shower the other day.... and I even started fitting my own behaviour into a section of code!:



Forgive me, it is a very silly post.... It comes after hours of staring at the one block of code... only you guys could relate, so thought I would share the laugh.

It helps me with my learning to put a bit of humour into it.

Cheers ;)



Ultimately, what the code hopes to achieve is some strategy to be tested, optimized, etc. You can be the best coder but without getting to at least, test/optimization stage, it will do more worse than good.

A simple few liners EA which has gone through full test cycles is better in that sense to me, than thousand line EA which remains constantly in the garage. Unless your strategy is difficult to test, like my case.

Set some dates. Humour does help, but a dateline will be more helpful.

 

The 2nd and 3rd OrderSelect are not needed . .

Comment ("All is Normal") needs a ;

Comment ("remember only 2 glasses, and no live trading!!!") needs a ;

Comment ("Ignore Wife, book a holiday, and bring laptop!!!") needs a ;

I think you are missing a conditional check in all your ifs . . .

add . . . . && CodeCompleteEAMakingMoney . . . then Relaxing() HavingaDrink() BookaHoliday() can all be executed . . .


Raptor you are awesome mate, I had a real giggle at you correcting me on this one, you are so correct, I did forget the ; as I had had a couple of wines.... Ah that sounds awesome to me with the last part too, if only all of those conditions were satisfied ;)

I was thinking about learning "cases" too, I bet if I go "case1 = ((number of worries == 10) && (ForexBalance =<0));" for cases that occur to save writing each one each time - I just guessed the syntax here, I haven't learnt cases properly...

And cool I see too, it does help me learn in a much more entertaining atmosphere, cheers, so OrderSelect is only needed if you want to select differently, I just had to leave one of the IFs in the so it didn't revert to an ELSE I think...

What sort of conditional checks do you think I was missing? Did I forget to "extern int IfKidsFightingWithEachOther = true;" in global variables too? ;)



Lol... This is a nice piece of post for giggles. About a year and half ago when I toke up forex & mql4 I had a similar experience. It too happened in the shower. I found myself trying to justify grid systems using the tiles on the bath-tub walls. Thats where I give-up on grid-hedging/locking as some form of arbitrage. Boy I tell ya, I almost lost it.........%:)

Ah mate, that is hilarious! Thanks for sharing! You know the funniest part, is that I am working on locking in POs in a grid type design atm, and have a tiled shower, so now I almost fear I will start looking at those tiles as pip levels now that you have said that! ;) That is hilarious mate, I am going bonkers with it atm too funnily enough!



Ultimately, what the code hopes to achieve is some strategy to be tested, optimized, etc. You can be the best coder but without getting to at least, test/optimization stage, it will do more worse than good.

A simple few liners EA which has gone through full test cycles is better in that sense to me, than thousand line EA which remains constantly in the garage. Unless your strategy is difficult to test, like my case.

Set some dates. Humour does help, but a dateline will be more helpful.


I agree the logic is more important than code. There are so many ways to code the same end result that boggles me sometimes. At the moment I have settled for a thousand line EA because I perhaps have not learned a few basics like switches or how to select an order properly, or maybe just lack of experience. I've been chasing my tail a little as the manual was hard to read at first, until I learned a certain about of basics, then it starts to make sense, and I wonder why it was puzzling to me at first...

It makes me appreciate the time you guys take reading the posts here and helping people, it is a big headwrap for me reading others' posts as everyone sort of writes differently. A lot of people write EAs like a script from one end to the other, and others use a lot of subsections like me and send the flow of the river to a thousand places at once.... It is all great fun anyway.



Cheers for the answers, I hoped that I was not going mad to have written this post in the first place ;) and I will be back to give you a hard time Ubzen, if I start looking at my tiles like pip levels in a grid next I am in my shower now that you have said that ;)

I thought I was less a creature of habbit than I thought, but after watching my evening behaviour surrounding having a wee drink, I think I was close in the formula above... I have been forward testing this EA for years it feels, so know I am close!!!!