NexusFi: Find Your Edge


Home Menu

 





Indicators for Multicharts.NET SE


Discussion in MultiCharts

Updated
      Top Posters
    1. looks_one jojojo with 9 posts (0 thanks)
    2. looks_two Jura with 6 posts (5 thanks)
    3. looks_3 ABCTG with 3 posts (3 thanks)
    4. looks_4 panz with 3 posts (0 thanks)
      Best Posters
    1. looks_one Jigsaw Trading with 3 thanks per post
    2. looks_two mattz with 2 thanks per post
    3. looks_3 ABCTG with 1 thanks per post
    4. looks_4 Jura with 0.8 thanks per post
    1. trending_up 10,589 views
    2. thumb_up 17 thanks given
    3. group 7 followers
    1. forum 25 posts
    2. attach_file 4 attachments




 
Search this Thread

Indicators for Multicharts.NET SE

  #11 (permalink)
 jojojo 
FrankfurtGermany
 
Experience: Beginner
Platform: Tradestation
Posts: 40 since Oct 2010
Thanks Given: 4
Thanks Received: 7

Thanks for clarification.Maybe we can start with this one.

@Jura
just curious - did you adapt your cum.delta approach for MC.Net ?

regs

Attached Files
Elite Membership required to download: ADXVMA.txt
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Build trailing stop for micro index(s)
Psychology and Money Management
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Better Renko Gaps
The Elite Circle
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
36 thanks
NexusFi site changelog and issues/problem reporting
25 thanks
GFIs1 1 DAX trade per day journal
19 thanks
The Program
18 thanks
  #12 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 690


jojojo View Post
Jura
just curious - did you adapt your cum.delta approach for MC.Net ?

I think you're confusing me with someone else -- I don't have a Cumulative Delta trading approach.

Reply With Quote
  #13 (permalink)
 panz 
Naperville IL
 
Experience: Intermediate
Platform: MC.NET,Zorro,SC,TT,TWS
Broker: IB, OANDA, IQFeed
Trading: Futures, FOREX, Options, Stocks & ETFs
Posts: 10 since Apr 2015
Thanks Given: 2
Thanks Received: 5



jojojo View Post
Thanks for clarification.Maybe we can start with this one.

regs

Here you go. As you can see the translation is straightforward. C# is a bit verbose as it's a general purpose language so you have to follow its object oriented framework; but you will gain a lot in the future by using C#.

I tried to translate your EL code line by line without any change. So when I saw "High[1] - High[1]" was used in two places I also translated them without change but added comment wondering why you did this instead of just writing down 0 - could it be a typo, or you modified the script from something else into this?

EL result:


NET result:


The 2 screen shots show that my NET result matches your EL result. (I don't own MultiCharts standard version so I had to get a demo running on a Windows virtual machine to get EL result since demo on my physical machine has long expired ).

There might be minor differences around open and close because the data source is Interactive Brokers for EL and IQFeed for NET (cannot get 2 identical logins running simultaneously for either single data source).

Attached Files
Elite Membership required to download: jojo_ADXVMA.Indicator.CS
Reply With Quote
  #14 (permalink)
 jojojo 
FrankfurtGermany
 
Experience: Beginner
Platform: Tradestation
Posts: 40 since Oct 2010
Thanks Given: 4
Thanks Received: 7

@ Jura : This here

@panz: Great thank you very much ; ofcourse you are right must be a typo , never mentioned it
I think it should be High-High[1] analog to the rest.

But anyway great to have the possibility to compare both - thanks again

Reply With Quote
  #15 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 690


jojojo View Post
Jura
just curious - did you adapt your cum.delta approach for MC.Net ?


jojojo View Post
@ Jura : This here

Ah I see. That was me coding something and helping others, not me suggesting a trading approach. I think you're better off following the latest version posted by SPMC here:

I haven't converted that code to MC .NET.

Reply With Quote
  #16 (permalink)
 jojojo 
FrankfurtGermany
 
Experience: Beginner
Platform: Tradestation
Posts: 40 since Oct 2010
Thanks Given: 4
Thanks Received: 7

I came up with another newbie question.I want to store some trendlinearray in an indicator ,which will be added manually time by time to use on different charts.But stuck ofcourse Here is what I got so far:
Don't know if the boolean is necessary at all , found it as an suggestion on tradingcode.net articles.
What am I doing wrong?

using System;
using System.Drawing;
using System.Linq;
using PowerLanguage.Function;

namespace PowerLanguage.Indicator
{
[UpdateOnEveryTick(false), SameAsSymbol(true),RecoverDrawings(false)]

public class Magnet_TrendLineCollection : IndicatorObject
{
public Magnet_TrendLineCollection(object _ctx) : base(_ctx)

int[]numbers = new int [3]{10000,10050,10100};

//private bool linesAlreadyCreated;

protected override void StartCalc()
{
//linesAlreadyCreated = false;
}
protected override void CalcBar()
{
//if (Bars.LastBarOnChart && !linesAlreadyCreated)

{
for (int i = 0; i < 3; i++)
// Create the line's coordinates
ChartPoint beginPoint1 = new ChartPoint(Bars.FullSymbolData.Time[0],numbers(i));
ChartPoint endPoint1 = new ChartPoint(Bars.FullSymbolData.Time[0],numbers(i));
{
ITrendLineContainer MagnetLines = (DrwTrendLine.Create(beginPoint1, endPoint1));
MagnetLines.ExtLeft = true;
MagnetLines.ExtRight = true;
}
}
//linesAlreadyCreated = true;
}
}
}

Reply With Quote
  #17 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 690


jojojo View Post
I came up with another newbie question.I want to store some trendlinearray in an indicator ,which will be added manually time by time to use on different charts.But stuck ofcourse Here is what I got so far:
What am I doing wrong?

It's hard for me to tell what you're doing wrong here, since I don't get what you're trying to do. Perhaps an array with fixed values of 10000, 10050, and 10100 is a good idea, but it might also be a wrong approach to this problem.

I do know that you won't achieve your goal of 'added manually time by time to use on different charts'. That's because your `numbers` array is hardcoded, which doesn't make it manual and makes it the same on different charts.


jojojo View Post
Don't know if the boolean is necessary at all , found it as an suggestion on tradingcode.net articles.

That Boolean prevents the trend lines from being created with every script update. Currently, your script creates a trend line each each time `CalcBar()` executes. Even if you really wanted a new trend line drawn on every bar, this might give you troubles because there's a limit or 7,500 objects (see here), and that includes trend lines.

By the way, please read your code carefully because your for loop does the following:

 
Code
for (int i = 0; i < 3; i++)
    ChartPoint beginPoint1 = new ChartPoint(Bars.FullSymbolData.Time[0],numbers(i));
That's probably not your intention with the code, I think.

Reply With Quote
Thanked by:
  #18 (permalink)
 jojojo 
FrankfurtGermany
 
Experience: Beginner
Platform: Tradestation
Posts: 40 since Oct 2010
Thanks Given: 4
Thanks Received: 7

sorry for my bad explanation .I want to collect horizontal trendlines ,which's price I can add manually.
This I tried with the array.Just keeping the prizes in this case and can be added with int[]numbers = new int [3]{10000,10050,10100};
Maybe there is a better solution , a list or sth similar.
ok then the boolean makes the code just print once - that's ok because it has not to be recalculated.

Reply With Quote
  #19 (permalink)
 jojojo 
FrankfurtGermany
 
Experience: Beginner
Platform: Tradestation
Posts: 40 since Oct 2010
Thanks Given: 4
Thanks Received: 7

it's trial and error - I tried to manage it with List<> compiles but no plot

using System;
using System.Drawing;
using System.Linq;
using PowerLanguage.Function;
using System.Collections.Generic;

namespace PowerLanguage.Indicator
{
[UpdateOnEveryTick(false), SameAsSymbol(true),RecoverDrawings(false)]

public class Magnet_TrendLineCollection : IndicatorObject
{
public Magnet_TrendLineCollection(object _ctx) : base(_ctx){}

//int[]numbers = new int [3]{10000,10050,10100};

public List<decimal> Prices = new List<decimal>();
private double firstPrice;
private double secondPrice;
private double thirdPrice;

private bool linesAlreadyCreated;

protected override void StartCalc()
{
Prices.Add(10750);
Prices.Add(10700);
Prices.Add(10650);
decimal firstPrice = Prices[0];
decimal secondPrice = Prices[1];
decimal thirdPrice = Prices[2];

//linesAlreadyCreated = false;
}
protected override void CalcBar()
{
//if (Bars.LastBarOnChart && !linesAlreadyCreated)

{
//for (int i = 0; i < 3; i++)
// Create the line's coordinates
ChartPoint beginPoint1 = new ChartPoint(Bars.FullSymbolData.Time[0],firstPrice);
ChartPoint endPoint1 = new ChartPoint(Bars.FullSymbolData.Time[0],firstPrice);
//ChartPoint beginPoint2 = new ChartPoint(Bars.FullSymbolData.Time[0],secondPrice);
//ChartPoint endPoint2 = new ChartPoint(Bars.FullSymbolData.Time[0],secondPrice);
//ChartPoint beginPoint3 = new ChartPoint(Bars.FullSymbolData.Time[0],thirdPrice);
//ChartPoint endPoint3 = new ChartPoint(Bars.FullSymbolData.Time[0],thirdPrice);
{
ITrendLineObject MagnetLines = (DrwTrendLine.Create(beginPoint1, endPoint1));
//ITrendLineObject MagnetLines = (DrwTrendLine.Create(beginPoint2, endPoint2));
//ITrendLineObject MagnetLines = (DrwTrendLine.Create(beginPoint3, endPoint3));
MagnetLines.ExtLeft = true;
MagnetLines.ExtRight = true;
}
}
//linesAlreadyCreated = true;
}
}
}

Reply With Quote
  #20 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 690


If I may observe something, then you're overcomplicating things with a `List<T>`. In your last script, you use a generic list and then store the list values into decimal variables. In that case you don't need a list at all, especially since there always seem to be at most 3 horizontal lines that you want to draw (if I understand correctly). It might simplify things a bit if you just use the three variables.

With other things you're oversimplifying, for instance:


jojojo View Post
ok then the boolean makes the code just print once - that's ok because it has not to be recalculated.

This doesn't work that way; `CalcBar()` is executed on every bar, starting from the very first bar to the very last. Then, when there is real-time data, it's called on every tick (for strategies with intra-bar order generation and indicators set to 'update on every tick') or once per bar (for strategies without intra-bar generation and indicators with 'update on every tick' disabled).

This means it's not optional whether or not `CalcBar()` executes; it always does. Every script always calculates at least once per bar. It may not perform an action every time when `CalcBar()` executes, or your `CalcBar()` method may be empty with no code at all, but that doesn't mean that `CalcBar()` isn't called on every bar.

Edit. I noticed that your comment can also be read as 'it's good that the Boolean only executes the code once; that's what I need'. In that case my above explanation is not needed. But in that case I'm wondering why you say such a thing and not add it to the code?

Perhaps it's an idea to invest significantly more time in your replies, because it feels to me that I spend more time replying to you than you spend clarifying and proof-reading your requests for help. That's not how this is supposed to work in my view (assuming you want free help and a discussion that doesn't drag on for ages). Using the [ code ] .. [ / code ] tag would be nice too.

- - - - - - - -

By the way:


Jura View Post
I do know that you won't achieve your goal of 'added manually time by time to use on different charts'. That's because your `numbers` array is hardcoded, which doesn't make it manual and makes it the same on different charts.

In your last script, you still have the values hardcoded. If you want to use your script on different charts, you'll probably want to use inputs so that you can configure the indicator for each chart. And not plot lines at 10,000 for EUR/USD, for instance, as the current script does.

Reply With Quote
Thanked by:




Last Updated on November 21, 2015


© 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