Issue with magic number
-
I created rule set for trading. If one of the rule is not met then it alerts me with the information. If all rules are met then it places one trade. I would like to use it as semi-automated script - I add it to my chart and then it start alerting me which criteria is not met. After that I drag a next currency into my chart and then it tells me also which criteria is not met (about that spefic currency). Rule set begins with block "No position" (MT5). In condition where all criterias are met and it places a trade it stops alerting me. If I drag next currency into my chart it doesn't alert me anymore. If I delete the placed trade it will place the same trade again despite the fact that I dragged new currency into my chart and it should place a trade with current currency. I think that the EA stops, because current Magic Number has placed a trade (it doesn't matter if the currency has changed). But I wish that it is working continously - after placing one trade in specific currency it will continue to alert me on another currency chart and placing trades also.
-
I made this project to test: https://fxdreema.com/shared/JV80bhHue
I found out that it happened with project generated by the website, but not if I compile the .mq5 file with MetaEditor. I investigated a little bit and at the end I uploaded the latest compiler. I think that it works now.
-
@fxdreema said in Issue with magic number:
nd at the end I uploaded the latest compiler. I think that it works now.
Thank You for Your reply! The comment will appear on chart when I drag new currency.
My problem is also that I am using "No position" block, but if my semi-automated script will place a trade then it would not go through that "No position" block again, despite the fact that I have changed currency.
I need that my script is using following logic:
If all trade conditions are not met - alert me
If all trade conditions are met - place one trade
--- Now I change currency and it should start checking all trading conditions again, but unfortunately if it just placed a trade then it stops, because I use "No position" block and the script with this current magic number has placed a trade. -
So you place positions manually. Is the EA capable of working with manually created positions, because normally the EA uses some magic number, which is different than 0 (for manually created positions the magic number is 0)? Maybe the EA is doing its thing because it doesn't see that manually created position.
This is where you control the magic number - globally for the EA or in a single block:
