Coding problem, Multicharts.net, Using function entry point values as exit point - Traders Hideout | futures io social day trading
futures io futures trading


Coding problem, Multicharts.net, Using function entry point values as exit point
Updated: Views / Replies:2,725 / 10
Created: by shamanov Attachments:0

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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

Reply
 
Thread Tools Search this Thread
 

Coding problem, Multicharts.net, Using function entry point values as exit point

  #1 (permalink)
Toronto Canada
 
 
Posts: 9 since Jan 2018
Thanks: 5 given, 1 received

Coding problem, Multicharts.net, Using function entry point values as exit point

I'm looking to use the the value of the function upon entry as the point of exit for the signal, but the correct value is not being used upon exit. Wondering if anyone has any ideas. The code below is the closest I could come to correctly implementing the signal.
________________________________________________________________________________________________
______________________________________________________________________________________________
using System;
using System.Drawing;
using System.Linq;
using PowerLanguage.Function;
using ATCenterProxy.interop;

namespace PowerLanguage.Strategy {
[IOGMode(IOGMode.Disabled)]

public class working_signal : SignalObject {

private IOrderMarket buy_exit;
private IOrderMarket sell_exit;
private function_profit_target value;
private int counter;



public working_signal(object _ctx):base(_ctx)
{

counter = 0;








}
protected override void Create() {
// create variable objects, function objects, order objects etc.
buy_exit = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.Default, EOrderAction.Sell));
sell_exit = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.Default, EOrderAction.BuyToCover));
value = new function_profit_target(this);
}
protected override void StartCalc() {
// assign inputs




}
protected override void CalcBar()
{

if (CurrentPosition.Side == EMarketPositionSide.Long)
{
counter = counter + 1;
if ((Bars.Close[0] - this.EntryPrice(0)) >= (value[counter - 1]))
{
buy_exit.Send();
counter = 0;
}
}
else if (CurrentPosition.Side == EMarketPositionSide.Short)
{
counter = counter + 1;
if ((Bars.Close[0] - this.EntryPrice(0)) <= ((-1) * value[counter - 1])
{
sell_exit.Send();
counter = 0;
}
}

}
}
}
_______________________________________________________________________________________________
_______________________________________________________________________________________________

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Trading Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 2,073 since Apr 2013
Thanks: 371 given, 1,323 received


shamanov,

it's hard to tell without knowing the code for function_profit_target, but when you debug your code value show the expected value on the current bar?

Regards,

ABCTG

Follow me on Twitter Visit my Facebook Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #4 (permalink)
Toronto Canada
 
 
Posts: 9 since Jan 2018
Thanks: 5 given, 1 received

ABCTG,

function_profit_target shows the expected value on the current bar within an indicator, is there any way to find value[counter - 1] within the signal?

Reply With Quote
 
  #5 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Trading Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 2,073 since Apr 2013
Thanks: 371 given, 1,323 received

shamanov,

I would suggest to print the values inside the signal, so you know what values your code actually sees.

Without knowing your function code I can't really tell. One way that will work is storing the result for the current bar in a VariableSeries variable and access the previous bar's values this way.

Regards,

ABCTG

Follow me on Twitter Visit my Facebook Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #6 (permalink)
Toronto Canada
 
 
Posts: 9 since Jan 2018
Thanks: 5 given, 1 received

The printed values that the profit target is utilizing are the values one bar after the entry bar.

Reply With Quote
 
  #7 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Trading Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 2,073 since Apr 2013
Thanks: 371 given, 1,323 received

shamanov,

is this what you are expecting? If so, the VariableSeries approach should work.

Regards,

ABCTG

Follow me on Twitter Visit my Facebook Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #8 (permalink)
Toronto Canada
 
 
Posts: 9 since Jan 2018
Thanks: 5 given, 1 received

No, I'm trying to utilize the profit target values one bar before, i.e. the same bar as entry.

Reply With Quote
 
  #9 (permalink)
Toronto Canada
 
 
Posts: 9 since Jan 2018
Thanks: 5 given, 1 received

I figured it out, so to conclude the post here is the code that works:

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

namespace PowerLanguage.Strategy {
[IOGMode(IOGMode.Disabled)]
[CalcAtOpenNextBar(true)]

public class working_signal : SignalObject {

private IOrderMarket buy_exit;
private IOrderMarket sell_exit;
private function_profit_target value;
private int counter;



public working_signal(object _ctx):base(_ctx)
{

counter = 0;








}
protected override void Create() {
// create variable objects, function objects, order objects etc.
buy_exit = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.Sell));
sell_exit = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.BuyToCover));
value = new function_profit_target(this);
}
protected override void StartCalc() {
// assign inputs




}
protected override void CalcBar()
{

if (CurrentPosition.Side == EMarketPositionSide.Long)
{
counter = counter + 1;
if ((Bars.Close[0] - this.EntryPrice(0)) >= (value[counter]))
{
buy_exit.Send();
counter = 0;
}
}
else if (CurrentPosition.Side == EMarketPositionSide.Short)
{
counter = counter + 1;
if ((Bars.Close[0] - this.EntryPrice(0)) <= ((-1) * value[counter])
{
sell_exit.Send();
counter = 0;
}
}

}
}
}

Reply With Quote
The following user says Thank You to shamanov for this post:
 
  #10 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Trading Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 2,073 since Apr 2013
Thanks: 371 given, 1,323 received


shamanov,

thank you for the update.

Regards,

ABCTG

Follow me on Twitter Visit my Facebook Reply With Quote

Reply



futures io > > > Coding problem, Multicharts.net, Using function entry point values as exit point

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)
 

futures io is celebrating 10-years w/ over $18,000 in prizes!

Right now
 

$1,000 in Amazon Gift Cards being given away right now from GFF Brokers

Right now
 

$250 Amazon Gift Cards with our "Thanks Contest" challenge!

Right now
 

Show us your trading desks and win over $5,000 in prizes w/Jigsaw Trading

August
 

Webinar: AutoTrading World Cup Advisor w/GFF Brokers

Aug 22
 

Webinar: Suri Duddella (TBA)

Elite only
 

Webinar: Richard Bailey (TBA)

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Point Values for ..... NKD, FDAX, FESX, FSTX and Z ? mdsvtr Emini and Emicro Index Futures Trading 2 June 14th, 2015 04:12 AM
the best entry and exit point? henrick duda Stocks and ETFs Trading 3 April 19th, 2015 09:53 AM
start CumDelta from point of trade entry djarum11 Sierra Chart 14 March 17th, 2015 07:05 PM
Coding a simple entry and exit johni EasyLanguage Programming 10 July 1st, 2011 06:44 AM
favorite timeframe for intraday / taking entry point against MA ptcm Trading Journals 2 November 9th, 2010 08:32 AM


All times are GMT -4. The time now is 01:49 PM. (this page content is cached, log in for real-time version)

Copyright © 2019 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