
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
Yes, I've understood. It's not possible to compare as cnt will have value like 3,2,1 while Ticket Number is something different.
Can I compare the Ticket Number like this?
Regards
Yes, I've understood. It's not possible to compare as cnt will have value like 3,2,1 while Ticket Number is something different.
Can I compare the Ticket Number like this?
Regards
no
if your pc has to restart then value Sell_Order_Ticket_1 (2 and 3 also) is lost
check orderopenprice and ordertakeprofit
no
if your pc has to restart then value Sell_Order_Ticket_1 (2 and 3 also) is lost
check orderopenprice and ordertakeprofit
I haven't understood why the value of Sell_Order_Ticket_1 will be lost after restarting the Terminal?
It's a variable and it is not getting over written unless a New Sell order is opening.
This is what I understand but there is logic behind your comment. So please explain a bit.
And I've looked the OrderOpenPrice and OrderTakeProfit functions. What to do with them?
I haven't understood why the value of Sell_Order_Ticket_1 will be lost after restarting the Terminal?
It's a variable and it is not getting over written unless a New Sell order is opening.
This is what I understand but there is logic behind your comment. So please explain a bit.
And I've looked the OrderOpenPrice and OrderTakeProfit functions. What to do with them?
All variables are lost on restarting the terminal.
Only Global Variables of the client terminal can be retrieved.
I haven't understood why the value of Sell_Order_Ticket_1 will be lost after restarting the Terminal?
It's a variable and it is not getting over written unless a New Sell order is opening.
This is what I understand but there is logic behind your comment. So please explain a bit.
And I've looked the OrderOpenPrice and OrderTakeProfit functions. What to do with them?
do some more testing creating your files
open the 3 trades
note the numbers you get
then close your metatrader4 and restart it again check the value of Sell_Order_Ticket_1, Sell_Order_Ticket_2 and Sell_Order_Ticket_3
are they the same ?? if not what value do you get ??
OK got it. This piece of info about 'Variable' will be Helpful for Future too.
How about this?
OK got it. This piece of info about 'Variable' will be Helpful for Future too.
How about this?
can we first look to your code of opening trades again ??
check the stoploss and takeprofit of those trades there is still something wrong do you see ??
can we first look to your code of opening trades again ??
check the stoploss and takeprofit of those trades there is still something wrong do you see ??
ohh, it's for wrong code. After Fixing the flaws, the Take Profit part is Fine Now but Stop Loss is the problem.
Logic:
if (Fast_EMA>Slow_SMA)
{
if (MA_Difference_1>=Value_Diff && iOpenOrders_Buy ==0)
{
Buy
}
}
ohh, it's for wrong code. After Fixing the flaws, the Take Profit part is Fine Now but Stop Loss is the problem.
what stoploss did you wanted ?? for those trades ??
Like here for USDJPY trades:
1st Trade (here the Last one due to the reverse arrangement of Time) has TP= 103.636
2nd Trade's TP= 103.736
3rd Trade's TP= 108.536 [ I set this TP at such distance thus it'll work like there is no TP]
Now, as per my requirement, when the price would be say 7 pip [103.603] in profit, the Stop Loss of
1st and 2nd trade will become say 1 pip profit [103.543] and 3rd trade's Stop Loss will remain at 103.386.
Like here in the below image:
1st GBPUSD order got closed at 10 pips Profit.
2nd Order is still running and it's SL got moved.
For 3rd Trade the SL got Moved too which I don't Want.