how I can open 2 position

 

hi

I wrote an expert that define 2 button Buy and Sell

can I define that when click on each button it opens 2 position in one click

I mean when I click on Buy it opens 2 buy position and when I click on Sell it opens 2 Sell position

Best Regards

Neda

 
Neda shahbazi: can I define …

Can you code? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
          No free help 2017.04.21

Or pay someone. Top of every page is the link Freelance.
          Hiring to write script - General - MQL5 programming forum 2018.05.12

 
William Roeder:

Can you code? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
          No free help 2017.04.21

Or pay someone. Top of every page is the link Freelance.
          Hiring to write script - General - MQL5 programming forum 2018.05.12

i just want to now is it possible or NO?

 
Neda shahbazi:

i just want to now is it possible or NO?

Yes, of course it is possible.

 
Neda shahbazi:

i just want to now is it possible or NO?

If you just created a button on the chart, use EventChartCustom to catch a button click and then you can open as many orders as you want.

If you use form based on CAppDialog, check SimplePanel example in the MT4 Indicators folder.

EventChartCustom - Working with Events - MQL4 Reference
EventChartCustom - Working with Events - MQL4 Reference
  • docs.mql4.com
Returns true if a custom event has been successfully placed in the events queue of the chart that receives the events. In case of failure, it returns false. Use GetLastError() to get an error code. An Expert Advisor or indicator attached to the specified chart handles the event using the function OnChartEvent(int event_id, long& lparam, double...
 
Drazen Penic:

If you just created a button on the chart, use EventChartCustom to catch a button click and then you can open as many orders as you want.

If you use form based on CAppDialog, check SimplePanel example in the MT4 Indicators folder.

I want it opens  position in one chart at same time

 
Neda shahbazi:

I want it opens  position in one chart at same time

What stops you?

Did you check the example on EventChartCustom page?

Do something like that and in that function add two OrderSend() statements.

You can't open two orders with one OrderSend().

 
  1. Neda shahbazi: I want it opens  position in one chart at same time
    You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
              No free help 2017.04.21

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum 2018.05.12

  2. Neda shahbazi: i just want to now is it possible or NO?

    Only if you can code or pay someone to. Asked and answered in #1. What part of that was unclear? (And the word is "know")

  3. Neda shahbazi: can I define 

    Only if you can code or pay someone to. Asked and answered in #1. What part of that was unclear?

    If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into your code.

    We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using CODE button) and state the nature of your problem.
              No free help 2017.04.21

 
Drazen Penic:

What stops you?

Did you check the example on EventChartCustom page?

Do something like that and in that function add two OrderSend() statements.

You can't open two orders with one OrderSend().

Drazen Penic:

What stops you?

Did you check the example on EventChartCustom page?

Do something like that and in that function add two OrderSend() statements.

You can't open two orders with one OrderSend().

ok thanks for your help

Best regards

Neda

Reason: