Requests & Ideas - page 35

 

Spread value

I really would appreciate the code snippet to compute the lot sizes determined by a given investment (margin, if you will) of a pair of pairs (or other instruments) at their current prices (although I'm primarily interested in XAU and XAG). For example, how many lots would be bought if if you wanted to allocate USD100,000 to XAUUSD? to XAGUSD? to GBPJPY? to EURCHF?

This general code snippet would ideally consider the variations among brokers for instrument naming, leverage, AccountType (standard, mini, micro), contract specifications and so forth that impact the calculations. I only need the results for accounts funded in USD, but others might need an even more general solution for account denominated in other currencies.

The method I'm using right now works for currency pairs but fails with spot price instruments and CFDs.

I cannot figure out how to use the properties (MarketInfo() and so forth) exposed in the MT4 environment to do this accurately and repeatedly in different brokers (because they set up their CFDs differently).

Once you know the Lots allocation, you would be able to enter and track a spread trade.

Thanks a bunch!

As an example, from Broco...

XAU Contract specifications

Spread 75

Digits 2

Stops level 1

Pendings are good till cancel Yes

Contract size 100

Tick value 0.00

Tick size 0.01

Profit calculation mode CFD

Swap type in percentage terms

Swap long -0.68

Swap short -2.05

Margin calculation mode CFD-leverage

Margin hedge 0

XAG Contract specifications

Spread 56

Digits 3

Stops level 1

Pendings are good till cancel Yes

Contract size 5000

Tick value 0.000

Tick size 0.001

Profit calculation mode CFD

Swap type in percentage terms

Swap long -0.68

Swap short -2.05

Margin calculation mode CFD-leverage

Margin hedge 0

 

Simba

This one is calculated the "trin way". I used the "look-a-like" in the name for a couple of reasons :
- the main reason is metatrader 4 complete lack of volume information even if the symbol would have it (metatrader 4 always has ticks, and as I said, they are hardly reliable since I witnessed their backward change)

- it will be very difficult (even with just ticks) to find a broker that will provide all the stocks that are originally calculated in trin index

- since, by default I used only forex symbols, it is obvious why I call it a "look-a-like"
Usage is fairly simple : in the Symbolsparameter enter the symbols you would like to use in calculation separated by ";" (there is no limit in the number of symbols you would like to use, but the greater the number of symbols, the more resources it will use). In the UseVolumechoose if you want to use ticks (volumes) in calculation or not.

________________________

Of internals : I did not find anywhere a precise definition what doe "advance issues" and "decline issues" mean so I assumed that it is the relative position of current close to previous close. Also, from pure technical view, indicator "aligns" bars according to their time not their numbers (positions). I think that it is the only correct way to do so since that is the only possible way to calculate it correctly for a given time (using bar numbers would cause some cumulative errors that would render it useless) Also, smoothing is added. On a small number of symbols trin is a "nervous" indicator and mild smoothing help in readability. To turn the smoothing off, set the SmoothLength to 1 or less than 1.

PS: it is a mtf already
Files:
trin.gif  23 kb
trin_1.gif  21 kb
 
mladen:
Simba This one is calculated the "trin way". I used the "look-a-like" in the name for a couple of reasons :
- the main reason is metatrader 4 complete lack of volume information even if the symbol would have it (metatrader 4 always has ticks, and as I said, they are hardly reliable since I witnessed their backward change)

- it will be very difficult (even with just ticks) to find a broker that will provide all the stocks that are originally calculated in trin index

- since, by default I used only forex symbols, it is obvious why I call it a "look-a-like"

Usage is fairly simple : in the Symbolsparameter enter the symbols you would like to use in calculation separated by ";" (there is no limit in the number of symbols you would like to use, but the greater the number of symbols, the more resources it will use). In the UseVolumechoose if you want to use ticks (volumes) in calculation or not.

________________________

Of internals : I did not find anywhere a precise definition what doe "advance issues" and "decline issues" mean so I assumed that it is the relative position of current close to previous close. Also, from pure technical view, indicator "aligns" bars according to their time not their numbers (positions). I think that it is the only correct way to do so since that is the only possible way to calculate it correctly for a given time (using bar numbers would cause some cumulative errors that would render it useless) Also, smoothing is added. On a small number of symbols trin is a "nervous" indicator and mild smoothing help in readability. To turn the smoothing off, set the SmoothLength to 1 or less than 1.

PS: it is a mtf already

Thanks Mladen,

It works fantastic for D1.

S

 

alertsonCurrent

mladen:
msquared

here is an Elliot oscillator - waves with alerts (it will alert at a moment when the oscillator value first crosses either of ema values - that is the moment when a colored bar appears for the first time)

regards

Mladen

Mladen

Can you explain the parameter "alertsonCurrent" ?

I would like the alert to trigger on the "first appearance" of the colored bar - should this value be set to false?

Thanks

 

No

In your case it should be set to true. If set to true them alert can (and will be) triggered on a current (still opened) bar (so at a first occurrence of a condition without waiting for a bar to get closed). If you set it to false it will be triggered only when the bar gets closed.

regards

Mladen

averageiq:
Mladen

Can you explain the parameter "alertsonCurrent" ?

I would like the alert to trigger on the "first appearance" of the colored bar - should this value be set to false?

Thanks
 

Micro Account with Expert Advisor

Hi guys,

I need guidance.

I have a real account at the brokerage LiteForex.

I deposited $ 232,00.

I need to know which expert advisor I use in this account without losing my capital.

I saw the EA's: PolyFitScalper EA, Dynamic EA, Wu Wei and Jurik TrendStrength EA.

But I don't know which the best for me and I don't know what settings to use.

Can you help me?

Regards,

Marlon Henrique

 

Hi marlonhenrique,

Is it account in cents with LiteForex?

If yes so it should be 23,200 on Metatrader balance.

Personally I like Mandarine EA new versions. But you can also look at some other EA inside elite section and on this thread too.

As to Polyfit so some versions are good but you should use 1 or 2 pairs only (read Polyfit thread here on advanced elite).

 

What is the best version of Polyfit for me?

The account has $ 232,00.

Brokerage LiteForex.

The idea is not to lose capital that micro account.

I think the Mandarine risky for this account.

 

By the way - I do not like to recommend anything and never did it: trader can lose 200 dollars using my recommendation and will remember me whole his life sorry I am talking about what I may use having this account similar with your account.

If your account is in dollars so I am sorry - deposit is too small even if you will use lot size = 0.01. If your account is in cents so you can use one of the version of Polyfit for 1 or 2 pairs only - look at this post. By the way - Polyfit is martingale + scalper so it is risky too.

For LiteForex account in dollars with lot size = 0.01 as a minimum - I am recommending to you to trade semi-manual BrainTrading or Brainwashing - see this section (automatic trading M15 timeframe - but not all 4 pairs; select 1 or 2).

What I can do in this case (in case I will want to trade something with real money)? I will open account with LIteForex (for example) in cents, will deposit 200 dollars to have 20,000 in Metatrader and will use some ... mandarine for 1 or 2 pairs, or Scalp_net_v1.5 ... or TickScalper for 1 pair.

What you can do and select - no idea.

I can only recommend what I like and what I do not like if I have this account (in cents only).

As I remember - I am having accounts with LiteForex in cents where I am playing with some EAs just to test them with real money and to have some feeling as trading live (before going to real live). But it is nothing with real profit as 100 or 200 deposit is too small one in anyway.

 

EA Version of CCI_NRP_MTF

Hi Mladen, I tried to make an EA based on your CCI_NRP_MTF indicator. But once the EA this indicator loads into memory, it is immediately removed. And at the same loaded seconds. This cycle repeats itself endlessly, and my PC goes to his knees. Is it possible to convert this indicator to use it with EA? Thanks in advance.

Files:
Reason: