The yellow line issue, discussed at length in chat, is due to the precision being used in DoubleMA Paint. What is painted on screen vs. what is passed in the DataSeries is different due to this math rounding (precision).
Approximately line 147 the rounding begins. I'm not the original author and do not know why the rounding is necessary.
If you replace:
double val1 = Math.Round( val1Pure, decimals );
double val2 = Math.Round( val2Pure, decimals );
Then the issue with the yellow color should be fixed on the ZN instrument.
If someone wants to get more at the heart of this for a real solution, the logic to determine the number of decimals begins on line 83 of DMAPaint.cs.
Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.
Need help? 1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first. 2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses. 3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make. 4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance. 5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers. 6) Help using the forum? Watch this video to learn general tips on using the site.
If you want to support our community, become an Elite Member.
The following user says Thank You to Big Mike for this post:
The versions are in fast development. Here are the latest....
The ZIP contains 2 variants of the same strategy
The first version uses the Signal dataseries to trigger entries and exits
The second (even more experimental) DMV version uses the DMV dataseries in DMAPaint to trigger entries/exits.
The ZIP includes:
- an updated DMAPaint and updated DMA with:
1. Mike's fix as per previous post
2. updated DMAPaint to default PaintBar=false (so it does not repaint the bars by default
when putting the the DMAPaint or DMAPaint containing strategy on a chart)
3. DMA changed to PriceSupported = true
- my updated Internal (adds TEMA, ZeroLagTEMA and ZeroLagHATEMA as choice) .
For details see earlier posts
The strategies are work in progress ... do not use for real trading
Just (8.00 AM) uploaded again a new version. Found logical error in the DMV version that prevented it going short.
(8.32 AM) It looks like there is still a bug in the logic of the DMV version as it re-enters while the code should prevent this.
But still useful to see if using the DMV dataseries gives different entries than using the Signal dataseries
As Max suggested and we discussed in the chat it might be better to hardcode the logic directly without using the DMAPaint
with e.g. statements like .......if ZerolagEMA(ZeroLagEMA,13),13  > ZeroLagEMA(ZeroLagEMA,13)13  etc.
We agree that this is probably the best way forward. But that's for another day .... or one of the others to pick up.
8.15 PM I checked what the 2 versions did last night. The version based on the DMA Signal dataseries and the version based on the DMA DMV dataseries definitively triggered differently.
I think somebody else better first checks the trigger logic. You tend to miss flaws in your own coding.
As mentioned yesterday it is probably better as next step to first hard code the logic in the strategy with statements like
- ZerolagEMA(ZeroLagEMA,12),12  > ZeroLagEMA(ZeroLagEMA,12)12 
- or ZerolagEMA(ZeroLagEMA,12),12 rising etc.
That way we would no longer be dependent on the inside logic of the DMSPaint indicator.
With 'hardcoding' I mean here 'not using the DMA'. I would still make the period of the ZeroLagEMA a changeable parameter.
That would give then 3 versions to compare and evaluate the efficacy / correctness of the triggers.
It is fun the develop on the fly, but IMO we need to get a little structured in the approach.
Don't know if it is wise to already put in break-even and ATM type stuff and complicate the strategy before solving the first part.
Will have little time rest of the week ... so if somebody wants to pick up ... pls do
Last edited by Peter; June 29th, 2009 at 09:19 PM.
Reason: Put correct DMV version in
The following 4 users say Thank You to Peter for this post:
I am not Programmer. But have some knowledge. I hire some ninja script consultants before my strategies. They configure it for me. Your all strategy ok, working good, except profit management. For profitmanagement, you can make as manay ATM strategies as you want and just put there name at start of strategy from strategy wizard. Then it automatically picks that specific ATM strategy.
When this happen, then there is no need to give profit/loss/trail tragets inside strategy. You can run as many strategies as you want on different charts of same market as you want, from same wizard, just changing there names.
Up to this point I've only used the built in order handling functions. I have yet to do advanced order handling via IOrder. I have played with ATM strategies a little but nothing earth shattering I'm still in the process of learning the ins/outs of NT (and this forum is a HUGE help).
What KJAVED spoke about sounds interesting as well (eg. pre-configured ATM strategies that a strategy uses). But being a programmer, I will probably end up "coding" my order/profit/stop logic vs. using a pre-configured ATM - but it's nice that NT gives you the ability to do both.
The following user says Thank You to systrader for this post:
I am interested in testing this strategy Monday for quick scalps, and I would like to revise it to include the following:
I do not want to employ a TrailStop, so set TrailStop default = 0 (not = 1 as it currently is).
I do want an Auto Breakeven feature that once open profit = 2 ticks (set as variable), I want to automatically move my Stop Loss to Entry. This protects my position if my Profit Target is hit but I am not filled, and price then moves against me.
This feature in the ATM Stop Strategy would read as follows:
Auto breakeven (ticks)
Profit trigger: 2 (set as variable) Plus: 0 (set as variable)
I've had good success with an ATM strategy that both sets targets and sets stops (even different levels if desired) and then moves the level to breakeven or breakeven + 1tick (to pay for commissions if needed).
SampleAtmStrategy is a built-in script that you could start with if that's the way you're going.