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
modified some of your code, to select highest lot first.
Correct me if I am wrong but I dont think this code will work as it reverses the order—which I am not doing. I am simply placing another sell with double the lots at every 3 pip interval.
If you just want to add volume to your trades in the same direction - no need to close previous trade, but just open a new one with additional volume.
I need to close the trade because it reduces risk. It is better to close the last trade than let all run because it significantly reduces the overall loss should the total SL of 18 pips be hit.
Correct me if I am wrong but I dont think this code will work as it reverses the order—which I am not doing. I am simply placing another sell with double the lots at every 3 pip interval.
If you're opening orders in the same direction immediately after closing them then you're just wasting money and need to rethink that strategy.
modified some of your code, to select highest lot first.
There's no need to select the highest volume order first since smaller orders always split off larger ones which results in the need to send the ordercloseby command the same amount of times no matter how they are ordered. That's the reason for the recursive call as opposed to just continuing the loop. The only time I've seen it make sense to add more logic is for someone like a signal provider, who wants to arrange the orders to be reconciled in such a way will yield the smoothest possible equity curve. That's an algorithm far more advanced than what we're discussing ITT however...
Additionally, the code doesn't do anything different. The first order that meets the criteria will always be > 0 lots, and every recursive call resets the lots var back to zero. If you wanted to closeby larger orders first then you'd need to sort the order pool by size @ each call to multiple_closeby()
If you're opening orders in the same direction immediately after closing them then you're just wasting money and need to rethink that strategy.
Yes, but theyre spaced 3 pips apart as I mentioned. Therefore, this isnt wasting money. It’s better than traditional martingale where the losses are gigantic when SL hits. I’m trying to minimize that by closing the last trade at the open of the next trade spaced 3 pips apart.
Yes, but theyre spaced 3 pips apart as I mentioned. Therefore, this isnt wasting money. It’s better than traditional martingale where the losses are gigantic when SL hits. I’m trying to minimize that by closing the last trade at the open of the next trade spaced 3 pips apart.
That exactly proves my point. Just keep the original position open and reduce the volume of the next accordingly. Your net position is the same and you didn't pay the broker twice!
Yes, but theyre spaced 3 pips apart as I mentioned. Therefore, this isnt wasting money. It’s better than traditional martingale where the losses are gigantic when SL hits. I’m trying to minimize that by closing the last trade at the open of the next trade spaced 3 pips apart.
3pips (30point) is too narrow, imho.
anyway, quick code, didn't test.
call it on OnTick()
ps: edit some codeThat exactly proves my point. Just keep the original position open and reduce the volume of the next accordingly. Your net position is the same and you didn't pay the broker twice!
Correct me if I’m wrong (I’m trying to best understand) but I believe you have the wrong idea.
I do not open an order in the opposite direction if price moves 3 pips against my original sell. Instead, I open a sell if price moves 3 pips against me that has twice the volume of the last sell so that if it retraces 3 pips down to the first sell, it covers the losses of the first trade and profits.
There's no need to select the highest volume order first since smaller orders always split off larger ones which results in the need to send the ordercloseby command the same amount of times no matter how they are ordered. That's the reason for the recursive call as opposed to just continuing the loop. The only time I've seen it make sense to add more logic is for someone like a signal provider, who wants to arrange the orders to be reconciled in such a way will yield the smoothest possible equity curve. That's an algorithm far more advanced than what we're discussing ITT however...
thank you @nicholi shen
3pips (30point) is too narrow, imho.
anyway, quick code, didn't test.
call it on OnTick()
Thank you so much! I will throw this into my original code, give it a test, and let you know ASAP!