![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Second, I have attempted to put your fixes into practice. However, being very new to this, I'm sure I have probably butchered it. I'm struggling to understand some things and am doing my best to try and bumble my way through it. Please don't crucify me lol. I'm currently watching my EA to see what happens when it hits a buy trigger. Edit: As far as the stop loss. I'm eventually trying to use the ZigZag idicator to set the stoploss at a particular low/high. Haven't figured that part out yet.
Unfortunately you did in deed make it worse. Much worse! So, lets start by the definition of things you have neglected to mention. It would be better if you supplied all the code so that we can understand it better. But these are some of the things that to be clarified first.
Is it a price range or is it in "points" or in "ticks" or some other unit or scale?
What is the returning data-type?
It would be best for you to show their actual code.
What is its "units" or scale, just like in the previous question?
How is it calculated?
What is its data-type?
It would be best for you to show their actual code that calculates it.
Unfortunately you did in deed make it worse. Much worse! So, lets start by the definition of things you have neglected to mention. It would be better if you supplied all the code so that we can understand it better. But these are some of the things that to be clarified first.
Is it a price range or is it in "points" or in "ticks" or some other unit or scale?
What is the returning data-type?
It would be best for you to show their actual code.
What is its "units" or scale, just like in the previous question?
How is it calculated?
What is its data-type?
It would be best for you to show their actual code that calculates it.
This still doesn't work.....like
lets say Ask is 0.7856
StopLoss is 300 points
GetSpread() == ??
0.7856 - 300 - GetSpread() ==> very weird number
what I do...if I get something I dont understand, I print...you should print all your calculations so you can check
like that
I think it should be like that:
So to recap:
So Stops Level, Stop-Loss, and the Spread need to be converted into a "price range" (or alternatively the Spread can just be calculated as "Ask - Bid").
However, this is not sufficient as all the other logic still has many errors, but first lets make sure you understand these points properly before moving on to the others.
EDIT: Also, please note that none of the above require normalisation as all data returned by the system is already normalised.
0.7856 - 300 - GetSpread() ==> very weird number
what I do...if I get something I dont understand, I print...you should print all your calculations so you can check
like that
I think it should be like that:
You are confusing the OP. The Spread returned by MarketInfo is in Points.
Also, don't use the "NormalizeDouble" but instead, use the "tick size" alignment.
This still doesn't work.....like
lets say Ask is 0.7856
StopLoss is 300 points
GetSpread() == ??
0.7856 - 300 - GetSpread() ==> very weird number
what I do...if I get something I dont understand, I print...you should print all your calculations so you can check
like that
I think it should be like that:
You indeed have a point.
I am going to do some reworking and post after. I want to show that I am indeed trying to grasp this, not just looking for anyone to do it for me.
You are confusing the OP. The Spread returned by MarketInfo is in Points.
Also, don't use the "NormalizeDouble" but instead, use the "tick size" alignment.
Ok, lets see if I'm even moving in the right direction
It's not finished, but am I getting warmer?
EDIT: I forgot to change the StopLoss. Working on that now.
EDIT2: Ok, I edited the above code with a new stop loss.
Example code (untested, uncompiled) based on your original source in initial posts:
Updated example code (untested/uncompiled) based on your latest post:
Example code (untested, uncompiled) based on your original source in initial posts:
lol I take that to mean I was not getting warmer.
Ok, I need some time to dissect and understand this.