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
if(id==CHARTEVENT_OBJECT_CLICK && (StringFind(sparam,Button_1,0)>=0 || StringFind(sparam,Button_2,0)>=0))
{
ticketnumber=(int) StringSubstr(sparam,1);
Print(ticketnumber);
Print your ticket number - make sure it looks correct.
-----
if(id==CHARTEVENT_OBJECT_CLICK && (StringFind(sparam,Button_1,0)>=0 || StringFind(sparam,Button_2,0)>=0))
}{
ticketnumber=(int) StringSubstr(sparam,1);
if(OrderSelect(ticketnumber,SELECT_BY_TICKET))
{
if(StringFind(sparam,Button_1,0)>=0)
{
// ...
}
if(StringFind(sparam,Button_2,0)>=0)
{
//...
}
for(i=OrdersTotal()-1; i>=0; i--)
{
if(!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) continue;
if(Symbol()!=OrderSymbol()) continue;
update_1();
update_2();
update_3();
}
}
else printf("OrderSelect failed for %i",ticketnumber);
Check the OrderSelect is working.
-----
{
ticketnumber=(int) StringSubstr(sparam,1);
if(OrderSelect(ticketnumber,SELECT_BY_TICKET))
{
if(StringFind(sparam,Button_1,0)>=0)
{
// ...
}
if(StringFind(sparam,Button_2,0)>=0)
{
//...
}
for(i=OrdersTotal()-1; i>=0; i--)
{
if(!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) continue;
if(Symbol()!=OrderSymbol()) continue;
update_1();
update_2();
update_3();
}
}
}
I don't understand this.
You know this goes through every order with the same Symbol and runs update_1() update_2() update_3()? Not just the order you found with ticketnumber.
Print your ticket number - make sure it looks correct.
-----
Check the OrderSelect is working.
-----
I don't understand this.
You know this goes through every order with the same Symbol and runs update_1() update_2() update_3()? Not just the order you found with ticketnumber.
Thanks for your prompt comment.
After your comment, I checked once again. It looks good.
#1 - Ticket number - correct.
#2 - OrderSelect() works.
#3 - Yeah! you right, but if I do not use it that update_*()'s won't works.
I use that method for Drags, that method works good. But that method does not works good for CHARTEVENT_OBJECT_CLICK. ( it does work good while single order, when I open opposite order it does works. )
I really need help, please.
Show me a screenshot of what you want to happen. I'm not clear on the problem.
While I was making screenshot I found solution, just wow! ( I already spent over 2 hours for it )
So, it looks like good so far, if something will go to wrong about that I will write more clearly comment.
Thanks for your time.
( That was really magical. )
While I was making screenshot I found solution, just wow! ( I already spent over 2 hours for it )
So, it looks like good so far, if something will go to wrong about that I will write more clearly comment.
Thanks for your time.
( That was really magical. )
#Profit Currency Calculate - Open
I just started to find solution that how can I calculate Profit in Currency. e.g: 100 pip = 0.89 USD in USDJPY
Q: How can I convert Order Profit in pips to Order Profit in Currency, please?
( I just worry about I can't find solution till market close )
Any clearly comment would be better, please.
Thanks in advance.
//--- 2nd times edited
I found a lot of similar forums, but I can't find this type of topics.
How do you get to profit in pips?
Returned value:
The net profit value (without swaps or commissions) for the selected order.
For open orders, it is the current unrealized profit.
For closed orders, it is the fixed profit.
How do you get to profit in pips?
Returned value:
The net profit value (without swaps or commissions) for the selected order.
For open orders, it is the current unrealized profit.
For closed orders, it is the fixed profit.
Thanks for your comment.
Sorry Marco, I did not describe my issue more clearly.
I can easily get value Order Profit in Pips and Currency - with below codes.
DoubleToString( change_to_points( Bid - OrderOpenPrice() ), 0 );
But I try to find solution for Stop Loss and Take Profit in Currency.
I am working on it, and I still need help, please.
Thanks in advance.
Thanks for your more informative comment.
I am studying it...
//--- 2nd time edited
Maybe lack of code knowledge does not gives me permission to understand your calculation method.
But I think I close to solution. And I try below code that I get ( for Buy Order ) Stop Loss in Currency.
Then I get this results ( I know I passed something... because I can't imply them... ) e.g: Profits: 7.67 USD - Pips: 1001 / for USDCAD. But actually Profit: 7.69 USD. ( I already checked out ( Swap and Commission ) )
buy_stoploss_incurrency = OrderOpenPrice() - OrderStopLoss();
string stoploss_incurrency = DoubleToString( OrderLots() * buy_stoploss_incurrency * tickvalue + OrderCommission(), 2 );
Print( "stop loss in currency: ", stoploss_incurrency );
So, I need advice, please.
Thanks in advance.
//--- 3rd time edited
Please coder or programmer let me know above code is right? Because now I see correct Stop Loss in currency for GBPCHF, but not correct for USDCAD. I do not figure out what is wrong?! ( note: USDCAD open position, but GBPCHF is Pending orders. )
Everything is OK for now. So, thanks a lot Mr. William.