NexusFi: Find Your Edge


Home Menu

 





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


Discussion in Traders Hideout

Updated
    1. trending_up 4,774 views
    2. thumb_up 4 thanks given
    3. group 2 followers
    1. forum 10 posts
    2. attach_file 0 attachments




 
Search this Thread

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

  #11 (permalink)
shamanov
Toronto Canada
 
Posts: 9 since Jan 2018
Thanks Given: 5
Thanks Received: 1

I made a mistake the correct code is

________________________________________________________________________________________________
______________________________________________________________________________________________
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]))
{
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

Can you help answer these questions
from other members on NexusFi?
Cheap historycal L1 data for stocks
Stocks and ETFs
Footprint for strategy Builder
NinjaTrader
What broker to use for trading palladium futures
Commodities
ZombieSqueeze
Platforms and Indicators
Quantum physics & Trading dynamics
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Funded Trader platforms
57 thanks
Just another trading journal: PA, Wyckoff & Trends
16 thanks
Trading with Intuition
15 thanks
Self sabotage reframed
15 thanks
GFIs1 1 DAX trade per day journal
8 thanks




Last Updated on January 19, 2018


© 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