some can help me ?? thankz at all :)
- "Doesn't work" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. There are no mind readers here.
- We're not going to debug your code.
sorry
when i push button autoprofit , i should disable takeprofit target or enable it , but not do this remaning always in enable target takeprofit , and close operation.
how is possible ??
faustf: how is possible ??
|
but i write the code up , so ... in particular the problem i ddont understund is
// --------- Bottone Auto profit --------------------------------------- if(guiIsClicked(hwnd,Button7)) { PlaySound("ok.wav"); if(CtrlPush==0) { guiSetBgColor(hwnd,Label1,Red);guiSetTextColor(hwnd,Label1,Black); CtrlPush=1; AutoProfit=1; } else if(CtrlPush==1) { guiSetBgColor(hwnd,Label1,LightGreen);guiSetTextColor(hwnd,Label1,Black); CtrlPush=0; AutoProfit=0; } return(0); } // else PlaySound("alert.wav");
in practic , when i push a button change color , and set a variable AutoProfit=0 or 1 , (the logic is if you push first time set AutoProfit=1 , if you push 2° time AutoProfit=0), in this mode i know when is pressed or not
with this varible i can set if takeprofit on or off
i write this for do that
Print(" long auto proft è "+AutoProfit); if(AutoProfit==0) { if((Ctrl_LSFIX==1) && (Bid<=LStopFIX)) { bStatus_close=OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK),3,Red); // PlaySound("APPLAU22.WAV"); Ctrl_LSFIX=0; } if(Ctrl_LSFIX==0) { bStatus_close=OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK),3,Red); // PlaySound("APPLAU22.WAV"); } } if(AutoProfit==1) { if((Ctrl_LSFIX==1) && (Bid<=LStopFIX)) { bStatus_close=OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK),3,Red); // PlaySound("APPLAU22.WAV"); Ctrl_LSFIX=0; } if(Ctrl_LSFIX==0) { PlaySound("minion_ring_ring.wav"); } } }
but i dont understund why not work , example i press it and see label change green to red , but not remove the take profit .
For try to debug i use
Print(" long auto proft è "+AutoProfit);
and i saw in console write
2016.08.01 20:41:45.980 RoboCooP_V3 USDCAD,H4: short auto proft è 1
2016.08.01 20:41:45.980 RoboCooP_V3 USDCAD,H4: close #113021074 sell 0.01 GBPUSD at 1.31922 at price 1.31918
but close the operation
i ask only if you see a problem could tell me where is , is not necessary you write a solution , i wanna learn mql4 , not copy and past thankz
Why are you trying to fly before you can run?
Write simple scripts to learn how to handle orders.
Then make the next step.
thankz eddie , but my script is easy..... (for me ), i have only one problem , and i just write therfore if someone can help about the problem is welcome .
thankz at all again
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
i gut i try to develop a script for do a trade , this script create some button for open a trade with one click can open also 10 trade short or long and close it when arrive at profit 0.01 , i have created also another button for disable taget profit , the name of button is "Auto profit"
but when i try to active , not work , where is the error???