How to code? - page 238

 

new MA ea ...

Hello

I whant to find a Ma expert to do this ... can anyone help me ... ?

-open a buy or sell when price cross ma with reverse signal option

- to have a option in the menu to chose distance from the MA to take the signal like 5 pip from MA or more ( custom )

-to chose what type of MA .... olso apply to open , close , ...

-custom TP ... SL traling stop

-to close position on the next signal or at a certain distance in pips from\ under MA

- money management

- to open only 1 position at a time no more ... no hedge ...

-martingale function

-and a secondary MA (*this its optional )

- RSI to filter MA signals

maibe i'm asking for too much ... sorry for my poor english

Regards

 

Hi!

Please, i want to programe this:

if my order take the stoploss, my next order have the double of Lot Size.

I send only 1 order per day, so, if this order take the stoploss, the next trade i use the double of lot size.

How i can programe this?

I will thank you much if you help me.

 

I think you are very brave

like 3 left turn , around 1 block, ---- > will resulting in a RIGHT TURN [ it becomes ]

===== to answer your theory on trading methodology --- simple, you can write it yourself -- you go back to your EA and look at the result daily -- then you have an external parameter , you could enter 1 or 2 manually, then you could have 2 part of the same code, that this parameter will toggle between 1 or 2 lots of the same section of code i.e. write it twice-- but sound like basic Q -- did you try it manually or in excel and ensure that it works ?? [ before trying to code it -- take a weekend only , for semi-auto method]

 

Hi!

Please, i want to programe this:

if my order take the stoploss, my next order have the double of Lot Size.

I send only 1 order per day, so, if this order take the stoploss, the next trade i use the double of lot size.

How i can programe this?

I will thank you much if you help me.

 

dynamic update of ea/script

Right now im writing a script to use sockets to control metatrader from another language. Ive got alot working, buy/placing/getting info on orders, close/high, etc. , but i would like to be able to dynamically change the code without pulling down the server. Specifically, i would like to writing bindings to custom indicators using iCustom, compile the one mqh file which contains the bindings, and have the updated code now be referenced by the running server script. Any way to do this?

 

Hi!

Please, i want to programe this:

if my order take the stoploss, my next order have the double of Lot Size.

I send only 1 order per day, so, if this order take the stoploss, the next trade i use the double of lot size.

How i can programe this?

I will thank you much if you help me.

 
Apolofx:
Hi!

Please, i want to programe this:

if my order take the stoploss, my next order have the double of Lot Size.

I send only 1 order per day, so, if this order take the stoploss, the next trade i use the double of lot size.

How i can programe this?

I will thank you much if you help me.

Apolofx,

you would need to check the "History of last Orders" to see whether it was profitable or not and then use a multiplier to multiply the current order etc , fastest and crude..

Algorithm would be

1. Check the history with all the last orders ---

2. If the history has orders and with the right symbol() /Magic etc

3. Get the profit/loss of the last trade

4. If the trade was positive do something or nothing

5. if the trade was negative assign the order x some multiplier if you wish

there that is the simplest algorithm .

-guyver

 
Guyver:
Apolofx,

you would need to check the "History of last Orders" to see whether it was profitable or not and then use a multiplier to multiply the current order etc , fastest and crude..

Algorithm would be

1. Check the history with all the last orders ---

2. If the history has orders and with the right symbol() /Magic etc

3. Get the profit/loss of the last trade

4. If the trade was positive do something or nothing

5. if the trade was negative assign the order x some multiplier if you wish

there that is the simplest algorithm .

-guyver

Thank you very much Guyver!!!!

i am using this code:

if (Hour()==0 && Minute()==0 && Seconds()==0)

{

int hstTotal=OrdersHistoryTotal();

OrderSelect(hstTotal,SELECT_BY_TICKET,MODE_HISTORY);

{

if (OrderProfit() < 0)

Lot=1;

else

Lot=0.1;

}

}

 
Apolofx:
Thank you very much Guyver!!!!

i am using this code:

if (Hour()==0 && Minute()==0 && Seconds()==0)

{

int hstTotal=OrdersHistoryTotal();

OrderSelect(hstTotal,SELECT_BY_TICKET,MODE_HISTORY);

{

if (OrderProfit() < 0)

Lot=1;

else

Lot=0.1;

}

}

first you may not need an Hour Check here .. second you would need a loop and might move the code to some function that would be better as an e.g

double GetLots() {

double lotsize;

for (int i = 0; i < OrdersHistoryTotal(); i++)

{

// you can write code here for order select

}

}

 

Hi,

I'm a newbie in programming and i found an S/R indicator which interests me. But i want add a sound alert to this indicator (when the PA crosses a support or a resistance). Is it easy ?

Thanks for your answer !

Files:
supersr7.mq4  3 kb
Reason: