Programming help..

 

Hello,


I've been fooling around with the MQL API and I have made an indicator and a EA that uses information from the indicator.


Indicator plots potential buy and sell levels but never both at the same time. The EA was made to scalp the M1.


What I want the EA to do:


Make 1 trade at a time. Set stopsells on the short level, change the stopsell price as the stop-level rises. and vise versa for long.


What it actually does:

Because I don't really understand how to make pending orders, then change them as the stop level rises, I have it simply set to:


if(Ask==ShortLine){ticket = OrderSend(Symbol(),OP_SELL...


This results in multiple trades. & usually misses the sell price/buy price recommendation


It also does only long trades..


If anyone is willing to help me out, I'll share my code.


Attached is pictures from a backtest




Only trading $0.10/pip lot on about 25 days worth of ticks.


I used visual mode to see if the trades were being done properly and they were NOT as the EA does not account for the change in the recommended price. I cannot figure out how to account for the change in the programming EA. This is where majority of the losses are from.


Please message me and let me know!
 
twizt:

Hello,


I've been fooling around with the MQL API and I have made an indicator and a EA that uses information from the indicator.


Indicator plots potential buy and sell levels but never both at the same time. The EA was made to scalp the M1.


What I want the EA to do:


Make 1 trade at a time. Set stopsells on the short level, change the stopsell price as the stop-level rises. and vise versa for long.


What it actually does:

Because I don't really understand how to make pending orders, then change them as the stop level rises, I have it simply set to:


if(Ask==ShortLine){ticket = OrderSend(Symbol(),OP_SELL...


This results in multiple trades. & usually misses the sell price/buy price recommendation


It also does only long trades..


If anyone is willing to help me out, I'll share my code.


Attached is pictures from a backtest




Only trading $0.10/pip lot on about 25 days worth of ticks.


I used visual mode to see if the trades were being done properly and they were NOT as the EA does not account for the change in the recommended price. I cannot figure out how to account for the change in the programming EA. This is where majority of the losses are from.


Please message me and let me know!

Simple, replace OP_BUY or OP_SELL with one of the functions described below:


2 types of pending orders:

1. Limit order: (ie: price retreats back to the level you want to buy or sell, use functions OP_BUYLIMIT or OP_SELLLIMIT)


2. Stop order : ( ie for breakout trades, use functions OP_BUYSTOP or SP_SELLSTOP)

Check the documentation for the exact syntax.

Reason: