Variables + Constants inside Custom MQL code block?
-
Im trying to use less blocks in my ea, and want to use Custom MQL blocks to reduce the block count, as below I am trying to turn this sequence which goes from left to right.

I have tried this code snippet in a custom block but it does not seem to work, it compiles fine but does not function.
int AMA_SellPrice = AMA_Price; if(AMA_Price == 3) { // If AMA_Price equals 3, increment AMA_SellPrice by 1 AMA_SellPrice += 1; } -
Looks like you already have everything, just delete int as this is already defined in the variables tab. When you say doesn't seem to work, have you put the variable in a comment to see if it changes?
-
Ahhhhhhh
It does work! It turns out I had not spelled something correctly and it was trying to check a custom enum rather than the output of the enum. Now I can remove about 50 unrequired blocks in my ea, yikes.
Thanks
