Tristen Shaw #: OK, first I would like to thank you guys for your time. :)
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.
What do the functions GetSpread() and GetATR() return in value, specifically in what "units"? 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 value does "StopLoss" hold? 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.
Only after you clarify these questions or show all the relevant code, can we proceed to offer you some guidance.
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.
What do the functions GetSpread() and GetATR() return in value, specifically in what "units"? 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 value does "StopLoss" hold? 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.
Only after you clarify these questions or show all the relevant code, can we proceed to offer you some guidance.
Stoploss is a place holder. At the moment it holds points which is an input that can be set by the user. Once I get it working, I plan on making a function that identifies the last low using the zigzag indicator and using that to place a stop loss.
Tristen Shaw #: Stoploss is a place holder. At the moment it holds points which is an input that can be set by the user. Once I get it working, I plan on making a function that identifies the last low using the zigzag indicator and using that to place a stop loss.
So to recap:
"Ask" and "Bid" are "prices"
"GetATR()" is a "price range"
"StopLoss" is in "points"
"GetSpread()" is in "points"
Stops Level is also in "points"
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.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
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.