Programming a state machine for metatrader

 

Hi,

I have a problem with my program idea.

I am able to draw my trading idea like a state machine with different states and different steps at each state.

But I can't program it in the right way :-(

In a few points in my program I have to ensure that a certain step would be done and nothing else but etc. when the broker doesn't accept the order

my program get in trouble.


Can anybody give me an example how I can program such an problem in the right way??

I would be very, very grateful!!

 
How would you trade this manually if your Broker didn't accept your order ?
 
Sometimes I have to send my order twice and then the broker accept my order.
 
sunshineh:
Sometimes I have to send my order twice and then the broker accept my order.
And if not ? what would you do ?
Reason: