script idea - futures io
futures io futures trading



script idea


Discussion in NinjaTrader

Updated by jsengxx
      Top Posters
    1. looks_one sharky with 22 posts (7 thanks)
    2. looks_two systrader with 11 posts (31 thanks)
    3. looks_3 Peter with 6 posts (10 thanks)
    4. looks_4 zeller4 with 4 posts (1 thanks)
      Best Posters
    1. looks_one systrader with 2.8 thanks per post
    2. looks_two sam028 with 2.0 thanks per post
    3. looks_3 Peter with 1.7 thanks per post
    4. looks_4 sharky with 0.3 thanks per post
    1. trending_up 12,535 views
    2. thumb_up 58 thanks given
    3. group 11 followers
    1. forum 64 replies
    2. attach_file 14 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Thread Tools Search this Thread
 

script idea

  #31 (permalink)
Site Administrator
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 48,771 since Jun 2009
Thanks: 31,481 given, 94,149 received

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 );

with:
double val1 = Math.Round( val1Pure, 6 );
double val2 = Math.Round( val2Pure, 6 );

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.

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my Facebook Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to Big Mike for this post:

Can you help answer these questions
from other members on futures io?
Convert NinjaTrader NT7 indicator to Tradestation EasyLanguage and RADARSCREEN
Platforms and Indicators
Issue meeting order entry conditions
Elite Automated NinjaTrader Trading
Last 5 minutes Label
ThinkOrSwim
Moving average with Lag reduction
NinjaTrader
Linux?
ThinkOrSwim
 
 
  #32 (permalink)
Brisbane; Australia
 
Experience: Intermediate
Platform: NT
Broker: IB/TDA needing new broker
Trading: Futures, Forex, Stocks
 
Peter's Avatar
 
Posts: 97 since Jun 2009
Thanks: 91 given, 113 received

The versions are in fast development. Here are the latest....

The ZIP contains 2 variants of the same strategy
- SharkyMAStrategy_v1_05
- SharkyMAStrategy_v1_05_DMV_version

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
[0] > ZeroLagEMA(ZeroLagEMA,13)13 [1] 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 [0] > ZeroLagEMA(ZeroLagEMA,12)12 [1]
- 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


Attached Files
Register to download File Type: zip SharkyMAStrategy_v1_05c__2versions.zip (48.3 KB, 89 views)

Last edited by Peter; June 29th, 2009 at 09:19 PM. Reason: Put correct DMV version in
Reply With Quote
The following 4 users say Thank You to Peter for this post:
 
  #33 (permalink)
Rocky Mountains
 
 
Posts: 19 since Jun 2009
Thanks: 17 given, 36 received


Back from a long weekend. Looks like a lot has changed in the script(s)! I'll try to catch up and figure out what all has changed. Let me know if I can help with anything.

Reply With Quote
 
  #34 (permalink)
Toronto Canada
 
Experience: Intermediate
Platform: ninja Trader, Ensign,Market Delta
Broker: AMP,Global Futures
Trading: Eminis
 
Posts: 97 since Jun 2009
Thanks: 46 given, 83 received

Thanks for posting this idea . I have one idea about profit management. If you make it to configure profit management through ATM strategy, then it will be better.

Reply With Quote
The following user says Thank You to KJAVED for this post:
 
  #35 (permalink)
Florida
 
Experience: Intermediate
Platform: NT7
Trading: CL, NQ, NG
 
Posts: 469 since Jun 2009
Thanks: 1,401 given, 402 received

systrader,

I'm curious if your strategies are normally using ATM strategy or IORDER?

I've not conquered either one yet but have samples of each and am still learning the nuances.

Also, are you normally using Add(name of indicator) in Initialize? or do you just add the indicator separately?

Kirk

Reply With Quote
 
  #36 (permalink)
Toronto Canada
 
Experience: Intermediate
Platform: ninja Trader, Ensign,Market Delta
Broker: AMP,Global Futures
Trading: Eminis
 
Posts: 97 since Jun 2009
Thanks: 46 given, 83 received

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.

Reply With Quote
 
  #37 (permalink)
Rocky Mountains
 
 
Posts: 19 since Jun 2009
Thanks: 17 given, 36 received

Kirk,

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.

Reply With Quote
The following user says Thank You to systrader for this post:
 
  #38 (permalink)
MIAMI,FL
 
Experience: Advanced
Platform: NinjaTrader
Broker: Private
Trading: Zn,6E,6J
 
sharky's Avatar
 
Posts: 1,060 since Jun 2009
Thanks: 624 given, 3,900 received

Sam,peter,sy trader or anyone else

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)

Visit my futures io Trade Journal Reply With Quote
 
  #39 (permalink)
Florida
 
Experience: Intermediate
Platform: NT7
Trading: CL, NQ, NG
 
Posts: 469 since Jun 2009
Thanks: 1,401 given, 402 received

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.

hth

kirk

Reply With Quote
 
  #40 (permalink)
MIAMI,FL
 
Experience: Advanced
Platform: NinjaTrader
Broker: Private
Trading: Zn,6E,6J
 
sharky's Avatar
 
Posts: 1,060 since Jun 2009
Thanks: 624 given, 3,900 received


any one with ideas feel free to make suggestions all ideas will be looked at and if possible we will try anything to make this a really good script...sharky

Visit my futures io Trade Journal Reply With Quote



futures io Trading Community Platforms and Indicators NinjaTrader > script idea




Upcoming Webinars and Events
 

Free BloodHound Licenses to everyone!

June
 

Every journal equals ten meals for the hungry

June
     



Copyright © 2020 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts