Ask! - page 119

 
Yoda_Glenn:
Thanks! Never thought of that. I still would like to know how I can see my cursor's current line number and character number within that line

When you click anywhere within the code, have a look at the bottom right hand corner of the editor and it will tell you where line you are on and where you are within that line.

 
basza:
When you click anywhere within the code, have a look at the bottom right hand corner of the editor and it will tell you where line you are on and where you are within that line.

Awesome, thanks!

 
:: in the right bottom corner of your metaEditor you see

Ln xxx, Col xxx = Line, Column ...

Yoda_Glenn:
Thanks! Never thought of that. I still would like to know how I can see my cursor's current line number and character number within that line
 
IN10TION:
:: in the right bottom corner of your metaEditor you see

Ln xxx, Col xxx = Line, Column ...

Duly noted, thanks!

 

S.O.S: Problem with Buy_STOP/Sell_STOP

Hello all,

I'd like to have a buystop and a sellstop taken at the same time. The buystop is always triggered, but the sellstop is only triggered for one second and disappeared leaving only the buystop. How do I correct that? Do I need to post some other parts of the code in order for you to help?

Thanks in advance for helping me.

Regards,

forexcel

Code:

if(position && lastsig!=1) {

co=CalculateCurrentOrders(Symbol()) ;

if (co==0) {

res = OpenStop(OP_BUYSTOP,LotsRisk(StopLo ss), High[shift]+OrderPipsDiff*Point, StopLoss, TakeProfit1);

res = OpenStop(OP_SELLSTOP,LotsRisk(StopL oss),Low[shift]-OrderPipsDiff*Point, StopLoss, TakeProfit2);

}

last=Time[0];

lastsig=1;

return;

 
:: use your code that only send out one order (a buy or a sell), when you have a confirmation that first one is accepted, start the second request (in your case the opposite then the first one)

:: you can NOT send two requests at ones.

forexcel:
Hello all,

I'd like to have a buystop and a sellstop taken at the same time. The buystop is always triggered, but the sellstop is only triggered for one second and disappeared leaving only the buystop. How do I correct that? Do I need to post some other parts of the code in order for you to help?

Thanks in advance for helping me.

Regards,

forexcel

Code:

if(position && lastsig!=1) {

co=CalculateCurrentOrders(Symbol()) ;

if (co==0) {

res = OpenStop(OP_BUYSTOP,LotsRisk(StopLo ss), High[shift]+OrderPipsDiff*Point, StopLoss, TakeProfit1);

res = OpenStop(OP_SELLSTOP,LotsRisk(StopL oss),Low[shift]-OrderPipsDiff*Point, StopLoss, TakeProfit2);

}

last=Time[0];

lastsig=1;

return;
 
IN10TION:
:: use your code that only send out one order (a buy or a sell), when you have a confirmation that first one is accepted, start the second request (in your case the opposite then the first one)

:: you can NOT send two requests at ones.

Thanks for your reply In10TION...

Can you code it for me, please?

Thanks

forexcel

 

You may use this script (attached) to place 2 pending orders.

Files:
 
:: is this script working ok? Would be strange because there also, the orders are send together, or shortly after each other, they don't wait for conformation. I think it will make faults sometimes.

:: sorry forexcel, but not have the time... I think you can figure it out? eat some brain food...

little tip: start with only buys... when that is working, do sell at a next tick when you have confirmation when your buy is ok.

newdigital:
You may use this script (attached) to place 2 pending orders.
 

yes, it is sending buy and sell pending orders almost together with 1 or 3 seconds interval (on demo). On real account may be more.