Coding help - page 24

 

I need your Help

I have find coding what I want , and now I need a little bit variation.

- If now the horisontal line called Supply zone ,how the coding to make Demand horisontal line too ?

- Now the Indicator using this setting "DrawWhenSmallerThan = 13 work at H1, how the coding to make DS line at H4 and D1 also but still work from H1? Sure with anothers setting for DrawWhenSmallerThan = ...

Thank you before

Files:
 

Please Help me Fix the coding

Sorry I cancel this question and jump to next question.

Thank you

Very tired and dizzy

 

...

paijowijaya

You might look at this thread : https://www.mql5.com/en/forum/173574

You will find a lot of examples of how to make multi time frame indicators, and it seems that it is what you need now

paijowijaya:
I have find coding what I want , and now I need a little bit variation.

- If now the horisontal line called Supply zone ,how the coding to make Demand horisontal line too ?

- Now the Indicator using this setting "DrawWhenSmallerThan = 13 work at H1, how the coding to make DS line at H4 and D1 also but still work from H1? Sure with anothers setting for DrawWhenSmallerThan = ...

Thank you before
 
mladen:
paijowijaya

You might look at this thread : https://www.mql5.com/en/forum/173574

You will find a lot of examples of how to make multi time frame indicators, and it seems that it is what you need now

Hi,

Glad to hear you again Master Mladen after you disappeared for a few days. Thank you for your attention, but before I go there how about the question no.1. I need make anothers line. Try that indicator Master you will be know what I mean. Basically I want to make indcator Supply and Demand, but now I just have a Supply or Demand only.

My Best Regards for you and your family Master Mladen

Thank you

 

Describe more than 4 Candles... Help please.

Hi to all master coders,

Im in headache... please help.

How can we describe more than 4 Candles buy continuously into the code?

eg : On tokyo session, there are 4 or more than 4 candle buy continuously or;

On tokyo session, there are 4 or more than 4 candle sell continuously.

and after we recognised it, how to command the code to "

no trade

"?

please.... help me!!!!! (Sorry for my poor english)

Regards,

crexsking

 
When you say "4 Candles buy continuously" do you mean 4 candles in which close i higher than the open? If yes, you can write it similar to this :
bool 4Buys = (Close>Open &&

Close>Open &&

Close>Open &&

Close>Open)

[/PHP]

similarly you can test the opposite too :[PHP] bool 4Sells = (Close<Open &&

Close<Open &&

Close<Open &&

Close<Open)

provided that I understood correctly what conditions you wish to test

For sessions you would need to check the TimeCurrent() too (TimeCurrent() is returning broker current time, so you will probably have to make GMT adjustment depending on your broker time zone)

crexsking:
Hi to all master coders,

Im in headache... please help.

How can we describe more than 4 Candles buy continuously into the code?

eg : On tokyo session, there are 4 or more than 4 candle buy continuously or;

On tokyo session, there are 4 or more than 4 candle sell continuously.

and after we recognised it, how to command the code to "

no trade

"?

please.... help me!!!!! (Sorry for my poor english)

Regards,

crexsking
 

Command to NO TRADE

mladen:
When you say "4 Candles buy continuously" do you mean 4 candles in which close i higher than the open? If yes, you can write it similar to this :
bool 4Buys = (Close>Open &&

Close>Open &&

Close>Open &&

Close>Open)

[/PHP]

similarly you can test the opposite too :[PHP] bool 4Sells = (Close<Open &&

Close<Open &&

Close<Open &&

Close<Open)

provided that I understood correctly what conditions you wish to test

For sessions you would need to check the TimeCurrent() too (TimeCurrent() is returning broker current time, so you will probably have to make GMT adjustment depending on your broker time zone)

Yes!!!

That what i mean... Thank u Mr. mladen...

But... when we recognise it, how to cammand it to "NO TRADE"?

for example :

1. In tokyo session there are 4 or more than 4 candle sell continuously. (completed... that code was granted by u)

2. After that, when the London session open, suddenly the big candle > 32 pips appear (buy or sell).

3. I want to command my EA to "NO TRADE" at this condition.

thanks to u mladen 4 helping me...

regards,

crexsking

 

And 1 more Mr. mladen...

what i mean " suddenly the big candle > 32 pips appear" is:-

-i want my EA to open a post (buy/sell) after the big candle... (this code also done)

but if previously on tokyo session,

there are 4 or more than candle buy (continuously) or sell (continously)<-----(for me, i called this 4 candles continuously as

RISK MARKET)... the EA recognise the RISK MARKET and NO TRADE after that big candle.

The question here is.. What should i do to make an EA recognise the RISK MARKET n NO TRADE after the big candle?

regards,

crexsking

 

SomeBody Help!!!

W = Win , L = Lose

I want the OrderSend() Lots like this↓

Profit W W W W L L L L L L

Lot--> .01 .01 .01 .01 .01 .02 .06 .01 .02 .06

My Result

Profit W W W W L L L L L L L

Lot--> .01 .01 .01 .01 .02 .06 .06 .01 .02 .06 .06

if u dont mind,Please Simplify the Code and Pointed out the wrong

//------------------------------------------------Level 1 Buy & Sell---------------------------------------------------------------

//--------------------------Buy

int HT=OrdersHistoryTotal( ) ;

if( OrdersTotal( ) <1 && BuyCondition )

{

if(OrderSelect(HT-1,SELECT_BY_POS,MODE_HISTORY)==true)

{

if(OrderProfit()<0 && OrderLots()==0.01 )

{

ticket=OrderSend(Symbol(),OP_BUY,0.02,Ask,3,Ask-TP*Point*2,Ask+TP*Point,"BUY",16384,0,Lime);

if(ticket<0)

{

Print("OrderSend failed with error #",GetLastError());return(0);

}

return(0);

}

}

}

//------------------------Sell

if( OrdersTotal( ) <1 SellCondition)

{

if(OrderSelect(HT-1,SELECT_BY_POS,MODE_HISTORY)==true)

{

if(OrderProfit()<0 && OrderLots()==0.01 )

{

ticket=OrderSend(Symbol(),OP_SELL,0.02,Bid,3,Bid+TP*Point*2,Bid-TP*Point,"SELL",16384,0,Red);

if(ticket<0)

{

Print("OrderSend failed with error #",GetLastError());return(0);

}

return(0);

}

}

}

//------------------------------------------------------------------------------------------------------------------------------- //

//-------------------------------------------------Level 2 Buy & Sell-------------------------------------------------------------//

//--------------------------Lv2 Buy

if(OrdersTotal( ) <1 && BuyCondition )//---Buy Condition

{

for(int i=1;i<=2;i++)

{

if(OrderSelect(HT-i,SELECT_BY_POS,MODE_HISTORY)==true)

{

if(OrderProfit()<0 && OrderLots()==0.02)

{

ticket=OrderSend(Symbol(),OP_BUY,0.06,Ask,3,Ask-TP*Point*2,Ask+TP*Point,"BUY",16384,0,Lime);

if(ticket<0)

{

Print("OrderSend failed with error #",GetLastError());return(0);

}

return(0);

}

}

}

}

//--------------------------Lv2 Sell

if( OrdersTotal( ) <1 && SellCondition)//---Sell Condition

{

for(int k=1;k<=2;k++)

{

if(OrderSelect(HT-k,SELECT_BY_POS,MODE_HISTORY)==true)

{

if(OrderProfit()<0 && OrderLots()==0.02)

{

ticket=OrderSend(Symbol(),OP_SELL,0.06,Bid,3,Bid+TP*Point*2,Bid-TP*Point,"SELL",16384,0,Red);

if(ticket<0)

{

Print("OrderSend failed with error #",GetLastError());return(0);

}

return(0);

}

}

}

}

 

I already fix my problem~

int HT=OrdersHistoryTotal( ) ;

if( OrdersTotal( ) <1 && ValLongVal_Factor)

{

if(OrderSelect(HT-1,SELECT_BY_POS,MODE_HISTORY)==true)

{

if(OrderProfit()<0 && OrderLots()==0.01 )

{

ticket=OrderSend(Symbol(),OP_BUY,0.02,Ask,3,Ask-TP*Point*2,Ask+TP*Point,"BUY",16384,0,Lime);

if(ticket<0)

{

Print("OrderSend failed with error #",GetLastError());return(0);

}

return(0);

}

}

}

//------------------------LV1 Sell

if( OrdersTotal( ) V_Fac && LongVal<-LongVal_Factor)

{

if(OrderSelect(HT-1,SELECT_BY_POS,MODE_HISTORY)==true)

{

if(OrderProfit()<0 && OrderLots()==0.01 )

{

ticket=OrderSend(Symbol(),OP_SELL,0.02,Bid,3,Bid+TP*Point*2,Bid-TP*Point,"SELL",16384,0,Red);

if(ticket<0)

{

Print("OrderSend failed with error #",GetLastError());return(0);

}

return(0);

}

}

}

//------------------------------------------------------------------------------------------------------------------------------- //

//-------------------------------------------------Level 2 Buy & Sell-------------------------------------------------------------//

//--------------------------Lv2 Buy

if(OrdersTotal( ) <1 && ValLongVal_Factor )//---Buy Condition

{

if(OrderSelect(HT-1,SELECT_BY_POS,MODE_HISTORY)==true)

{

if(OrderProfit()<0 && OrderLots()==0.02)

{

ticket=OrderSend(Symbol(),OP_BUY,0.06,Ask,3,Ask-TP*Point*2,Ask+TP*Point,"BUY",16384,0,Lime);

if(ticket<0)

{

Print("OrderSend failed with error #",GetLastError());return(0);

}

return(0);

}

}

}

//--------------------------Lv2 Sell

if( OrdersTotal( ) V_Fac && LongVal<-LongVal_Factor )//---Sell Condition

{

if(OrderSelect(HT-1,SELECT_BY_POS,MODE_HISTORY)==true)

{

if(OrderProfit()<0 && OrderLots()==0.02)

{

ticket=OrderSend(Symbol(),OP_SELL,0.06,Bid,3,Bid+TP*Point*2,Bid-TP*Point,"SELL",16384,0,Red);

if(ticket<0)

{

Print("OrderSend failed with error #",GetLastError());return(0);

}

return(0);

}

}

}

//-------------------------------------------------BUY----------------------------------------------------------------//

if(OrdersTotal( ) <1 && ValLongVal_Factor)

{

ticket=OrderSend(Symbol(),OP_BUY,0.01,Ask,3,Ask-TP*Point*2,Ask+TP*Point,"BUY",16384,0,Lime);

if(ticket<0)

{

Print("OrderSend failed with error #",GetLastError());return(0);

}

return(0);

}

//--------------------------------------------------SELL--------------------------------------------------------------//

if(OrdersTotal( ) V_Fac && LongVal<-LongVal_Factor ) /*|| (OrdersTotal( ) <1 && Val<0.6 && LongVal<-0.5 ))*/

{

ticket=OrderSend(Symbol(),OP_SELL,0.01,Bid,3,Bid+TP*Point*2,Bid-TP*Point,"SELL",16384,0,Red);

if(ticket<0)

{

Print("OrderSend failed with error #",GetLastError());return(0);

}

return(0);

}

return(0);

}