Fron's avatar
stevee damian
norf
stevee damian's avatar

Info

Username:Fron
Name:stevee damian
Member since: 08 Jan 2020
Country:Mexico

Favorite symbols:

USDMXN

About

Visit vivapeiro.com We are just as all building automated things, and useful digital tools.

Signature

norf

Last Forum Posts

@Open API Gets a Python Library!:  18 Dec 2021, 19:40


Thank you for the christmas Gift!!

@Trigger Buy After Moving Above MA and Meets the 150 pips Requirements:  26 Aug 2021, 03:06


amusleh said:

Hi,

You just have to subtract the current price from MA value:

using cAlgo.API;
using cAlgo.API.Indicators;
using System;

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class SimpleMovingAverageSample : Robot
    {
        private double _volumeInUnits;
        private SimpleMovingAverage _simpleMovingAverage;

        [Parameter("Source", Group = "MA")]
        public DataSeries MaSource { get; set; }

        [Parameter("Period", DefaultValue = 9, Group = "MA")]
        public int MaPeriod { get; set; }

        [Parameter("Volume (Lots)", DefaultValue = 0.01, Group = "Trade")]
        public double VolumeInLots { get; set; }

        [Parameter("Stop Loss (Pips)", DefaultValue = 10, Group = "Trade")]
        public double StopLossInPips { get; set; }

        [Parameter("Take Profit (Pips)", DefaultValue = 10, Group = "Trade")]
        public double TakeProfitInPips { get; set; }

        [Parameter("Label", DefaultValue = "Sample", Group = "Trade")]
        public string Label { get; set; }

        public Position[] BotPositions
        {
            get
            {
                return Positions.FindAll(Label);
            }
        }

        protected override void OnStart()
        {
            _volumeInUnits = Symbol.QuantityToVolumeInUnits(VolumeInLots);
            _simpleMovingAverage = Indicators.SimpleMovingAverage(MaSource, MaPeriod);
        }

        protected override void OnTick()
        {
            if (BotPositions.Length > 0) return;

            var priceDistanceFromMa = Bars.ClosePrices.LastValue - _simpleMovingAverage.Result.LastValue;
            var priceDistanceFromMaInPips = priceDistanceFromMa * (Symbol.TickSize / Symbol.PipSize * Math.Pow(10, Symbol.Digits));

            if (priceDistanceFromMaInPips >= 150)
            {
                ExecuteMarketOrder(TradeType.Buy, SymbolName, _volumeInUnits, Label, StopLossInPips, TakeProfitInPips);
            }
        }
    }
}

You are Amazing brotha thank you! Not a pro at Csharp but working on it ! Big Step for me! Realized I need to learn more Math.pow and its works ! 

@Trigger Buy After Moving Above MA and Meets the 150 pips Requirements:  25 Aug 2021, 16:46


amusleh said:

Hi,  

Please check the simple moving average example cBot: cAlgo API Reference - SimpleMovingAverage Interface (ctrader.com)

The example cBot opens a buy position if faster MA cross upward the slower MA and a sell position if faster M<A cross downward the slower MA.

If you need something more complicated you can post a job request or ask one of our consultants to develop your cBot.

I have already build serveral bot with crossing MA's I was asking, my question is, what API do i  use to trigger a buy in a  cbot after its  price crosses 150 pips above that MA. 

@Trigger Buy After Moving Above MA and Meets the 150 pips Requirements:  25 Aug 2021, 05:41


I need Help with this Idea, I want to have a bot be triggered by crossing the MA, As well Trigger  A BUY 150 After. Thank you! 

@Backtest with Volume Data:  15 May 2021, 06:33


Yo Team, 

is there a way to retrieve volume data when running a backtest? I working on a order book indicador but seems like the volume data is not showing up

cheers

@Measure the distance between price and Moving average:  18 Feb 2021, 22:48


PanagiotisCharalampous said:

Hi Fron,

I am not sure what kind of function are you looking for. This is just a subtraction.

Best Regards,

Panagiotis 

Join us on Telegram

I was thinking something like a Gauge like function, it would tell the Percentage of the distance betweeen the two points price and MA,  as price  draws closer to the other or once  it crosses still calculate the differance from price and MA 

@Measure the distance between price and Moving average:  14 Feb 2021, 02:04


Good Day, 

Is there a function where i can measure the price and Moving average before they  cross or touch ? 

here is the best example i can explain

vivapeiro

@Extract Raw Volume data:  25 Jan 2021, 21:09


PanagiotisCharalampous said:

Hi Fron,

Volume data is available in Bar.TickVolume.

Best Regards,

Panagiotis 

Join us on Telegram

Thank you! 

cheers

@Extract Raw Volume data:  25 Jan 2021, 06:30


Good Day,

Which Function in ctrader automate can i use to extract raw volume data from the asset 

cheers

Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
by Fron
free  11 Jul 2022
Relative Strength Index (Bar Color Base)    Relative Strength Index (Bar Color Based)  Is A Visual Chart  Interface Rather Than RSI Being a Segregated oscillator indicator Which Would normally be displayed Below the chart.  Relative Strength Index (Bar Color Base) Indicator Overlays the OverBought and the Oversold Levels(Parameters that you can Manipulate, as well OHLC).  This Indicator Works best  with others Indicators. OverBought and the Oversold Levels Are changed with Bar Color Distinction.  https://www.vivapeiro.com/ Example Purposes ONLY . 
by Fron
free  24 Jan 2021
NOW CHOOSE FROM 8 DIFFERENT TYPES OF MOVING AVERAGES  -IMPROVE!! THE VISUAL VIEW  OF MA'S -COLOR WILL CHANGE WHEN ABOVE OR BELOW MA -PARAMETERS WOULD TAKE (OHLC),PERIODS,MA TYPE -IF YOU ONLY USE Exponential Moving Average HERE is the link (CLICK HERE) GET YOUR MERCH AT VIVAPEIRO.COM  
by Fron
free  20 Jan 2021
This is to improve the Visual of the Exponential Moving Average instead of using the Line it actually changes the Bar Color when it crosses above or Below MA Type NOTE: THE MA LINE IS JUST AN EXAMPLE WHEN DOWNLOADED IT WILL ONLY SHOW THE BAR COLOR CHANGE  PARAMETERS WILL BE PRICE (OHLC)... BY DEFAULT IT WILL ONLY USE Exponential Moving Average  
Warning! Executing cBots downloaded from this section may result in loss of funds. Use them at your own risk.

No uploaded.