- Please Help needed : Trailing Stop Code
- I need some help in moving my buy/sell price in direction of market price
- help with step in the trailing SL & TP in MQL5
- www.mql5.com
I paid someone to do this same thing exact and the bot was **** I shouldve know better before paying but its okay. I know a little code now , all I need is help with this part to create the rest of EA myself :)
Is there a time window for these 50 pips to trigger, I really wanna help you but my brain is melting from coding for like 12 hours straight
I paid someone to do this same thing exact and the bot was **** I shouldve know better before paying but its okay. I know a little code now , all I need is help with this part to create the rest of EA myself :)
Post your code using the code button(Alt+S) and explain what section(s) you are asking for help with.
Post your code using the code button(Alt+S) and explain what section(s) you are asking for help with.
<Deleted>
<Deleted>
Post your code using the code button(Alt+S) and explain what section(s) you are asking for help with.
.
.
/+------------------------------------------------------------------+ extern double lots; extern double Trail_start; extern double Trail_step; extern double Trail_stop; //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--- double level1 = Ask+50*Digits ; double level2 = Bid-50*Digits ; if ( level1 ) { OrderSend(Symbol(),OP_BUYSTOP,0.01,Ask,3,0,0,"BUY",0,0,Green); } if ( level2 ) { OrderSend(Symbol(),OP_SELLSTOP,0.01,Bid,3,0,0,"SELL",0,0,Red); } //--- } //+------------------------------------------------------------------+
Ok basically I want the bot to place a buy each time price moves 50 points up and a sell each time price moves 50 points/pips down. For example , price is at 1.10100 if price drop to 1.10150 open sell and if price rise 1.10150 open buy . I trade every instrument forex stocks comm and index. in forex you usually have pairs wth 5-3 digits. in indexes you have pairs with 2 and 1 digits. I want the bot to be able to trade all of these instruments. so make it able to trade pairs with 3 digits such as usd/jpy , us30 which has 1 digit . Make the bot tradeable with 1,2,3,4,and 5 digit(/decimal places) pairs. Lastly , I know how to code the trailing stop to the external properties window bt it is not working . Im guessing there has to be a code as well in the On Tick () section. I want the trailing stop to have trial start step and stop. THnaks
double level1 = Ask+50*Digits ; double level2 = Bid-50*Digits ;
Think about what the result of these will be.
if
( level1 )
level1 is not a bool.
If you want to trade non-forex, consider using Points instead of Pips.
In future please post in the correct section
I will move this topic to the MQL4 and Metatrader 4 section.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use