Hedge by pips distance
-
Hello fxDreema, okay?
I have a project for hedge pips distance, but he does not seem to work properly.
Link to the project: http://fxdreema.com/shared/QzZtAAEwd
Until more!
-
Well, I'm not the right guy to have a discussion about hedging.
There is an error of mising variable that is defined in block 21. I corrected that in the project in your profile. This is because all of the hidden parameters of the block are included to the final code. Someday I must change that rule.
I wonder why you are using "toDigits" when calculating lots value. "toDigit" and "toPips" are function to work with price levels, not lots.
-
__There is an error of mising variable that is defined in block 21. I corrected that in the project in your profile. This is because all of the hidden parameters of the block are included to the final code. Someday I must change that rule.[/quote:1ge6krkw]
Ok .. what comes to be that change. I'm sorry but I understood not.__I wonder why you are using "toDigits" when calculating lots value. "toDigit" and "toPips" are function to work with price levels, not lots.[/quote:1ge6krkw]
I used to believe toDigit be possible to multiply the lot of the initial order for 1.1 or 2 if I want. If this way is wrong, how can I do this?Until more!
-
toDigits is a function that normally converts 10 to 0.0010. It is used for pips conversion, not lots.
Now I saw that you are trying to use value from (Event trade), but this should be used under "on Trade" event. At the moment it give you pure 0, I believe.
If you want to get the lot size of the last trade, then put "Start trades loop" block with "Not more than n trades" parameter set to 1, and then you can get the lot size of the last trade from "(in loop) Attributes of the loaded trade/order", not from "(Event trade)...." -
I'm trying to do what they asked me to do now.
Please could create a sample project so I can understand you better? Because it also could not find two blocks that you said. -
Ok, I'm really bad in hedging strategies, but I think you should use the "on Trade" event as well. I am probably missing something here, but at least this project is doing something and can give some direction: http://fxdreema.com/shared/saUu2Td5b
Also, there was a project named Sure-Fire. Isn't it the same story there? -
__Also, there was a project named Sure-Fire. Isn't it the same story there?[/quote:2ejyhx9i]
Yes .. until I was happy with it, but it was not working properly, or was not closing all orders in profit. The other problem is that it will become a sort of Martigale. But at first liked the idea, yes. Its make it work properly?
Now I will test this version hedge that made me. Thanks for the help.
I would also like you to take a look at my other hedge, which is triggered at support or resistance, rather than x pips from the market.
http://fxdreema.com/forum/viewtopic.php?f=2&t=1954 -
__Also, there was a project named Sure-Fire. Isn't it the same story there?[/quote:zqgy7278]
Yes .. until I was happy with it, but it was not working properly, or was not closing all orders in profit. The other problem is that it will become a sort of Martigale. But at first liked the idea, yes. It has as make it work properly?
Now I will test this version hedge that made me. Thanks for the help.
I would also like you to take a look at my other hedge, which is triggered at support or resistance, rather than x pips from the market.
http://fxdreema.com/forum/topic/1954 -
What is "Price Offset"? How do I open a pending order x pips to market? If the Price offset, it is not working properly because I put 5 pips away from the market and opened it to 22 pips away from the initial order.
-
Let's say that you want to open Buy pending order. The defaults are Open at price = Ask, Price offset = 20 (pips), which means that the pending order will be opened at price Ask+20pips.
If you use dynamic value (not Ask), you can set Price offset as 0. -
Well .. in this case it did not work offset the price, but I'm using a pending order based on the top line or below the price channel indicator.
This happening the following issues that still can not solve:
SLPipsDistPriceChannel not working;
And the multiplier lots also not working. -
Check this again...
__toDigits is a function that normally converts 10 to 0.0010. It is used for pips conversion, not lots.Now I saw that you are trying to use value from (Event trade), but this should be used under "on Trade" event. At the moment it give you pure 0, I believe.
If you want to get the lot size of the last trade, then put "Start trades loop" block with "Not more than n trades" parameter set to 1, and then you can get the lot size of the last trade from "(in loop) Attributes of the loaded trade/order", not from "(Event trade)...."[/quote:2r6nofk9]I think that SLPipsDistPriceChannel is ok, the value that "toDigits(SLPipsDistPriceChannel)" gives in MQL4 is 0.0003, as expected.
-
I forgot to tell that this is also opening a new order to hedge the hedge before. But the work must always hedge the initial order, and will not open a hedge to hedge.
I forgot to tell that this is also opening a new order to hedge the hedge before. But the work must always hedge the initial order, and will not open a hedge to hedge.
I'll be checking what I said.
-
__Check this again...[/quote:1jufzxq6]
Checked__I think that SLPipsDistPriceChannel is ok, the value that "toDigits(SLPipsDistPriceChannel)" gives in MQL4 is 0.0003, as expected.[/quote:1jufzxq6]
I think I did as I said in past messages. This does not correct this way? If not, how should I do? -
I think that your indicator (Price Channel.ex4) is missing

-
__I think that your indicator (Price Channel.ex4) is missing :)[/quote:12fb9sbq]
The indicator had previously posted here, but here goes again.
......
Price Channel.mq4 -
No, no, I have it. Check your logs, I think it's missing on your PC.
-
Yes .. would not have a way to make this indicator already is within the code, without the necessity of having it on MT4 platform?
-
No indicator can be within the code! What is in the code is a simple function named "iCustom" that links to the external indicator that must be located in "/experts/indicators" folder.