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
How to use the CSymbolInfo trade class
The code:
Hey, since i use loops to iterate through symbols and timeframes how can i place orders, modify and close them ?
Your question is not clear. I don’t understand your goal - you open a POSITION (not an order !!!) for a symbol. The timeframe does not matter here - the POSITION will be opened by the symbol. It's another matter when several strategies want to trade on a hedge account at once - then for each strategy you need to use its own 'Magic number'.
The simplest example is - Simple example One position
Your question is not clear. I don’t understand your goal - you open a POSITION (not an order !!!) for a symbol. The timeframe does not matter here - the POSITION will be opened by the symbol. It's another matter when several strategies want to trade on a hedge account at once - then for each strategy you need to use its own 'Magic number'.
The simplest example is - Simple example One position
Sorry for not making it clear, it's a scalping strategy, the EA will find a setup on M3 chart as well as M5 chart and open a position, i want to set take profit based on an indicator, in this case M3 chart, how would i go about this ?
Sorry for not making it clear, it's a scalping strategy, the EA will find a setup on M3 chart as well as M5 chart and open a position, i want to set take profit based on an indicator, in this case M3 chart, how would i go about this ?
If Stop Loss is set using the indicator from the M3 timeframe, then you must create an indicator handle and specify the timeframe when creating it.
For example like this:
can you help me understand how to code the part that opens and closes positions, checks for existing postions etc.
I cant find an article that clearly explains how to go about it, any suggestions from you would be grateful
can you help me understand how to code the part that opens and closes positions, checks for existing postions etc.
I cant find an article that clearly explains how to go about it, any suggestions from you would be grateful
Simple Advisor with Stop Loss and Take Profit
Intersection of two iMAs
Code: ' Example Intersection of two iMAs.mq5'
Task: determine the moment of intersection of two iMAs.
Remember the main rule: in MQL5 the indicator handle needs to be received once (it is optimal to do this in the OnInit function).
The Expert Advisor code demonstrates how to get values from two iMA indicators (a dash of the 'Fast' value and three values for the 'Slow' are displayed).
Also, if an intersection is detected, a message is displayed on the screen.
Result:
We are waiting for the size of the current bar to reach the specified size
Code: Example Current candle size.mq5