NexusFi: Find Your Edge


Home Menu

 





Using Indicator inside Signal/Strategy


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one ivanyu with 3 posts (1 thanks)
    2. looks_two ABCTG with 3 posts (1 thanks)
    3. looks_3 greene828 with 2 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
      Best Posters
    1. looks_one sptrader with 2 thanks per post
    2. looks_two SPMC with 1 thanks per post
    3. looks_3 ivanyu with 0.3 thanks per post
    4. looks_4 ABCTG with 0.3 thanks per post
    1. trending_up 9,600 views
    2. thumb_up 5 thanks given
    3. group 3 followers
    1. forum 10 posts
    2. attach_file 0 attachments




 
Search this Thread

Using Indicator inside Signal/Strategy

  #1 (permalink)
ivanyu
Hong Kong
 
Posts: 15 since Jul 2013
Thanks Given: 0
Thanks Received: 1

Hi,

I am learning both NinjaTrader C# and MultiCharts EasyLanguage.

NinjaTrader allows me to code a strategy by simply referencing an indicator inside the strategy, i.e. the plot values of the indicator can be used inside the strategy as variables, and if I want the strategy to also plot the indicator without explicitly adding the indicator itself, I just add the indicator within the strategy code. This will prevent the potential mistake of supplying different params to the indicator and the strategy, were they added to chart separately.

In MultiCharts EasyLanguage, it seems that I cannot do something similar?

What I have learnt so far, is, write a function that generates the values, then write an indicator to plot the values, then write a signal that uses the values of the function.

However, if there is an existing indicator that plots, can I use the plot values in a MultiCharts strategy like in Ninja?

Thanks a lot for the help.

Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
REcommedations for programming help
Sierra Chart
Better Renko Gaps
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
How to apply profiles
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
34 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
18 thanks
GFIs1 1 DAX trade per day journal
16 thanks
Vinny E-Mini & Algobox Review TRADE ROOM
13 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627


Hi ivanyu,

you can't plot from within a strategy directly, that is a shortcoming of Easylanguage. There are two possible workarounds that come to my mind:
  1. Use trendlines to mimic the plots within the strategy code
  2. Use and indicator that accesses the running strategy and plot the values. This can be done via EasyLanguage Collections.

Regards,
ABCTG

Follow me on Twitter Reply With Quote
Thanked by:
  #4 (permalink)
ivanyu
Hong Kong
 
Posts: 15 since Jul 2013
Thanks Given: 0
Thanks Received: 1

Thank you very much for the reply.

I am just worried that there is always the danger of mistakenly supplying different params to the function, from within the indicator and from within the strategy, since they need to be added separately.

Reply With Quote
  #5 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

With either of the two approaches you won't have these problem. If the trendlines are being plotted from the strategy there is no indicator with different settings.
In the latter approach the indicator would read the values from the strategy and doesn't have any inputs at all.
By the way it just came to my mind instead of feeding the indicator the strategy values via EL Collections, simply feed the inputs only.
This will make sure the results are similar (make sure the maximum number of bars the studies reference are the same!) as the inputs are alike.

Regards,
ABCTG

Follow me on Twitter Reply With Quote
  #6 (permalink)
 SPMC 
GER
 
Experience: Advanced
Platform: MC
Trading: ES
Posts: 144 since May 2011
Thanks Given: 11
Thanks Received: 213

Plotting Directly From Within Strategies

Plotting Directly From Within Strategies with Tradestation - TLPlot

Reply With Quote
Thanked by:
  #7 (permalink)
ivanyu
Hong Kong
 
Posts: 15 since Jul 2013
Thanks Given: 0
Thanks Received: 1

Thank you very much for this suggestion!

Reply With Quote
  #8 (permalink)
 
sptrader's Avatar
 sptrader 
Colorado
 
Experience: Advanced
Platform: MultiCharts
Broker: IB & Iqfeed
Trading: ES , CL
Posts: 535 since Apr 2010
Thanks Given: 1,097
Thanks Received: 701

Multicharts is going to add the "indicator within a strategy" feature in an upcoming version..(ver 9 0 I think)..

Reply With Quote
Thanked by:
  #9 (permalink)
 greene828 
West Palm Beach, FL
 
Experience: Intermediate
Platform: Ninjatrader 8
Trading: YM, RTY, NQ, GC, CL
Posts: 5 since Aug 2019
Thanks Given: 2
Thanks Received: 2

Hello, my question is similar. I am not concerned about plotting an indicator in the strategy because I can just apply the indicator in the chart with the same inputs that I'm using in the strategy in EL. However, I don't know how to use an indicator in a strategy when the code for the indicator is not available. I would like to use the NPCPX_SignalLine indicator, however the code is not available. Is it possible to use the indicator in the strategy without adding the code? In Ninjatrader this is possible and I'm hoping it can be done in EL also.

Reply With Quote
  #10 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627


greene828,

which platform are you using? In Multicharts you could for example add the indicator to a strategy using an input and access the plots.
https://www.multicharts.com/trading-software/index.php?title=Study_on_study

In Tradestatation this would unfortunately not be possible. Maybe the indicator developer can provide you with a function that exposes the indicator values. This could be closed code,
but you would be able to call it from a strategy.

Regards,

ABCTG


greene828 View Post
Hello, my question is similar. I am not concerned about plotting an indicator in the strategy because I can just apply the indicator in the chart with the same inputs that I'm using in the strategy in EL. However, I don't know how to use an indicator in a strategy when the code for the indicator is not available. I would like to use the NPCPX_SignalLine indicator, however the code is not available. Is it possible to use the indicator in the strategy without adding the code? In Ninjatrader this is possible and I'm hoping it can be done in EL also.


Follow me on Twitter Reply With Quote




Last Updated on November 11, 2021


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts