How to code? - page 66

 

thx!

thanks a lot for the help guys, this Renko thing is exactly what I was looking for!

 

Hi, thx for the reply , but could you show me how you would do this if you're not sure of the current min and max? Like when I just put the indicator on the chart and don't check the boxes for indicator minimum and maximum, there is a value in there (the actual min and max value of that particular chart), but when the timeframe is changed this value changes too (obvious because there's another chart...).

 

Code for only last sell?

I am looking for a bit of help with some simple code.

I simply want to display the price of the last sell on the screen comments. This is the best I can do, but this returns only a "0" on the screen. I do not care about the buys, just want to display the price of the last sell.

"\nOrderOpenPrice- -Sell: ", OP_SELL == OrderOpenPrice( ));

If I do this with the code:

"\nOrderOpenPrice- -Sell: ", OrderOpenPrice( ));

The screen comments will always show the last order wether it is a buy or a sell.

How can I change this so it will only show only the last sell?

Any help would be appreciated.

Thanks, Stephen

 
Stephen:
I am looking for a bit of help with some simple code.

I simply want to display the price of the last sell on the screen comments. This is the best I can do, but this returns only a "0" on the screen. I do not care about the buys, just want to display the price of the last sell.

"\nOrderOpenPrice- -Sell: ", OP_SELL == OrderOpenPrice( ));

If I do this with the code:

"\nOrderOpenPrice- -Sell: ", OrderOpenPrice( ));

The screen comments will always show the last order wether it is a buy or a sell.

How can I change this so it will only show only the last sell?

Any help would be appreciated.

Thanks, Stephen

Comment("\nOrderOpenPrice- -Sell: " + DoubleToStr(OrderOpenPrice(),Digits));

 

Problem with indicator b/c of 0.0000,1 spreads

Hello,

I have a problem with my indicator when a provider is using instead of i.e. EUR/USD 0.0001 ..... 0.0000,1 (1,48125) means having 5 digits after the dot.

Does anyone know how to fix such problem???

Thanks ahead,

Bayernusa

 

still having trouble

Thank you for your kind reply, omelette. The code you have posted for me here is helpful, but it does not comment the last sell only. It comments both buys and sells. I would like for it to comment only the last sell.

Any furthur instruction would be appreciated

Thank you, Stephen

 
Stephen:
Thank you for your kind reply, omelette. The code you have posted for me here is helpful, but it does not comment the last sell only. It comments both buys and sells. I would like for it to comment only the last sell.

Any furthur instruction would be appreciated

Thank you, Stephen

I thought it was just trying to display a floating point number (correctly formatted). - maybe not...

I am not sure you realise that OrderOpenPrice() cannot be used in unison - you must first select the ticket using OrderSelect(). And if you do know this, you should also know that you can differentiate between order types with the use of OrderType() - which is what I think is what I think you are trying to do.

 

AMIBROKER indicator to MQ2

can some talented coder write this in .mq4? THANKS

--------------------------------------------------------------------------------

// Brian Intra-day idea.

//

// 3 Nov 06.

// This is just a draft based on my understanding of Brian idea...

// Not sure if this is what he mean exactly, need to verify.

//SetChartBkGradientFill( ParamColor("BgTop", colorWhite),ParamColor("BgBottom", colorLightYellow),ParamColor("title block",colorWhite));

Displacement = Param("Displacement", 1, 0, 1 );

Diff_prd1 = 5;

Diff_prd2 = 7;

Diff_prd3 = 22;

Diff_prd4 = 80;

Diff_HL= H - L;

Diff_HL_MA1= MA(Diff_HL,Diff_prd1);

Diff_HL_MA2= MA(Diff_HL,Diff_prd2);

Diff_HL_MA3= MA(Diff_HL,Diff_prd3);

Diff_HL_MA4= MA(Diff_HL,Diff_prd4);

Plot( Diff_HL, _DEFAULT_NAME(), ParamColor("Color", ColorCycle), ParamStyle("Histogram style", styleHistogram | styleNoLabel|4, maskHistogram ));

Plot( Diff_HL_MA1, "MA5", colorGreen, styleLine, 0, 0, Displacement );

Plot( Diff_HL_MA2, "MA7", colorBlue, styleLine, 0, 0, Displacement );

Plot( Diff_HL_MA3, "MA22", colorRed, styleLine, 0, 0, Displacement );

Plot( Diff_HL_MA4, "MA80", colorGold, styleLine, 0, 0, Displacement );

//Working out the Possible Price Range...(This is Dynamic)

//1) For the Caculated Today Possible High with Respect to Today Low...

//2) For the Caculated Today Possible Low with Respect to Today Low...

DynHigh1 = L + Ref(Diff_HL_MA1,-1);

DynLow1 = H - Ref(Diff_HL_MA1,-1);

DynHigh2 = L + Ref(Diff_HL_MA2,-1);

DynLow2 = H - Ref(Diff_HL_MA2,-1);

DynHigh3 = L + Ref(Diff_HL_MA3,-1);

DynLow3 = H - Ref(Diff_HL_MA3,-1);

printf("Today Dynamic High (7 Day MA) is: %g\n",DynHigh1);

printf("Today Dynamic Low (7 Day MA) is: %g\n",DynLow1);

printf("\n");

printf("Today Dynamic High (22 Day MA) is: %g\n",DynHigh2);

printf("Today Dynamic Low (22 Day MA) is: %g\n",DynLow2);

printf("\n");

printf("Today Dynamic High (50 Day MA) is: %g\n",DynHigh3);

printf("Today Dynamic Low (50 Day MA) is: %g\n",DynLow3);

printf("\n\n");

_SECTION_END();

 

request

Help needed to code EA

--------------------------------------------------------------------------------

Hi

I need someone to code an EA based on the following indicator. Buy order to be placed when bar crosses from below zero to above zero on close of first bar. Sell the opposite. EA to include Takeprofit and Stoploss. Thats about it

Many thanks

Attached Files FX_FISH_2MA.mq4 (5.0 KB, 7 views)

Files:
 

Help with EA!

I've got this EA i'm using but needs additional tweaking. Is there anybody that can add an option to shut down the EA after a take profit. Also, i've noticed that it doesn't open a position if it gets a "requote". How can I rectify this problem? For example: EA opens a buy@.10 stops out then opens a Sell@.20 stops out and doesn't open a buy@.4 because of "requote".

Thnx

Files: