A script runs once . . . and EA has it's start function run for each tick. Is this a Script or an EA ?
Why aren't you checking and printing any error generated as a result of the OrderModify ?
Ummm.....to tell u the truth. Im a noob.....lol started. Still dont quite sure where to put which important codes. All i know that there is no error when i compile this script. So i really dont know what went wrong. Only after i try the script on the chart....i saw uninit error 0 marketinfo something like that.
Only after i try the script on the chart....i saw uninit error 0 marketinfo something like that.
Ah . . . this is the problem.
double StopLevel = MarketInfo(Symbol(),MODE_STOPLEVEL * (Ask+PFEP*EntPoint));
what are you trying to do here ?
Ah . . . this is the problem.
what are you trying to do here ?
Seriously......i dont know. lol.....was trying all sorts of way. Forgive my stupidity.....ive just started no longer den a mth. I thought of at least writing my first script before i move on to writing an EA.....but i guess what i want to achieve is kinda too far stretch for me.
Still not sure how to do a 2 pending order with 1 to modify the SL and TP....the other to modify the SL and add in trailing.....sigh.....
Any Advice for a newbie like me?
Seriously......i dont know.
If you just want stoplevel all you need is this . ..
double StopLevel = MarketInfo(Symbol(),MODE_STOPLEVEL);
if you want it as a price do this . . .
double StopLevel = MarketInfo(Symbol(),MODE_STOPLEVEL) * EntPoint;
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello to whoever is reading this. Hope that someone out that is able to help me with this. Kinda Beginner myself.
I was hoping to create a script that does 2 pending order after i double click it. But this script that i wrote only opens the pending order but doesnt modify it. Hope that there is someone can help me add those codes that is missing. Havent been able to figure out how to code for the 2nd pending order though. Coz there is no error and my MT4 doesnt shows me any errors also. Need to work on ECN brokers.
2 Pending orders
Both 15 pips away from price.
1st has a SL of 15 TP of 20
2nd has a SL of 15 Trail of 20
Anyone out there able to help me.....Thanks in advance.