[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 97
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
paladin80, the problem is not opening an order... it works fine... I skimmed this part to make it clear which variables from the post of 01.05.12 19:15 where used further...
the problem is this (see below), it's a one-off execution and for some reason Vol increases to infinity, hence the Lts increases to infinity... it's not clear... please see the post in question and tell me what's wrong...
Does anyone know how to convert the number of pips into currency?
i.e. if the profit is in units of currency, then 50 pips should be converted into units of currency... i.e. leverage should be taken into account...? 0_о
profit=lot*points*TICK_VALUE
oDin48, have you ever thought that all of a sudden an order opens and an error slips somewhere? Then the order will open and Vol will increase?
I am saying off the top of my head, because similar situations have occurred to me before, when programming in other languages
Try to show the error number in the message window and see what it is
gogent, everything was working fine until I wrote the trading criteria, or rather everything was fine with the others, but there's something wrong with these... so i don't think it's the "order opening" code... The order openings do not cycle, they open one at a time when the signal goes off... ... so it is either a condition related to Vol or a condition related to VP... I am trying to rewrite the same in different words, let's see what happens...
Added:
It's about the VP. Something in the code below is wrong... it is executed, as I understand it, every time one MA is higher than the other... i.e. always... Is the additional condition not working? Why? Like Opn_B, Cls_B, Opn_S, Cls_S, works fine, not created on every tick, but VP goes to infinity somewhere...
profit=lot*points*TICK_VALUE
thank you! =)
I'm sorry, one more question has arisen. is there a simple way to lock an order at take profit?
i.e. let's say there are 3 orders, and one of them closed. how can i signal it closed and get its profit (or loss)?
w ersoc, every tick (i.e. in start()) check if the order has closed at TP. And by the way, all actions of the EA are registered in the log (or only during testing...?)
now of course testing is more important...
the end result is that there will always be a previously closed profit... The logic of the problem is that only when take profit is triggered, we should somehow make a flag.