hey pipqueen,
I have been tweaking and making changes as per my needs thank you for the huge boost in my start. you may need to look at your button_basket_29 to 36 since they are referencing basket button 1 and 2....it doesn't affect usage it just leaves the button basket selected even once its been clicked instead of releasing it.
I am trying to add a break even code and am having trouble with it, as i've mentioned my coding skills are none existent so i was wondering if you or amyone could take a look at my code and tell me my its not working or even shorten it
[/code]
I have been tweaking and making changes as per my needs thank you for the huge boost in my start. you may need to look at your button_basket_29 to 36 since they are referencing basket button 1 and 2....it doesn't affect usage it just leaves the button basket selected even once its been clicked instead of releasing it.
I am trying to add a break even code and am having trouble with it, as i've mentioned my coding skills are none existent so i was wondering if you or amyone could take a look at my code and tell me my its not working or even shorten it
Inserted Code
[code] void Breakeven() { int orders=0,TicOrder=0; orders= OrdersTotal(); for(int m=0;m<orders;m++) { if(OrderSelect(m,SELECT_BY_POS)==true && OrderType()==OP_BUY){ if (Bid > (OrderOpenPrice()+OrderOpenPrice()-OrderStopLoss())) { double new_stoploss= OrderOpenPrice(); double current_SL=OrderStopLoss(); if(new_stoploss>current_SL) { double SL=NormalizeDouble(new_stoploss,Digits); OrderModify(OrderTicket(),OrderOpenPrice(),SL,OrderTakeProfit(),0); } } } } for(int n=0;n<orders;n++) { if(OrderSelect(n,SELECT_BY_POS)==true && OrderType()==OP_SELL){ if (Ask<(OrderOpenPrice()+OrderOpenPrice()-OrderStopLoss())) { double new_stoploss= OrderOpenPrice(); double current_SL=OrderStopLoss(); if(new_stoploss>current_SL) { double SL=NormalizeDouble(new_stoploss,Digits); OrderModify(OrderTicket(),OrderOpenPrice(),SL,OrderTakeProfit(),0); } } } }}